From aef88b6027b25ee6b8197e52cb6bf8cfc8eb6395 Mon Sep 17 00:00:00 2001 From: Arkadiusz Bokowy Date: Fri, 4 Oct 2024 16:44:22 +0200 Subject: [PATCH 001/127] Add TC_CCTRL_2_1, TC_CCTRL_2_2, TC_CCTRL_2_3 to CI (#35886) * Add TC_CCTRL_2_1 to CI * Add TC_CCTRL_2_2 to CI * Fix copy-paste typo * Allow to override test runner YAML options with command line options * Add TC_CCTRL_2_3 to CI * Run tests on CI * Add MCORE.FS to PICS.yaml --- scripts/tests/run_python_test.py | 27 ++++-- src/app/tests/suites/certification/PICS.yaml | 7 ++ .../tests/suites/certification/ci-pics-values | 3 + src/python_testing/TC_CCTRL_2_1.py | 22 +++++ src/python_testing/TC_CCTRL_2_2.py | 90 +++++++++++------- src/python_testing/TC_CCTRL_2_3.py | 92 ++++++++++++------- src/python_testing/TC_MCORE_FS_1_1.py | 2 +- src/python_testing/TC_MCORE_FS_1_2.py | 2 +- src/python_testing/TC_MCORE_FS_1_5.py | 2 +- src/python_testing/execute_python_tests.py | 3 - .../chip/testing/metadata.py | 2 +- 11 files changed, 166 insertions(+), 86 deletions(-) diff --git a/scripts/tests/run_python_test.py b/scripts/tests/run_python_test.py index d7d3c6955a..0c40f9ac30 100755 --- a/scripts/tests/run_python_test.py +++ b/scripts/tests/run_python_test.py @@ -71,9 +71,9 @@ def process_test_script_output(line, is_stderr): @click.command() @click.option("--app", type=click.Path(exists=True), default=None, help='Path to local application to use, omit to use external apps.') -@click.option("--factoryreset", is_flag=True, +@click.option("--factory-reset/--no-factory-reset", default=None, help='Remove app config and repl configs (/tmp/chip* and /tmp/repl*) before running the tests.') -@click.option("--factoryreset-app-only", is_flag=True, +@click.option("--factory-reset-app-only/--no-factory-reset-app-only", default=None, help='Remove app config and repl configs (/tmp/chip* and /tmp/repl*) before running the tests, but not the controller config') @click.option("--app-args", type=str, default='', help='The extra arguments passed to the device. Can use placeholders like {SCRIPT_BASE_NAME}') @@ -90,9 +90,10 @@ def process_test_script_output(line, is_stderr): help='Script arguments, can use placeholders like {SCRIPT_BASE_NAME}.') @click.option("--script-gdb", is_flag=True, help='Run script through gdb') -@click.option("--quiet", is_flag=True, help="Do not print output from passing tests. Use this flag in CI to keep github log sizes manageable.") +@click.option("--quiet/--no-quiet", default=None, + help="Do not print output from passing tests. Use this flag in CI to keep GitHub log size manageable.") @click.option("--load-from-env", default=None, help="YAML file that contains values for environment variables.") -def main(app: str, factoryreset: bool, factoryreset_app_only: bool, app_args: str, +def main(app: str, factory_reset: bool, factory_reset_app_only: bool, app_args: str, app_ready_pattern: str, script: str, script_args: str, script_gdb: bool, quiet: bool, load_from_env): if load_from_env: reader = MetadataReader(load_from_env) @@ -106,18 +107,23 @@ def main(app: str, factoryreset: bool, factoryreset_app_only: bool, app_args: st app_args=app_args, app_ready_pattern=app_ready_pattern, script_args=script_args, - factory_reset=factoryreset, - factory_reset_app_only=factoryreset_app_only, script_gdb=script_gdb, - quiet=quiet ) ] if not runs: - raise Exception( - "No valid runs were found. Make sure you add runs to your file, see https://github.com/project-chip/connectedhomeip/blob/master/docs/testing/python.md document for reference/example.") + raise click.ClickException( + "No valid runs were found. Make sure you add runs to your file, see " + "https://github.com/project-chip/connectedhomeip/blob/master/docs/testing/python.md document for reference/example.") - coloredlogs.install(level='INFO') + # Override runs Metadata with the command line arguments + for run in runs: + if factory_reset is not None: + run.factory_reset = factory_reset + if factory_reset_app_only is not None: + run.factory_reset_app_only = factory_reset_app_only + if quiet is not None: + run.quiet = quiet for run in runs: logging.info("Executing %s %s", run.py_script_path.split('/')[-1], run.run) @@ -215,4 +221,5 @@ def main_impl(app: str, factory_reset: bool, factory_reset_app_only: bool, app_a if __name__ == '__main__': + coloredlogs.install(level='INFO') main(auto_envvar_prefix='CHIP') diff --git a/src/app/tests/suites/certification/PICS.yaml b/src/app/tests/suites/certification/PICS.yaml index 32ea708bd8..e211192595 100644 --- a/src/app/tests/suites/certification/PICS.yaml +++ b/src/app/tests/suites/certification/PICS.yaml @@ -339,6 +339,13 @@ PICS: "Does commissionee provide a Firmware Information field in the AttestationResponse?" id: MCORE.DA.ATTESTELEMENT_FW_INFO + + # + # Fabric Synchronization + # + - label: "Does the device implement Fabric Synchronization capabilities?" + id: MCORE.FS + # #IDM # diff --git a/src/app/tests/suites/certification/ci-pics-values b/src/app/tests/suites/certification/ci-pics-values index 892961a965..1f4f1f66e9 100644 --- a/src/app/tests/suites/certification/ci-pics-values +++ b/src/app/tests/suites/certification/ci-pics-values @@ -922,6 +922,9 @@ MCORE.BDX.Sender=0 MCORE.BDX.SynchronousReceiver=0 MCORE.BDX.SynchronousSender=0 +# Fabric Synchronization +MCORE.FS=1 + # General Diagnostics Cluster DGGEN.S=1 diff --git a/src/python_testing/TC_CCTRL_2_1.py b/src/python_testing/TC_CCTRL_2_1.py index a8aedb49ab..dfc6859815 100644 --- a/src/python_testing/TC_CCTRL_2_1.py +++ b/src/python_testing/TC_CCTRL_2_1.py @@ -15,6 +15,28 @@ # 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: +# app: examples/fabric-admin/scripts/fabric-sync-app.py +# app-args: --app-admin=${FABRIC_ADMIN_APP} --app-bridge=${FABRIC_BRIDGE_APP} --stdin-pipe=dut-fsa-stdin --discriminator=1234 +# app-ready-pattern: "Successfully opened pairing window on the device" +# script-args: > +# --PICS src/app/tests/suites/certification/ci-pics-values +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --endpoint 0 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factoryreset: true +# quiet: true +# === END CI TEST ARGUMENTS === + import chip.clusters as Clusters from matter_testing_support import MatterBaseTest, TestStep, default_matter_test_main, has_cluster, run_if_endpoint_matches from mobly import asserts diff --git a/src/python_testing/TC_CCTRL_2_2.py b/src/python_testing/TC_CCTRL_2_2.py index 20a03e3bd6..4b6f800170 100644 --- a/src/python_testing/TC_CCTRL_2_2.py +++ b/src/python_testing/TC_CCTRL_2_2.py @@ -18,17 +18,33 @@ # See https://github.com/project-chip/connectedhomeip/blob/master/docs/testing/python.md#defining-the-ci-test-arguments # for details about the block below. # -# TODO: Skip CI for now, we don't have any way to run this. Needs setup. See test_TC_CCTRL.py +# === BEGIN CI TEST ARGUMENTS === +# test-runner-runs: +# run1: +# app: examples/fabric-admin/scripts/fabric-sync-app.py +# app-args: --app-admin=${FABRIC_ADMIN_APP} --app-bridge=${FABRIC_BRIDGE_APP} --stdin-pipe=dut-fsa-stdin --discriminator=1234 +# app-ready-pattern: "Successfully opened pairing window on the device" +# script-args: > +# --PICS src/app/tests/suites/certification/ci-pics-values +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --endpoint 0 +# --string-arg th_server_app_path:${ALL_CLUSTERS_APP} +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factoryreset: true +# quiet: true +# === END CI TEST ARGUMENTS === # This test requires a TH_SERVER application. Please specify with --string-arg th_server_app_path: import logging import os import random -import signal -import subprocess +import tempfile import time -import uuid import chip.clusters as Clusters from chip import ChipDeviceCtrl @@ -36,6 +52,7 @@ from matter_testing_support import (MatterBaseTest, TestStep, async_test_body, default_matter_test_main, has_cluster, run_if_endpoint_matches) from mobly import asserts +from TC_MCORE_FS_1_1 import AppServer class TC_CCTRL_2_2(MatterBaseTest): @@ -43,25 +60,32 @@ class TC_CCTRL_2_2(MatterBaseTest): @async_test_body async def setup_class(self): super().setup_class() - self.app_process = None - app = self.user_params.get("th_server_app_path", None) - if not app: - asserts.fail('This test requires a TH_SERVER app. Specify app path with --string-arg th_server_app_path:') - - self.kvs = f'kvs_{str(uuid.uuid4())}' - self.port = 5543 - discriminator = random.randint(0, 4095) - passcode = 20202021 - cmd = [app] - cmd.extend(['--secured-device-port', str(5543)]) - cmd.extend(['--discriminator', str(discriminator)]) - cmd.extend(['--passcode', str(passcode)]) - cmd.extend(['--KVS', self.kvs]) - # TODO: Determine if we want these logs cooked or pushed to somewhere else - logging.info("Starting TH_SERVER") - self.app_process = subprocess.Popen(cmd) - logging.info("TH_SERVER started") - time.sleep(3) + + self.th_server = None + self.storage = None + + th_server_app = self.user_params.get("th_server_app_path", None) + if not th_server_app: + asserts.fail("This test requires a TH_SERVER app. Specify app path with --string-arg th_server_app_path:") + if not os.path.exists(th_server_app): + asserts.fail(f"The path {th_server_app} does not exist") + + # Create a temporary storage directory for keeping KVS files. + self.storage = tempfile.TemporaryDirectory(prefix=self.__class__.__name__) + logging.info("Temporary storage directory: %s", self.storage.name) + + self.th_server_port = 5543 + self.th_server_discriminator = random.randint(0, 4095) + self.th_server_passcode = 20202021 + + # Start the TH_SERVER app. + self.th_server = AppServer( + th_server_app, + storage_dir=self.storage.name, + port=self.th_server_port, + discriminator=self.th_server_discriminator, + passcode=self.th_server_passcode) + self.th_server.start() logging.info("Commissioning from separate fabric") @@ -71,20 +95,18 @@ async def setup_class(self): paa_path = str(self.matter_test_config.paa_trust_store_path) self.TH_server_controller = new_fabric_admin.NewController(nodeId=112233, paaTrustStorePath=paa_path) self.server_nodeid = 1111 - await self.TH_server_controller.CommissionOnNetwork(nodeId=self.server_nodeid, setupPinCode=passcode, filterType=ChipDeviceCtrl.DiscoveryFilterType.LONG_DISCRIMINATOR, filter=discriminator) + await self.TH_server_controller.CommissionOnNetwork( + nodeId=self.server_nodeid, + setupPinCode=self.th_server_passcode, + filterType=ChipDeviceCtrl.DiscoveryFilterType.LONG_DISCRIMINATOR, + filter=self.th_server_discriminator) logging.info("Commissioning TH_SERVER complete") def teardown_class(self): - # In case the th_server_app_path does not exist, then we failed the test - # and there is nothing to remove - if self.app_process is not None: - logging.warning("Stopping app with SIGTERM") - self.app_process.send_signal(signal.SIGTERM.value) - self.app_process.wait() - - if os.path.exists(self.kvs): - os.remove(self.kvs) - + if self.th_server is not None: + self.th_server.terminate() + if self.storage is not None: + self.storage.cleanup() super().teardown_class() def steps_TC_CCTRL_2_2(self) -> list[TestStep]: diff --git a/src/python_testing/TC_CCTRL_2_3.py b/src/python_testing/TC_CCTRL_2_3.py index 95bd546c8a..15f7304dab 100644 --- a/src/python_testing/TC_CCTRL_2_3.py +++ b/src/python_testing/TC_CCTRL_2_3.py @@ -18,17 +18,33 @@ # See https://github.com/project-chip/connectedhomeip/blob/master/docs/testing/python.md#defining-the-ci-test-arguments # for details about the block below. # -# TODO: Skip CI for now, we don't have any way to run this. Needs setup. See test_TC_CCTRL.py +# === BEGIN CI TEST ARGUMENTS === +# test-runner-runs: +# run1: +# app: examples/fabric-admin/scripts/fabric-sync-app.py +# app-args: --app-admin=${FABRIC_ADMIN_APP} --app-bridge=${FABRIC_BRIDGE_APP} --stdin-pipe=dut-fsa-stdin --discriminator=1234 +# app-ready-pattern: "Successfully opened pairing window on the device" +# script-args: > +# --PICS src/app/tests/suites/certification/ci-pics-values +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --endpoint 0 +# --string-arg th_server_app_path:${ALL_CLUSTERS_APP} +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factoryreset: true +# quiet: true +# === END CI TEST ARGUMENTS === # This test requires a TH_SERVER application. Please specify with --string-arg th_server_app_path: import logging import os import random -import signal -import subprocess +import tempfile import time -import uuid import chip.clusters as Clusters from chip import ChipDeviceCtrl @@ -36,6 +52,7 @@ from matter_testing_support import (MatterBaseTest, TestStep, async_test_body, default_matter_test_main, has_cluster, run_if_endpoint_matches) from mobly import asserts +from TC_MCORE_FS_1_1 import AppServer class TC_CCTRL_2_3(MatterBaseTest): @@ -43,25 +60,32 @@ class TC_CCTRL_2_3(MatterBaseTest): @async_test_body async def setup_class(self): super().setup_class() - self.app_process = None - app = self.user_params.get("th_server_app_path", None) - if not app: - asserts.fail('This test requires a TH_SERVER app. Specify app path with --string-arg th_server_app_path:') - - self.kvs = f'kvs_{str(uuid.uuid4())}' - self.port = 5543 - discriminator = random.randint(0, 4095) - passcode = 20202021 - cmd = [app] - cmd.extend(['--secured-device-port', str(5543)]) - cmd.extend(['--discriminator', str(discriminator)]) - cmd.extend(['--passcode', str(passcode)]) - cmd.extend(['--KVS', self.kvs]) - # TODO: Determine if we want these logs cooked or pushed to somewhere else - logging.info("Starting TH_SERVER") - self.app_process = subprocess.Popen(cmd) - logging.info("TH_SERVER started") - time.sleep(3) + + self.th_server = None + self.storage = None + + th_server_app = self.user_params.get("th_server_app_path", None) + if not th_server_app: + asserts.fail("This test requires a TH_SERVER app. Specify app path with --string-arg th_server_app_path:") + if not os.path.exists(th_server_app): + asserts.fail(f"The path {th_server_app} does not exist") + + # Create a temporary storage directory for keeping KVS files. + self.storage = tempfile.TemporaryDirectory(prefix=self.__class__.__name__) + logging.info("Temporary storage directory: %s", self.storage.name) + + self.th_server_port = 5543 + self.th_server_discriminator = random.randint(0, 4095) + self.th_server_passcode = 20202021 + + # Start the TH_SERVER app. + self.th_server = AppServer( + th_server_app, + storage_dir=self.storage.name, + port=self.th_server_port, + discriminator=self.th_server_discriminator, + passcode=self.th_server_passcode) + self.th_server.start() logging.info("Commissioning from separate fabric") @@ -71,20 +95,18 @@ async def setup_class(self): paa_path = str(self.matter_test_config.paa_trust_store_path) self.TH_server_controller = new_fabric_admin.NewController(nodeId=112233, paaTrustStorePath=paa_path) self.server_nodeid = 1111 - await self.TH_server_controller.CommissionOnNetwork(nodeId=self.server_nodeid, setupPinCode=passcode, filterType=ChipDeviceCtrl.DiscoveryFilterType.LONG_DISCRIMINATOR, filter=discriminator) + await self.TH_server_controller.CommissionOnNetwork( + nodeId=self.server_nodeid, + setupPinCode=self.th_server_passcode, + filterType=ChipDeviceCtrl.DiscoveryFilterType.LONG_DISCRIMINATOR, + filter=self.th_server_discriminator) logging.info("Commissioning TH_SERVER complete") def teardown_class(self): - # In case the th_server_app_path does not exist, then we failed the test - # and there is nothing to remove - if self.app_process is not None: - logging.warning("Stopping app with SIGTERM") - self.app_process.send_signal(signal.SIGTERM.value) - self.app_process.wait() - - if os.path.exists(self.kvs): - os.remove(self.kvs) - + if self.th_server is not None: + self.th_server.terminate() + if self.storage is not None: + self.storage.cleanup() super().teardown_class() def steps_TC_CCTRL_2_3(self) -> list[TestStep]: @@ -172,7 +194,7 @@ async def test_TC_CCTRL_2_3(self): await self.send_single_cmd(cmd, dev_ctrl=self.TH_server_controller, node_id=self.server_nodeid, endpoint=0, timedRequestTimeoutMs=5000) self.step(11) - time.sleep(30) + time.sleep(5 if self.is_pics_sdk_ci_only else 30) self.step(12) th_server_fabrics_new = await self.read_single_attribute_check_success(cluster=Clusters.OperationalCredentials, attribute=Clusters.OperationalCredentials.Attributes.Fabrics, dev_ctrl=self.TH_server_controller, node_id=self.server_nodeid, endpoint=0, fabric_filtered=False) diff --git a/src/python_testing/TC_MCORE_FS_1_1.py b/src/python_testing/TC_MCORE_FS_1_1.py index 3bdee818de..8e43d61106 100755 --- a/src/python_testing/TC_MCORE_FS_1_1.py +++ b/src/python_testing/TC_MCORE_FS_1_1.py @@ -95,7 +95,7 @@ async def setup_class(self): self.th_server_discriminator = random.randint(0, 4095) self.th_server_passcode = 20202021 - # Start the TH_SERVER_NO_UID app. + # Start the TH_SERVER app. self.th_server = AppServer( th_server_app, storage_dir=self.storage.name, diff --git a/src/python_testing/TC_MCORE_FS_1_2.py b/src/python_testing/TC_MCORE_FS_1_2.py index e1698413fa..6cd1c85bac 100644 --- a/src/python_testing/TC_MCORE_FS_1_2.py +++ b/src/python_testing/TC_MCORE_FS_1_2.py @@ -110,7 +110,7 @@ async def setup_class(self): discriminator=3840, passcode=20202021) - # Start the TH_SERVER_NO_UID app. + # Start the TH_SERVER app. self.th_server = AppServer( th_server_app, storage_dir=self.storage.name, diff --git a/src/python_testing/TC_MCORE_FS_1_5.py b/src/python_testing/TC_MCORE_FS_1_5.py index d13d81ac84..d4f408a2ce 100755 --- a/src/python_testing/TC_MCORE_FS_1_5.py +++ b/src/python_testing/TC_MCORE_FS_1_5.py @@ -111,7 +111,7 @@ async def setup_class(self): discriminator=3840, passcode=20202021) - # Start the TH_SERVER_NO_UID app. + # Start the TH_SERVER app. self.th_server = AppServer( th_server_app, storage_dir=self.storage.name, diff --git a/src/python_testing/execute_python_tests.py b/src/python_testing/execute_python_tests.py index 57bd117cf1..f316d49e25 100644 --- a/src/python_testing/execute_python_tests.py +++ b/src/python_testing/execute_python_tests.py @@ -57,9 +57,6 @@ def main(search_directory, env_file): excluded_patterns = { "MinimalRepresentation.py", # Code/Test not being used or not shared code for any other tests "TC_CNET_4_4.py", # It has no CI execution block, is not executed in CI - "TC_CCTRL_2_1.py", # They rely on example applications that inter-communicate and there is no example app that works right now - "TC_CCTRL_2_2.py", # They rely on example applications that inter-communicate and there is no example app that works right now - "TC_CCTRL_2_3.py", # They rely on example applications that inter-communicate and there is no example app that works right now "TC_DGGEN_3_2.py", # src/python_testing/test_testing/test_TC_DGGEN_3_2.py is the Unit test of this test "TC_EEVSE_Utils.py", # Shared code for TC_EEVSE, not a standalone test "TC_EWATERHTRBase.py", # Shared code for TC_EWATERHTR, not a standalone test diff --git a/src/python_testing/matter_testing_infrastructure/chip/testing/metadata.py b/src/python_testing/matter_testing_infrastructure/chip/testing/metadata.py index 2a912d0fe6..03460c4d38 100644 --- a/src/python_testing/matter_testing_infrastructure/chip/testing/metadata.py +++ b/src/python_testing/matter_testing_infrastructure/chip/testing/metadata.py @@ -40,7 +40,7 @@ class Metadata: factory_reset: bool = False factory_reset_app_only: bool = False script_gdb: bool = False - quiet: bool = True + quiet: bool = False class NamedStringIO(StringIO): From ca79d5910a50e6fb2f82748bd1540153d98601b6 Mon Sep 17 00:00:00 2001 From: C Freeman Date: Fri, 4 Oct 2024 11:33:38 -0400 Subject: [PATCH 002/127] Documentation: Fix defaults on build_python.sh (#35901) The default for the build environment shoudl be in the out dir since that's already excluded from git. Makes things easier for people following the documentation for the first time who won't necessarily change that directory to their preferred location. --- docs/guides/python_chip_controller_building.md | 3 ++- docs/testing/python.md | 2 +- docs/testing/yaml.md | 2 +- .../post_certification_tests/production_device_checks.py | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/guides/python_chip_controller_building.md b/docs/guides/python_chip_controller_building.md index 8a7acc884a..62e60b819b 100644 --- a/docs/guides/python_chip_controller_building.md +++ b/docs/guides/python_chip_controller_building.md @@ -77,7 +77,8 @@ To build and run the Python CHIP controller: 5. Build and install the Python CHIP controller: ``` - scripts/build_python.sh -m platform -i separate + scripts/build_python.sh -m platform -i out/python_env + source out/python_env/bin/activate ``` > Note: This builds the Python CHIP Controller along with the CHIP REPL as diff --git a/docs/testing/python.md b/docs/testing/python.md index a186e9bf20..00a9c3fc31 100644 --- a/docs/testing/python.md +++ b/docs/testing/python.md @@ -594,7 +594,7 @@ Next build the python wheels and create / activate a venv (called `pyenv` here, but any name may be used) ``` -./scripts/build_python.sh -i pyenv +./scripts/build_python.sh -i out/python_env source pyenv/bin/activate ``` diff --git a/docs/testing/yaml.md b/docs/testing/yaml.md index 9f65b1fed4..e3736d6272 100644 --- a/docs/testing/yaml.md +++ b/docs/testing/yaml.md @@ -334,7 +334,7 @@ Next build the python wheels and create a venv (called `py` here, but any name may be used) ``` -./scripts/build_python.sh -i py +./scripts/build_python.sh -i out/python_env source py/bin/activate ``` diff --git a/src/python_testing/post_certification_tests/production_device_checks.py b/src/python_testing/post_certification_tests/production_device_checks.py index 6988076e6a..e4262a09e7 100644 --- a/src/python_testing/post_certification_tests/production_device_checks.py +++ b/src/python_testing/post_certification_tests/production_device_checks.py @@ -31,8 +31,8 @@ # files, then add the extra dependencies. From the root: # # . scripts/activate.sh -# ./scripts/build_python.sh -i py -# source py/bin/activate +# ./scripts/build_python.sh -i out/python_env +# source out/python_env/bin/activate # pip install opencv-python requests click_option_group # python src/python_testing/post_certification_tests/production_device_checks.py From e8149871fbb9e1c18285e5a294fdf91ff3c6ee82 Mon Sep 17 00:00:00 2001 From: James Swan <122404367+swan-amazon@users.noreply.github.com> Date: Fri, 4 Oct 2024 08:59:09 -0700 Subject: [PATCH 003/127] Add provisional General Commissioning Cluster TCUpdateDeadline attribute (#35903) * Added a new server-side optional attribute `TCUpdateDeadline` (code 0x09) to the General Commissioning Cluster XML. * This attribute is a 32-bit unsigned integer (`int32u`) and is marked as non-writable. * The attribute is defined as provisional with `apiMaturity="provisional"`. * It includes read access with the privilege set to administer. * Re-generated using ./scripts/tools/zap_regen_all.py --- .../air-purifier-app.matter | 1 + .../air-quality-sensor-app.matter | 1 + .../all-clusters-app.matter | 1 + .../all-clusters-minimal-app.matter | 1 + .../bridge-common/bridge-app.matter | 1 + ...p_rootnode_dimmablelight_bCwGYSDpoe.matter | 1 + .../rootnode_airpurifier_73a6fe2651.matter | 1 + ...umiditysensor_thermostat_56de3d5f45.matter | 1 + ...ootnode_airqualitysensor_e63187f6c9.matter | 1 + ...ootnode_basicvideoplayer_0ff86e943b.matter | 1 + ...de_colortemperaturelight_hbUnzYVeyn.matter | 1 + .../rootnode_contactsensor_27f76aeaf5.matter | 1 + .../rootnode_contactsensor_lFAGG1bfRO.matter | 1 + .../rootnode_dimmablelight_bCwGYSDpoe.matter | 1 + ...tnode_dimmablepluginunit_f8a9a0b9d4.matter | 1 + .../rootnode_dishwasher_cc105034fe.matter | 1 + .../rootnode_doorlock_aNKYAreMXE.matter | 1 + ...tnode_extendedcolorlight_8lcaaYJVAa.matter | 1 + .../devices/rootnode_fan_7N2TobIlOX.matter | 1 + .../rootnode_flowsensor_1zVxHedlaV.matter | 1 + .../rootnode_genericswitch_2dfff6e516.matter | 1 + .../rootnode_genericswitch_9866e35d0b.matter | 1 + ...tnode_heatingcoolingunit_ncdGai1E5a.matter | 1 + .../rootnode_humiditysensor_Xyj4gda6Hb.matter | 1 + .../rootnode_laundrydryer_01796fe396.matter | 1 + .../rootnode_laundrywasher_fb10d238c8.matter | 1 + .../rootnode_lightsensor_lZQycTFcJK.matter | 1 + ...rootnode_occupancysensor_iHyVgifZuo.matter | 1 + .../rootnode_onofflight_bbs1b7IaOV.matter | 1 + .../rootnode_onofflight_samplemei.matter | 1 + ...ootnode_onofflightswitch_FsPlMr090Q.matter | 1 + ...rootnode_onoffpluginunit_Wtf8ss5EBY.matter | 1 + .../rootnode_pressuresensor_s0qC9wLH4k.matter | 1 + .../devices/rootnode_pump_5f904818cc.matter | 1 + .../devices/rootnode_pump_a811bb33a0.matter | 1 + ...eraturecontrolledcabinet_ffdb696680.matter | 1 + ...ode_roboticvacuumcleaner_1807ff0c49.matter | 1 + ...tnode_roomairconditioner_9cf3607804.matter | 1 + .../rootnode_smokecoalarm_686fe0dcb8.matter | 1 + .../rootnode_speaker_RpzeXdimqA.matter | 1 + ...otnode_temperaturesensor_Qy1zkNW7c3.matter | 1 + .../rootnode_thermostat_bm3fb8dhYi.matter | 1 + ...otnode_waterleakdetector_0b067acfa3.matter | 1 + .../rootnode_watervalve_6bb39f1f67.matter | 1 + .../rootnode_windowcovering_RLCxaGi9Yx.matter | 1 + .../contact-sensor-app.matter | 1 + .../nxp/zap-lit/contact-sensor-app.matter | 1 + .../nxp/zap-sit/contact-sensor-app.matter | 1 + .../dishwasher-common/dishwasher-app.matter | 1 + .../energy-management-app.matter | 1 + .../fabric-bridge-app.matter | 1 + .../nxp/zap/laundry-washer-app.matter | 1 + .../light-switch-app.matter | 1 + .../light-switch-app/qpg/zap/switch.matter | 1 + .../lighting-common/lighting-app.matter | 1 + .../data_model/lighting-app-ethernet.matter | 1 + .../data_model/lighting-app-thread.matter | 1 + .../data_model/lighting-app-wifi.matter | 1 + .../lighting-common/lighting-app.matter | 1 + .../nxp/zap/lighting-on-off.matter | 1 + examples/lighting-app/qpg/zap/light.matter | 1 + .../data_model/lighting-thread-app.matter | 1 + .../data_model/lighting-wifi-app.matter | 1 + .../lit-icd-common/lit-icd-server-app.matter | 1 + examples/lock-app/lock-common/lock-app.matter | 1 + examples/lock-app/nxp/zap/lock-app.matter | 1 + examples/lock-app/qpg/zap/lock.matter | 1 + .../silabs/data_model/lock-app.matter | 1 + .../log-source-common/log-source-app.matter | 1 + .../microwave-oven-app.matter | 1 + .../network-manager-app.matter | 1 + .../ota-provider-app.matter | 1 + .../ota-requestor-app.matter | 1 + .../placeholder/linux/apps/app1/config.matter | 2 + .../placeholder/linux/apps/app2/config.matter | 2 + examples/pump-app/pump-common/pump-app.matter | 1 + .../silabs/data_model/pump-thread-app.matter | 1 + .../silabs/data_model/pump-wifi-app.matter | 1 + .../pump-controller-app.matter | 1 + .../refrigerator-app.matter | 1 + examples/rvc-app/rvc-common/rvc-app.matter | 1 + .../smoke-co-alarm-app.matter | 1 + .../temperature-measurement.matter | 1 + .../nxp/zap/thermostat_matter_br.matter | 1 + .../nxp/zap/thermostat_matter_thread.matter | 1 + .../nxp/zap/thermostat_matter_wifi.matter | 1 + .../qpg/zap/thermostaticRadiatorValve.matter | 1 + .../thermostat-common/thermostat.matter | 1 + .../thread-br-common/thread-br-app.matter | 1 + examples/tv-app/tv-common/tv-app.matter | 2 + .../tv-casting-common/tv-casting-app.matter | 1 + .../virtual-device-app.matter | 1 + examples/window-app/common/window-app.matter | 1 + .../chip/general-commissioning-cluster.xml | 4 + .../data_model/controller-clusters.matter | 1 + .../chip/devicecontroller/ChipClusters.java | 27 ++++++ .../devicecontroller/ClusterIDMapping.java | 1 + .../devicecontroller/ClusterReadMapping.java | 11 +++ .../clusters/GeneralCommissioningCluster.kt | 93 +++++++++++++++++++ .../CHIPAttributeTLVValueDecoder.cpp | 16 ++++ .../python/chip/clusters/CHIPClusters.py | 6 ++ .../python/chip/clusters/Objects.py | 18 ++++ .../CHIP/templates/availability.yaml | 1 + .../MTRAttributeSpecifiedCheck.mm | 3 + .../MTRAttributeTLVValueDecoder.mm | 11 +++ .../CHIP/zap-generated/MTRBaseClusters.h | 6 ++ .../CHIP/zap-generated/MTRBaseClusters.mm | 36 +++++++ .../CHIP/zap-generated/MTRClusterConstants.h | 1 + .../CHIP/zap-generated/MTRClusterNames.mm | 4 + .../CHIP/zap-generated/MTRClusters.h | 2 + .../CHIP/zap-generated/MTRClusters.mm | 5 + .../zap-generated/attributes/Accessors.cpp | 47 ++++++++++ .../zap-generated/attributes/Accessors.h | 6 ++ .../zap-generated/cluster-objects.cpp | 2 + .../zap-generated/cluster-objects.h | 13 +++ .../app-common/zap-generated/ids/Attributes.h | 4 + .../zap-generated/cluster/Commands.h | 5 + .../cluster/logging/DataModelLogger.cpp | 5 + .../cluster/logging/EntryToText.cpp | 2 + .../zap-generated/cluster/Commands.h | 90 ++++++++++++++++++ 120 files changed, 516 insertions(+) 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 dbcd306f44..95cd8bc2d0 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 @@ -739,6 +739,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter b/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter index dd9a87d59d..b9da1aef24 100644 --- a/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter +++ b/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter @@ -739,6 +739,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; 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 2d5c20aee4..45e58fffca 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 @@ -1642,6 +1642,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; 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 3fa32d226a..630f3a6d2e 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 @@ -1557,6 +1557,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/bridge-app/bridge-common/bridge-app.matter b/examples/bridge-app/bridge-common/bridge-app.matter index 89941b6f60..8274cbb34f 100644 --- a/examples/bridge-app/bridge-common/bridge-app.matter +++ b/examples/bridge-app/bridge-common/bridge-app.matter @@ -1192,6 +1192,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter index b2a08e643c..283e591a56 100644 --- a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter @@ -1034,6 +1034,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/chef/devices/rootnode_airpurifier_73a6fe2651.matter b/examples/chef/devices/rootnode_airpurifier_73a6fe2651.matter index c6d30a8265..6dc1faa51f 100644 --- a/examples/chef/devices/rootnode_airpurifier_73a6fe2651.matter +++ b/examples/chef/devices/rootnode_airpurifier_73a6fe2651.matter @@ -811,6 +811,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; 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 0069c9881f..8271fefe26 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 @@ -662,6 +662,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter index e810c5332a..cfdae69816 100644 --- a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter +++ b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter @@ -998,6 +998,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter index 20a5e81798..0bf91385a5 100644 --- a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter +++ b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter @@ -936,6 +936,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter index 871fc21daa..63b7de8597 100644 --- a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter +++ b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter @@ -1013,6 +1013,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.matter b/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.matter index 772daa2010..77375d8443 100644 --- a/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.matter +++ b/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.matter @@ -998,6 +998,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter index a25cc32ae1..5265088575 100644 --- a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter +++ b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter @@ -1096,6 +1096,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter index 62df14dd5c..183eb0c593 100644 --- a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter @@ -1034,6 +1034,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.matter b/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.matter index 788fdf8d74..f48076c4d2 100644 --- a/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.matter +++ b/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.matter @@ -1034,6 +1034,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter b/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter index fdbb4868a3..8f49c108e2 100644 --- a/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter +++ b/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter @@ -700,6 +700,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter index 4655c61d4d..c461e7324c 100644 --- a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter +++ b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter @@ -998,6 +998,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter index 95ba0c27de..d9f033b0e0 100644 --- a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter +++ b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter @@ -1034,6 +1034,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter index de277d25e7..d772e29c3c 100644 --- a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter +++ b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter @@ -816,6 +816,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter index ce817d5365..466dbe2c41 100644 --- a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter +++ b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter @@ -837,6 +837,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/chef/devices/rootnode_genericswitch_2dfff6e516.matter b/examples/chef/devices/rootnode_genericswitch_2dfff6e516.matter index 88f1d2389d..ba63c3ee07 100644 --- a/examples/chef/devices/rootnode_genericswitch_2dfff6e516.matter +++ b/examples/chef/devices/rootnode_genericswitch_2dfff6e516.matter @@ -844,6 +844,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter b/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter index 18764919ac..60699fd679 100644 --- a/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter +++ b/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter @@ -844,6 +844,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter index 32e64fc401..36a655d47d 100644 --- a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter +++ b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter @@ -1034,6 +1034,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter index 11390f7cc5..e633b0f2be 100644 --- a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter +++ b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter @@ -837,6 +837,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/chef/devices/rootnode_laundrydryer_01796fe396.matter b/examples/chef/devices/rootnode_laundrydryer_01796fe396.matter index 4c5010e278..b917fa102e 100644 --- a/examples/chef/devices/rootnode_laundrydryer_01796fe396.matter +++ b/examples/chef/devices/rootnode_laundrydryer_01796fe396.matter @@ -700,6 +700,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter index 4ab9ad0064..e595c866c2 100644 --- a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter +++ b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter @@ -561,6 +561,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter index fdeb9a209c..32528515cf 100644 --- a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter +++ b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter @@ -837,6 +837,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter index bb47238f4c..04cf5fb646 100644 --- a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter +++ b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter @@ -837,6 +837,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter index f755ba75a5..f63c51eb69 100644 --- a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter +++ b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter @@ -1034,6 +1034,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/chef/devices/rootnode_onofflight_samplemei.matter b/examples/chef/devices/rootnode_onofflight_samplemei.matter index 3fa6833ee3..5f8e70cc64 100644 --- a/examples/chef/devices/rootnode_onofflight_samplemei.matter +++ b/examples/chef/devices/rootnode_onofflight_samplemei.matter @@ -1034,6 +1034,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter index 8eeb66e2e5..81fb81958f 100644 --- a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter +++ b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter @@ -909,6 +909,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter index 7251ede5ed..94414ae316 100644 --- a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter +++ b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter @@ -909,6 +909,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter index 993bc43a5a..43e8de7b5f 100644 --- a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter +++ b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter @@ -837,6 +837,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/chef/devices/rootnode_pump_5f904818cc.matter b/examples/chef/devices/rootnode_pump_5f904818cc.matter index aee0aa7b2e..8ea352ca7c 100644 --- a/examples/chef/devices/rootnode_pump_5f904818cc.matter +++ b/examples/chef/devices/rootnode_pump_5f904818cc.matter @@ -683,6 +683,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/chef/devices/rootnode_pump_a811bb33a0.matter b/examples/chef/devices/rootnode_pump_a811bb33a0.matter index 84d57e7d21..5b2371526d 100644 --- a/examples/chef/devices/rootnode_pump_a811bb33a0.matter +++ b/examples/chef/devices/rootnode_pump_a811bb33a0.matter @@ -683,6 +683,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter index 00bf68f859..80faecb735 100644 --- a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter +++ b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter @@ -561,6 +561,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter b/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter index 1306114cc1..b4094e13d8 100644 --- a/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter +++ b/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter @@ -921,6 +921,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter index 4910c3b699..3ebdc0a231 100644 --- a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter +++ b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter @@ -734,6 +734,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter b/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter index b685a6740f..1f6e1c17b7 100644 --- a/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter +++ b/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter @@ -921,6 +921,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter index c2b2056aae..c5a1ccc522 100644 --- a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter +++ b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter @@ -957,6 +957,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter index 64a2449991..6199388887 100644 --- a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter +++ b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter @@ -837,6 +837,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter index 8303eef5ee..7993032488 100644 --- a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter +++ b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter @@ -898,6 +898,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/chef/devices/rootnode_waterleakdetector_0b067acfa3.matter b/examples/chef/devices/rootnode_waterleakdetector_0b067acfa3.matter index a2cf704eaa..bd89a85312 100644 --- a/examples/chef/devices/rootnode_waterleakdetector_0b067acfa3.matter +++ b/examples/chef/devices/rootnode_waterleakdetector_0b067acfa3.matter @@ -921,6 +921,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/chef/devices/rootnode_watervalve_6bb39f1f67.matter b/examples/chef/devices/rootnode_watervalve_6bb39f1f67.matter index 139d5dc6a2..cf3009d291 100644 --- a/examples/chef/devices/rootnode_watervalve_6bb39f1f67.matter +++ b/examples/chef/devices/rootnode_watervalve_6bb39f1f67.matter @@ -861,6 +861,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter index 62c95a2df6..0f1d25c571 100644 --- a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter +++ b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter @@ -837,6 +837,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter index 38c1707110..55820ca537 100644 --- a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter +++ b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter @@ -816,6 +816,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.matter b/examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.matter index aeb4a47927..a5e91d91f1 100644 --- a/examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.matter +++ b/examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.matter @@ -739,6 +739,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/contact-sensor-app/nxp/zap-sit/contact-sensor-app.matter b/examples/contact-sensor-app/nxp/zap-sit/contact-sensor-app.matter index bbf9333d9b..36db43dcb6 100644 --- a/examples/contact-sensor-app/nxp/zap-sit/contact-sensor-app.matter +++ b/examples/contact-sensor-app/nxp/zap-sit/contact-sensor-app.matter @@ -739,6 +739,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter b/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter index d71eb6e367..6ee107a38f 100644 --- a/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter +++ b/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter @@ -709,6 +709,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/energy-management-app/energy-management-common/energy-management-app.matter b/examples/energy-management-app/energy-management-common/energy-management-app.matter index bae77f5f8e..a8a10075ef 100644 --- a/examples/energy-management-app/energy-management-common/energy-management-app.matter +++ b/examples/energy-management-app/energy-management-common/energy-management-app.matter @@ -931,6 +931,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.matter b/examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.matter index 57ce56efc3..b261eba0bb 100644 --- a/examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.matter +++ b/examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.matter @@ -710,6 +710,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/laundry-washer-app/nxp/zap/laundry-washer-app.matter b/examples/laundry-washer-app/nxp/zap/laundry-washer-app.matter index 8f30d53f6e..39546259b0 100644 --- a/examples/laundry-washer-app/nxp/zap/laundry-washer-app.matter +++ b/examples/laundry-washer-app/nxp/zap/laundry-washer-app.matter @@ -1194,6 +1194,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; 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 947a24740f..56608b78f2 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 @@ -959,6 +959,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/light-switch-app/qpg/zap/switch.matter b/examples/light-switch-app/qpg/zap/switch.matter index 0cbae08b34..979ae18fa4 100644 --- a/examples/light-switch-app/qpg/zap/switch.matter +++ b/examples/light-switch-app/qpg/zap/switch.matter @@ -1343,6 +1343,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/lighting-app-data-mode-no-unique-id/lighting-common/lighting-app.matter b/examples/lighting-app-data-mode-no-unique-id/lighting-common/lighting-app.matter index c5ee2bb6d3..0979b305ca 100644 --- a/examples/lighting-app-data-mode-no-unique-id/lighting-common/lighting-app.matter +++ b/examples/lighting-app-data-mode-no-unique-id/lighting-common/lighting-app.matter @@ -1013,6 +1013,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; 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 ac770a74de..8c4fa34560 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter @@ -1013,6 +1013,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; 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 c8c3ebca3a..d528254100 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter @@ -1013,6 +1013,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; 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 66ccb1f4fb..6d26e8c2f8 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter @@ -1013,6 +1013,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index 011d11fc33..f8e6d2e795 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -1013,6 +1013,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/lighting-app/nxp/zap/lighting-on-off.matter b/examples/lighting-app/nxp/zap/lighting-on-off.matter index 99a3c51c41..d76ebd5cd8 100644 --- a/examples/lighting-app/nxp/zap/lighting-on-off.matter +++ b/examples/lighting-app/nxp/zap/lighting-on-off.matter @@ -1013,6 +1013,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/lighting-app/qpg/zap/light.matter b/examples/lighting-app/qpg/zap/light.matter index a352d37dbb..fc3de298b9 100644 --- a/examples/lighting-app/qpg/zap/light.matter +++ b/examples/lighting-app/qpg/zap/light.matter @@ -1013,6 +1013,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; 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 52285ea3b4..ac3896a6d9 100644 --- a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter @@ -1013,6 +1013,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; 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 6fb823728b..61be1cd045 100644 --- a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter @@ -1272,6 +1272,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.matter b/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.matter index 2d3430c8d9..e67ae7524b 100644 --- a/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.matter +++ b/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.matter @@ -765,6 +765,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/lock-app/lock-common/lock-app.matter b/examples/lock-app/lock-common/lock-app.matter index 5e9c4080af..94c2fcf3bb 100644 --- a/examples/lock-app/lock-common/lock-app.matter +++ b/examples/lock-app/lock-common/lock-app.matter @@ -1024,6 +1024,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/lock-app/nxp/zap/lock-app.matter b/examples/lock-app/nxp/zap/lock-app.matter index c975e2b7c1..fc3a8917b2 100644 --- a/examples/lock-app/nxp/zap/lock-app.matter +++ b/examples/lock-app/nxp/zap/lock-app.matter @@ -756,6 +756,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/lock-app/qpg/zap/lock.matter b/examples/lock-app/qpg/zap/lock.matter index 0c408680b1..53bf1d4f8d 100644 --- a/examples/lock-app/qpg/zap/lock.matter +++ b/examples/lock-app/qpg/zap/lock.matter @@ -816,6 +816,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/lock-app/silabs/data_model/lock-app.matter b/examples/lock-app/silabs/data_model/lock-app.matter index 9902b87beb..bf8c297e1c 100644 --- a/examples/lock-app/silabs/data_model/lock-app.matter +++ b/examples/lock-app/silabs/data_model/lock-app.matter @@ -1024,6 +1024,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/log-source-app/log-source-common/log-source-app.matter b/examples/log-source-app/log-source-common/log-source-app.matter index 3da4e2a7ec..e5f6ee1007 100644 --- a/examples/log-source-app/log-source-common/log-source-app.matter +++ b/examples/log-source-app/log-source-common/log-source-app.matter @@ -405,6 +405,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/microwave-oven-app/microwave-oven-common/microwave-oven-app.matter b/examples/microwave-oven-app/microwave-oven-common/microwave-oven-app.matter index f9ee0e90dd..f22729df88 100644 --- a/examples/microwave-oven-app/microwave-oven-common/microwave-oven-app.matter +++ b/examples/microwave-oven-app/microwave-oven-common/microwave-oven-app.matter @@ -629,6 +629,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/network-manager-app/network-manager-common/network-manager-app.matter b/examples/network-manager-app/network-manager-common/network-manager-app.matter index e3b0fb9de3..5d53e15732 100644 --- a/examples/network-manager-app/network-manager-common/network-manager-app.matter +++ b/examples/network-manager-app/network-manager-common/network-manager-app.matter @@ -535,6 +535,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter index a8773f83d1..7538f304f3 100644 --- a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter +++ b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter @@ -736,6 +736,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter index 2ab9918446..b7514cf573 100644 --- a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter +++ b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter @@ -888,6 +888,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index 79d17e5306..30f9ca883b 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -1672,6 +1672,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1763,6 +1764,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 467aed8bac..d8ced986c7 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -1629,6 +1629,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1720,6 +1721,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/pump-app/pump-common/pump-app.matter b/examples/pump-app/pump-common/pump-app.matter index fc30273ac0..d4ac8e35a3 100644 --- a/examples/pump-app/pump-common/pump-app.matter +++ b/examples/pump-app/pump-common/pump-app.matter @@ -957,6 +957,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/pump-app/silabs/data_model/pump-thread-app.matter b/examples/pump-app/silabs/data_model/pump-thread-app.matter index c45e6dcfb8..7d730d759c 100644 --- a/examples/pump-app/silabs/data_model/pump-thread-app.matter +++ b/examples/pump-app/silabs/data_model/pump-thread-app.matter @@ -957,6 +957,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/pump-app/silabs/data_model/pump-wifi-app.matter b/examples/pump-app/silabs/data_model/pump-wifi-app.matter index c45e6dcfb8..7d730d759c 100644 --- a/examples/pump-app/silabs/data_model/pump-wifi-app.matter +++ b/examples/pump-app/silabs/data_model/pump-wifi-app.matter @@ -957,6 +957,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter index 43d27b44e1..a7c2ebcd0f 100644 --- a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter +++ b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter @@ -832,6 +832,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter b/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter index 6a43e52c64..f3149e01af 100644 --- a/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter +++ b/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter @@ -561,6 +561,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/rvc-app/rvc-common/rvc-app.matter b/examples/rvc-app/rvc-common/rvc-app.matter index c6af761d33..4f981a8f17 100644 --- a/examples/rvc-app/rvc-common/rvc-app.matter +++ b/examples/rvc-app/rvc-common/rvc-app.matter @@ -585,6 +585,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter index fbba1a8ab8..a593b61e3a 100644 --- a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter +++ b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter @@ -1075,6 +1075,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter index 925b3ee868..84acb6b3c4 100644 --- a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter +++ b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter @@ -715,6 +715,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/thermostat/nxp/zap/thermostat_matter_br.matter b/examples/thermostat/nxp/zap/thermostat_matter_br.matter index 9b35e9d22b..72c23a4e22 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_br.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_br.matter @@ -866,6 +866,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/thermostat/nxp/zap/thermostat_matter_thread.matter b/examples/thermostat/nxp/zap/thermostat_matter_thread.matter index f02c08a6a5..49856ff010 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_thread.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_thread.matter @@ -866,6 +866,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter b/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter index a583ab8f96..1aad4ca9b0 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter @@ -866,6 +866,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter b/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter index 1f7b2191bc..86383cf904 100644 --- a/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter +++ b/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter @@ -913,6 +913,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/thermostat/thermostat-common/thermostat.matter b/examples/thermostat/thermostat-common/thermostat.matter index 08106665d9..1c062da0fe 100644 --- a/examples/thermostat/thermostat-common/thermostat.matter +++ b/examples/thermostat/thermostat-common/thermostat.matter @@ -974,6 +974,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/thread-br-app/thread-br-common/thread-br-app.matter b/examples/thread-br-app/thread-br-common/thread-br-app.matter index ce073c319b..63a6a567a3 100644 --- a/examples/thread-br-app/thread-br-common/thread-br-app.matter +++ b/examples/thread-br-app/thread-br-common/thread-br-app.matter @@ -535,6 +535,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter index 6ea0892fac..b3a06cd2d3 100644 --- a/examples/tv-app/tv-common/tv-app.matter +++ b/examples/tv-app/tv-common/tv-app.matter @@ -937,6 +937,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1028,6 +1029,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter index 6d8fb379e5..3dba518b75 100644 --- a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter +++ b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter @@ -1000,6 +1000,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; 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 cbb366ad54..22b2c8999a 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 @@ -1177,6 +1177,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/window-app/common/window-app.matter b/examples/window-app/common/window-app.matter index 50a47d27c7..c7eee099b9 100644 --- a/examples/window-app/common/window-app.matter +++ b/examples/window-app/common/window-app.matter @@ -1101,6 +1101,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/src/app/zap-templates/zcl/data-model/chip/general-commissioning-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/general-commissioning-cluster.xml index da813b60fe..167f7d13e3 100644 --- a/src/app/zap-templates/zcl/data-model/chip/general-commissioning-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/general-commissioning-cluster.xml @@ -77,6 +77,10 @@ limitations under the License. TCAcknowledgementsRequired + + TCUpdateDeadline + + Arm the persistent fail-safe timer with an expiry time of now + ExpiryLengthSeconds using device clock diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index c222fa904e..78c5a89323 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -1582,6 +1582,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java index 88e4e0fb90..3a92667fb6 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java @@ -7987,6 +7987,7 @@ public static class GeneralCommissioningCluster extends BaseChipCluster { private static final long TC_MIN_REQUIRED_VERSION_ATTRIBUTE_ID = 6L; private static final long TC_ACKNOWLEDGEMENTS_ATTRIBUTE_ID = 7L; private static final long TC_ACKNOWLEDGEMENTS_REQUIRED_ATTRIBUTE_ID = 8L; + private static final long TC_UPDATE_DEADLINE_ATTRIBUTE_ID = 9L; private static final long GENERATED_COMMAND_LIST_ATTRIBUTE_ID = 65528L; private static final long ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID = 65529L; private static final long EVENT_LIST_ATTRIBUTE_ID = 65530L; @@ -8436,6 +8437,32 @@ public void onSuccess(byte[] tlv) { }, TC_ACKNOWLEDGEMENTS_REQUIRED_ATTRIBUTE_ID, minInterval, maxInterval); } + public void readTCUpdateDeadlineAttribute( + LongAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TC_UPDATE_DEADLINE_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, TC_UPDATE_DEADLINE_ATTRIBUTE_ID, true); + } + + public void subscribeTCUpdateDeadlineAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TC_UPDATE_DEADLINE_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, TC_UPDATE_DEADLINE_ATTRIBUTE_ID, minInterval, maxInterval); + } + public void readGeneratedCommandListAttribute( GeneratedCommandListAttributeCallback callback) { ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java index af30b0eb34..113c958fad 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -2872,6 +2872,7 @@ public enum Attribute { TCMinRequiredVersion(6L), TCAcknowledgements(7L), TCAcknowledgementsRequired(8L), + TCUpdateDeadline(9L), GeneratedCommandList(65528L), AcceptedCommandList(65529L), EventList(65530L), diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java index 05036e0391..4da39ee645 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java @@ -2426,6 +2426,17 @@ private static Map readGeneralCommissioningInteractionI readGeneralCommissioningTCAcknowledgementsRequiredCommandParams ); result.put("readTCAcknowledgementsRequiredAttribute", readGeneralCommissioningTCAcknowledgementsRequiredAttributeInteractionInfo); + Map readGeneralCommissioningTCUpdateDeadlineCommandParams = new LinkedHashMap(); + InteractionInfo readGeneralCommissioningTCUpdateDeadlineAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.GeneralCommissioningCluster) cluster).readTCUpdateDeadlineAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readGeneralCommissioningTCUpdateDeadlineCommandParams + ); + result.put("readTCUpdateDeadlineAttribute", readGeneralCommissioningTCUpdateDeadlineAttributeInteractionInfo); Map readGeneralCommissioningGeneratedCommandListCommandParams = new LinkedHashMap(); InteractionInfo readGeneralCommissioningGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/GeneralCommissioningCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/GeneralCommissioningCluster.kt index 92e76e250f..93fafc69f4 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/GeneralCommissioningCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/GeneralCommissioningCluster.kt @@ -1170,6 +1170,99 @@ class GeneralCommissioningCluster( } } + suspend fun readTCUpdateDeadlineAttribute(): UInt? { + val ATTRIBUTE_ID: UInt = 9u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Tcupdatedeadline attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUInt(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun subscribeTCUpdateDeadlineAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 9u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UIntSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Tcupdatedeadline attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUInt(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(UIntSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(UIntSubscriptionState.SubscriptionEstablished) + } + } + } + } + suspend fun readGeneratedCommandListAttribute(): GeneratedCommandListAttribute { val ATTRIBUTE_ID: UInt = 65528u diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index 741e40567f..9e5c2620cf 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -5277,6 +5277,22 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jnivalue, value); return value; } + case Attributes::TCUpdateDeadline::Id: { + using TypeInfo = Attributes::TCUpdateDeadline::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } case Attributes::GeneratedCommandList::Id: { using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; TypeInfo::DecodableType cppValue; diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 1df4d9c9f6..b2a0bb09b3 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -1855,6 +1855,12 @@ class ChipClusters: "type": "bool", "reportable": True, }, + 0x00000009: { + "attributeName": "TCUpdateDeadline", + "attributeId": 0x00000009, + "type": "int", + "reportable": True, + }, 0x0000FFF8: { "attributeName": "GeneratedCommandList", "attributeId": 0x0000FFF8, diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index b11ad8e725..b36c5b9cae 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -6542,6 +6542,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="TCMinRequiredVersion", Tag=0x00000006, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="TCAcknowledgements", Tag=0x00000007, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="TCAcknowledgementsRequired", Tag=0x00000008, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="TCUpdateDeadline", Tag=0x00000009, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), @@ -6559,6 +6560,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: TCMinRequiredVersion: 'typing.Optional[uint]' = None TCAcknowledgements: 'typing.Optional[uint]' = None TCAcknowledgementsRequired: 'typing.Optional[bool]' = None + TCUpdateDeadline: 'typing.Optional[uint]' = None generatedCommandList: 'typing.List[uint]' = None acceptedCommandList: 'typing.List[uint]' = None eventList: 'typing.List[uint]' = None @@ -6895,6 +6897,22 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'typing.Optional[bool]' = None + @dataclass + class TCUpdateDeadline(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000030 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000009 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + @dataclass class GeneratedCommandList(ClusterAttributeDescriptor): @ChipUtility.classproperty diff --git a/src/darwin/Framework/CHIP/templates/availability.yaml b/src/darwin/Framework/CHIP/templates/availability.yaml index 3f65e9facf..0237acfb46 100644 --- a/src/darwin/Framework/CHIP/templates/availability.yaml +++ b/src/darwin/Framework/CHIP/templates/availability.yaml @@ -9767,6 +9767,7 @@ - TCMinRequiredVersion - TCAcknowledgements - TCAcknowledgementsRequired + - TCUpdateDeadline OccupancySensing: # Targeting 1.4 - HoldTime diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm index a2878cf511..51a423a4ad 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm @@ -825,6 +825,9 @@ static BOOL AttributeIsSpecifiedInGeneralCommissioningCluster(AttributeId aAttri case Attributes::TCAcknowledgementsRequired::Id: { return YES; } + case Attributes::TCUpdateDeadline::Id: { + return YES; + } case Attributes::GeneratedCommandList::Id: { return YES; } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index ae28957899..907bda8ba8 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -2282,6 +2282,17 @@ static id _Nullable DecodeAttributeValueForGeneralCommissioningCluster(Attribute value = [NSNumber numberWithBool:cppValue]; return value; } + case Attributes::TCUpdateDeadline::Id: { + using TypeInfo = Attributes::TCUpdateDeadline::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; + return value; + } default: { break; } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 36c879b528..264434027d 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -2091,6 +2091,12 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; + (void)readAttributeTCAcknowledgementsRequiredWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)readAttributeTCUpdateDeadlineWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeTCUpdateDeadlineWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeTCUpdateDeadlineWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index 5bee560bd0..64af297512 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -16644,6 +16644,42 @@ + (void)readAttributeTCAcknowledgementsRequiredWithClusterStateCache:(MTRCluster completion:completion]; } +- (void)readAttributeTCUpdateDeadlineWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = GeneralCommissioning::Attributes::TCUpdateDeadline::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeTCUpdateDeadlineWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = GeneralCommissioning::Attributes::TCUpdateDeadline::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeTCUpdateDeadlineWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = GeneralCommissioning::Attributes::TCUpdateDeadline::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { using TypeInfo = GeneralCommissioning::Attributes::GeneratedCommandList::TypeInfo; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index 97e0c30e92..95b1135767 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -1107,6 +1107,7 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterGeneralCommissioningAttributeTCMinRequiredVersionID MTR_PROVISIONALLY_AVAILABLE = 0x00000006, MTRAttributeIDTypeClusterGeneralCommissioningAttributeTCAcknowledgementsID MTR_PROVISIONALLY_AVAILABLE = 0x00000007, MTRAttributeIDTypeClusterGeneralCommissioningAttributeTCAcknowledgementsRequiredID MTR_PROVISIONALLY_AVAILABLE = 0x00000008, + MTRAttributeIDTypeClusterGeneralCommissioningAttributeTCUpdateDeadlineID MTR_PROVISIONALLY_AVAILABLE = 0x00000009, MTRAttributeIDTypeClusterGeneralCommissioningAttributeGeneratedCommandListID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, MTRAttributeIDTypeClusterGeneralCommissioningAttributeAcceptedCommandListID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, MTRAttributeIDTypeClusterGeneralCommissioningAttributeEventListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeEventListID, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm index 46791f9c12..dff1198510 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm @@ -1456,6 +1456,10 @@ result = @"TCAcknowledgementsRequired"; break; + case MTRAttributeIDTypeClusterGeneralCommissioningAttributeTCUpdateDeadlineID: + result = @"TCUpdateDeadline"; + break; + case MTRAttributeIDTypeClusterGeneralCommissioningAttributeGeneratedCommandListID: result = @"GeneratedCommandList"; break; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index 43a909b7e4..401e76bda1 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -993,6 +993,8 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) - (NSDictionary * _Nullable)readAttributeTCAcknowledgementsRequiredWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (NSDictionary * _Nullable)readAttributeTCUpdateDeadlineWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + - (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); - (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index 5864634bb6..cdae93833c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -3102,6 +3102,11 @@ - (void)writeAttributeBreadcrumbWithValue:(NSDictionary *)dataVa return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeGeneralCommissioningID) attributeID:@(MTRAttributeIDTypeClusterGeneralCommissioningAttributeTCAcknowledgementsRequiredID) params:params]; } +- (NSDictionary * _Nullable)readAttributeTCUpdateDeadlineWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeGeneralCommissioningID) attributeID:@(MTRAttributeIDTypeClusterGeneralCommissioningAttributeTCUpdateDeadlineID) params:params]; +} + - (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params { return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeGeneralCommissioningID) attributeID:@(MTRAttributeIDTypeClusterGeneralCommissioningAttributeGeneratedCommandListID) params:params]; 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 8d488688d7..f6a64990ad 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 @@ -5389,6 +5389,53 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) } // namespace TCAcknowledgementsRequired +namespace TCUpdateDeadline { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::GeneralCommissioning::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::GeneralCommissioning::Id, Id), + EmberAfWriteDataInput(writable, ZCL_INT32U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::GeneralCommissioning::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); +} + +} // namespace TCUpdateDeadline + namespace FeatureMap { Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value) 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 712f13d790..327355fb03 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 @@ -834,6 +834,12 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value); Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty); } // namespace TCAcknowledgementsRequired +namespace TCUpdateDeadline { +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value); // int32u +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty); +} // namespace TCUpdateDeadline + namespace FeatureMap { Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value); // bitmap32 Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value); diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index 7999de734b..7c024f24f4 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -5275,6 +5275,8 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre return DataModel::Decode(reader, TCAcknowledgements); case Attributes::TCAcknowledgementsRequired::TypeInfo::GetAttributeId(): return DataModel::Decode(reader, TCAcknowledgementsRequired); + case Attributes::TCUpdateDeadline::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, TCUpdateDeadline); case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): return DataModel::Decode(reader, generatedCommandList); case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): 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 2917e4c924..0df61a5885 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 @@ -6533,6 +6533,18 @@ struct TypeInfo static constexpr bool MustUseTimedWrite() { return false; } }; } // namespace TCAcknowledgementsRequired +namespace TCUpdateDeadline { +struct TypeInfo +{ + using Type = uint32_t; + using DecodableType = uint32_t; + using DecodableArgType = uint32_t; + + static constexpr ClusterId GetClusterId() { return Clusters::GeneralCommissioning::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::TCUpdateDeadline::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace TCUpdateDeadline namespace GeneratedCommandList { struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo { @@ -6589,6 +6601,7 @@ struct TypeInfo Attributes::TCMinRequiredVersion::TypeInfo::DecodableType TCMinRequiredVersion = static_cast(0); Attributes::TCAcknowledgements::TypeInfo::DecodableType TCAcknowledgements = static_cast(0); Attributes::TCAcknowledgementsRequired::TypeInfo::DecodableType TCAcknowledgementsRequired = static_cast(0); + Attributes::TCUpdateDeadline::TypeInfo::DecodableType TCUpdateDeadline = static_cast(0); Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; Attributes::EventList::TypeInfo::DecodableType eventList; diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h index ca40e31b73..80159cd477 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h @@ -1020,6 +1020,10 @@ namespace TCAcknowledgementsRequired { static constexpr AttributeId Id = 0x00000008; } // namespace TCAcknowledgementsRequired +namespace TCUpdateDeadline { +static constexpr AttributeId Id = 0x00000009; +} // namespace TCUpdateDeadline + namespace GeneratedCommandList { static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id; } // namespace GeneratedCommandList diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 4d2c793f47..388af146a0 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -2203,6 +2203,7 @@ class OtaSoftwareUpdateRequestorAnnounceOTAProvider : public ClusterCommand | * TCMinRequiredVersion | 0x0006 | | * TCAcknowledgements | 0x0007 | | * TCAcknowledgementsRequired | 0x0008 | +| * TCUpdateDeadline | 0x0009 | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | | * EventList | 0xFFFA | @@ -16905,6 +16906,7 @@ void registerClusterGeneralCommissioning(Commands & commands, CredentialIssuerCo make_unique(Id, "tcacknowledgements", Attributes::TCAcknowledgements::Id, credsIssuerConfig), // make_unique(Id, "tcacknowledgements-required", Attributes::TCAcknowledgementsRequired::Id, credsIssuerConfig), // + make_unique(Id, "tcupdate-deadline", Attributes::TCUpdateDeadline::Id, credsIssuerConfig), // make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // @@ -16933,6 +16935,8 @@ void registerClusterGeneralCommissioning(Commands & commands, CredentialIssuerCo WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>(Id, "tcacknowledgements-required", 0, 1, Attributes::TCAcknowledgementsRequired::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "tcupdate-deadline", 0, UINT32_MAX, Attributes::TCUpdateDeadline::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>>( Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // @@ -16959,6 +16963,7 @@ void registerClusterGeneralCommissioning(Commands & commands, CredentialIssuerCo make_unique(Id, "tcacknowledgements", Attributes::TCAcknowledgements::Id, credsIssuerConfig), // make_unique(Id, "tcacknowledgements-required", Attributes::TCAcknowledgementsRequired::Id, credsIssuerConfig), // + make_unique(Id, "tcupdate-deadline", Attributes::TCUpdateDeadline::Id, credsIssuerConfig), // make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // 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 479deb7799..917ba818bc 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -10259,6 +10259,11 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("TCAcknowledgementsRequired", 1, value); } + case GeneralCommissioning::Attributes::TCUpdateDeadline::Id: { + uint32_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("TCUpdateDeadline", 1, value); + } case GeneralCommissioning::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, 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 index f9e3e9d6e5..cbf31dc81d 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp @@ -834,6 +834,8 @@ char const * AttributeIdToText(chip::ClusterId cluster, chip::AttributeId id) return "TCAcknowledgements"; case chip::app::Clusters::GeneralCommissioning::Attributes::TCAcknowledgementsRequired::Id: return "TCAcknowledgementsRequired"; + case chip::app::Clusters::GeneralCommissioning::Attributes::TCUpdateDeadline::Id: + return "TCUpdateDeadline"; case chip::app::Clusters::GeneralCommissioning::Attributes::GeneratedCommandList::Id: return "GeneratedCommandList"; case chip::app::Clusters::GeneralCommissioning::Attributes::AcceptedCommandList::Id: diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index 329e0b8546..a2c25c2f47 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -20831,6 +20831,7 @@ class SubscribeAttributePowerSourceClusterRevision : public SubscribeAttribute { | * TCMinRequiredVersion | 0x0006 | | * TCAcknowledgements | 0x0007 | | * TCAcknowledgementsRequired | 0x0008 | +| * TCUpdateDeadline | 0x0009 | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | | * EventList | 0xFFFA | @@ -21859,6 +21860,91 @@ class SubscribeAttributeGeneralCommissioningTCAcknowledgementsRequired : public } }; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute TCUpdateDeadline + */ +class ReadGeneralCommissioningTCUpdateDeadline : public ReadAttribute { +public: + ReadGeneralCommissioningTCUpdateDeadline() + : ReadAttribute("tcupdate-deadline") + { + } + + ~ReadGeneralCommissioningTCUpdateDeadline() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::GeneralCommissioning::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::GeneralCommissioning::Attributes::TCUpdateDeadline::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeTCUpdateDeadlineWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"GeneralCommissioning.TCUpdateDeadline response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("GeneralCommissioning TCUpdateDeadline read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeGeneralCommissioningTCUpdateDeadline : public SubscribeAttribute { +public: + SubscribeAttributeGeneralCommissioningTCUpdateDeadline() + : SubscribeAttribute("tcupdate-deadline") + { + } + + ~SubscribeAttributeGeneralCommissioningTCUpdateDeadline() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::GeneralCommissioning::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::GeneralCommissioning::Attributes::TCUpdateDeadline::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeTCUpdateDeadlineWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"GeneralCommissioning.TCUpdateDeadline response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + #endif // MTR_ENABLE_PROVISIONAL /* @@ -179202,6 +179288,10 @@ void registerClusterGeneralCommissioning(Commands & commands) #if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // #endif // MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // From 994c390377ef44aeda935a29a7b676047fde3f74 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 4 Oct 2024 12:41:54 -0400 Subject: [PATCH 004/127] Make use of DataModel::Provider device type resolution in the access control (#35862) * Add separate listing for device types * Make unit tests work * Restyle * Fixup include * Fixup include * Make use of DataModel::Provider when doing device type resolution * Add clang-tidy comments * Fix merge error: duplicate declaration * Fix a few more merge conflict markers --------- Co-authored-by: Andrei Litvin --- src/app/server/Server.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/app/server/Server.cpp b/src/app/server/Server.cpp index 426e3c6865..e4db190c50 100644 --- a/src/app/server/Server.cpp +++ b/src/app/server/Server.cpp @@ -19,8 +19,10 @@ #include +#include #include #include +#include #include #include #include @@ -81,6 +83,33 @@ using chip::Transport::TcpListenParameters; namespace { +#if CHIP_CONFIG_USE_DATA_MODEL_INTERFACE +class DeviceTypeResolver : public chip::Access::AccessControl::DeviceTypeResolver +{ +public: + bool IsDeviceTypeOnEndpoint(chip::DeviceTypeId deviceType, chip::EndpointId endpoint) override + { + chip::app::DataModel::Provider * model = chip::app::InteractionModelEngine::GetInstance()->GetDataModelProvider(); + + for (auto type = model->FirstDeviceType(endpoint); type.has_value(); type = model->NextDeviceType(endpoint, *type)) + { + if (type->deviceTypeId == deviceType) + { +#if CHIP_CONFIG_USE_EMBER_DATA_MODEL + VerifyOrDie(chip::app::IsDeviceTypeOnEndpoint(deviceType, endpoint)); +#endif // CHIP_CONFIG_USE_EMBER_DATA_MODEL + return true; + } + } +#if CHIP_CONFIG_USE_EMBER_DATA_MODEL + VerifyOrDie(!chip::app::IsDeviceTypeOnEndpoint(deviceType, endpoint)); +#endif // CHIP_CONFIG_USE_EMBER_DATA_MODEL + return false; + } +} sDeviceTypeResolver; +#else // CHIP_CONFIG_USE_DATA_MODEL_INTERFACE + +// Ember implementation of the device type resolver class DeviceTypeResolver : public chip::Access::AccessControl::DeviceTypeResolver { public: @@ -89,6 +118,7 @@ class DeviceTypeResolver : public chip::Access::AccessControl::DeviceTypeResolve return chip::app::IsDeviceTypeOnEndpoint(deviceType, endpoint); } } sDeviceTypeResolver; +#endif } // namespace From 86a5270fc1b921af8b22fc3cd0394f57e52babd7 Mon Sep 17 00:00:00 2001 From: mkardous-silabs <84793247+mkardous-silabs@users.noreply.github.com> Date: Fri, 4 Oct 2024 13:03:05 -0400 Subject: [PATCH 005/127] Add missing feature map bit (#35915) * Add missing feature map bit * Generation --- .../light-switch-common/light-switch-app.matter | 2 +- .../light-switch-app/light-switch-common/light-switch-app.zap | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 56608b78f2..07910e283f 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 @@ -3223,7 +3223,7 @@ endpoint 2 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 2; + ram attribute featureMap default = 6; ram attribute clusterRevision default = 2; } } diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.zap b/examples/light-switch-app/light-switch-common/light-switch-app.zap index 89f718140f..595b0d8f83 100644 --- a/examples/light-switch-app/light-switch-common/light-switch-app.zap +++ b/examples/light-switch-app/light-switch-common/light-switch-app.zap @@ -5587,7 +5587,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "6", "reportable": 1, "minInterval": 1, "maxInterval": 65534, From a2f1773e110d8da665c3650c5de5f690099529f3 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 4 Oct 2024 16:50:55 -0400 Subject: [PATCH 006/127] When logging work items in MTRDevice_Concrete, include names, not just ids. (#35920) Makes it easier to tell what commands are being sent, and what attributes are being written. --- src/darwin/Framework/CHIP/MTRDevice_Concrete.mm | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm index 5d6e47c8d9..125ced558e 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm +++ b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm @@ -2845,7 +2845,10 @@ static BOOL AttributeHasChangesOmittedQuality(MTRAttributePath * attributePath) } }]; }]; - [_asyncWorkQueue enqueueWorkItem:workItem descriptionWithFormat:@"read %@ 0x%llx 0x%llx", endpointID, clusterID.unsignedLongLongValue, attributeID.unsignedLongLongValue]; + [_asyncWorkQueue enqueueWorkItem:workItem descriptionWithFormat:@"read %@ 0x%llx (%@) 0x%llx (%@)", + endpointID, + clusterID.unsignedLongLongValue, MTRClusterNameForID(static_cast(clusterID.unsignedLongLongValue)), + attributeID.unsignedLongLongValue, MTRAttributeNameForID(static_cast(clusterID.unsignedLongLongValue), static_cast(attributeID.unsignedLongLongValue))]; } else { [self _readThroughSkipped]; } @@ -2975,7 +2978,11 @@ - (void)writeAttributeWithEndpointID:(NSNumber *)endpointID completion(MTRAsyncWorkComplete); }]; }]; - [_asyncWorkQueue enqueueWorkItem:workItem descriptionWithFormat:@"write %@ 0x%llx 0x%llx: %@", endpointID, clusterID.unsignedLongLongValue, attributeID.unsignedLongLongValue, value]; + [_asyncWorkQueue enqueueWorkItem:workItem descriptionWithFormat:@"write %@ 0x%llx (%@) 0x%llx (%@): %@", + endpointID, + clusterID.unsignedLongLongValue, MTRClusterNameForID(static_cast(clusterID.unsignedLongLongValue)), + attributeID.unsignedLongLongValue, MTRAttributeNameForID(static_cast(clusterID.unsignedLongLongValue), static_cast(attributeID.unsignedLongLongValue)), + value]; } - (NSArray *> *)readAttributePaths:(NSArray *)attributePaths @@ -3122,7 +3129,11 @@ - (void)_invokeCommandWithEndpointID:(NSNumber *)endpointID workDone(values, error); }]; }]; - [_asyncWorkQueue enqueueWorkItem:workItem descriptionWithFormat:@"invoke %@ 0x%llx 0x%llx: %@", endpointID, clusterID.unsignedLongLongValue, commandID.unsignedLongLongValue, commandFields]; + [_asyncWorkQueue enqueueWorkItem:workItem descriptionWithFormat:@"invoke %@ 0x%llx (%@) 0x%llx (%@): %@", + endpointID, + clusterID.unsignedLongLongValue, MTRClusterNameForID(static_cast(clusterID.unsignedLongLongValue)), + commandID.unsignedLongLongValue, MTRRequestCommandNameForID(static_cast(clusterID.unsignedLongLongValue), static_cast(commandID.unsignedLongLongValue)), + commandFields]; } - (void)openCommissioningWindowWithSetupPasscode:(NSNumber *)setupPasscode From cc28e0a9e1cc51929c0330309d356c4b11de5b0a Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 4 Oct 2024 17:39:35 -0400 Subject: [PATCH 007/127] Fix Matter.framework path descriptions to be more readable. (#35921) 1) For request paths, clearly mark wildcards instead of logging 0. 2) For all paths except command paths, when we have a value (cluster id, attribute id, event id) that we can find a string representation for, log that string representation. Command paths are a bit complicated because we have to know whether this is a request or a response and we don't have that information in MTRCommandPath at the moment. Will be done in a followup. --- src/darwin/Framework/CHIP/MTRBaseDevice.mm | 77 ++++++++++++++++++---- 1 file changed, 64 insertions(+), 13 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRBaseDevice.mm b/src/darwin/Framework/CHIP/MTRBaseDevice.mm index 5975872589..f00c57a61b 100644 --- a/src/darwin/Framework/CHIP/MTRBaseDevice.mm +++ b/src/darwin/Framework/CHIP/MTRBaseDevice.mm @@ -2302,6 +2302,45 @@ - (void)deregisterReportHandlersWithClientQueue:(dispatch_queue_t)queue completi @end +static NSString * FormatPossiblyWildcardEndpoint(NSNumber * _Nullable possiblyWildcardEndpoint) +{ + if (possiblyWildcardEndpoint == nil) { + return @"wildcard"; + } + + return [NSString stringWithFormat:@"%u", possiblyWildcardEndpoint.unsignedShortValue]; +} + +static NSString * FormatPossiblyWildcardCluster(NSNumber * _Nullable possiblyWildcardCluster) +{ + if (possiblyWildcardCluster == nil) { + return @"wildcard"; + } + + return [NSString stringWithFormat:@"0x%llx (%llu, %@)", + possiblyWildcardCluster.unsignedLongLongValue, + possiblyWildcardCluster.unsignedLongLongValue, + MTRClusterNameForID(static_cast(possiblyWildcardCluster.unsignedLongLongValue))]; +} + +static NSString * FormatPossiblyWildcardClusterElement(NSNumber * _Nullable possiblyWildcardCluster, NSNumber * _Nullable possiblyWildcardElement, NSString * (^nameGetter)(MTRClusterIDType clusterID, NSNumber * elementID)) +{ + if (possiblyWildcardElement == nil) { + return @"wildcard"; + } + + if (possiblyWildcardCluster == nil) { + // We can't get a useful name for this, so just return the numeric + // value. + return [NSString stringWithFormat:@"0x%llx (%llu)", possiblyWildcardElement.unsignedLongLongValue, possiblyWildcardElement.unsignedLongLongValue]; + } + + return [NSString stringWithFormat:@"0x%llx (%llu, %@)", + possiblyWildcardElement.unsignedLongLongValue, + possiblyWildcardElement.unsignedLongLongValue, + nameGetter(static_cast(possiblyWildcardCluster.unsignedLongLongValue), possiblyWildcardElement)]; +} + @implementation MTRAttributeRequestPath - (instancetype)initWithEndpointID:(NSNumber * _Nullable)endpointID clusterID:(NSNumber * _Nullable)clusterID @@ -2315,9 +2354,12 @@ - (instancetype)initWithEndpointID:(NSNumber * _Nullable)endpointID - (NSString *)description { - return [NSString stringWithFormat:@"", - _endpoint.unsignedShortValue, _cluster.unsignedLongLongValue, _cluster.unsignedLongLongValue, - _attribute.unsignedLongLongValue, _attribute.unsignedLongLongValue]; + NSString * endpointStr = FormatPossiblyWildcardEndpoint(_endpoint); + NSString * clusterStr = FormatPossiblyWildcardCluster(_cluster); + NSString * attributeStr = FormatPossiblyWildcardClusterElement(_cluster, _attribute, ^(MTRClusterIDType clusterID, NSNumber * attributeID) { + return MTRAttributeNameForID(clusterID, static_cast(attributeID.unsignedLongLongValue)); + }); + return [NSString stringWithFormat:@"", endpointStr, clusterStr, attributeStr]; } + (MTRAttributeRequestPath *)requestPathWithEndpointID:(NSNumber * _Nullable)endpointID @@ -2439,9 +2481,12 @@ - (instancetype)initWithEndpointID:(NSNumber * _Nullable)endpointID - (NSString *)description { - return [NSString stringWithFormat:@"", - _endpoint.unsignedShortValue, _cluster.unsignedLongLongValue, _cluster.unsignedLongLongValue, - _event.unsignedLongLongValue, _event.unsignedLongLongValue]; + NSString * endpointStr = FormatPossiblyWildcardEndpoint(_endpoint); + NSString * clusterStr = FormatPossiblyWildcardCluster(_cluster); + NSString * eventStr = FormatPossiblyWildcardClusterElement(_cluster, _event, ^(MTRClusterIDType clusterID, NSNumber * eventID) { + return MTREventNameForID(clusterID, static_cast(eventID.unsignedLongLongValue)); + }); + return [NSString stringWithFormat:@"", endpointStr, clusterStr, eventStr]; } + (MTREventRequestPath *)requestPathWithEndpointID:(NSNumber * _Nullable)endpointID @@ -2561,8 +2606,9 @@ - (instancetype)initWithPath:(const ConcreteClusterPath &)path - (NSString *)description { - return [NSString stringWithFormat:@"", _endpoint.unsignedShortValue, - _cluster.unsignedLongLongValue, _cluster.unsignedLongLongValue]; + return [NSString stringWithFormat:@"", _endpoint.unsignedShortValue, + _cluster.unsignedLongLongValue, _cluster.unsignedLongLongValue, + MTRClusterNameForID(static_cast(_cluster.unsignedLongLongValue))]; } + (MTRClusterPath *)clusterPathWithEndpointID:(NSNumber *)endpointID clusterID:(NSNumber *)clusterID @@ -2646,9 +2692,11 @@ - (instancetype)initWithPath:(const ConcreteDataAttributePath &)path - (NSString *)description { - return [NSString stringWithFormat:@"", - self.endpoint.unsignedShortValue, self.cluster.unsignedLongLongValue, self.cluster.unsignedLongLongValue, - _attribute.unsignedLongLongValue, _attribute.unsignedLongLongValue]; + return [NSString stringWithFormat:@"", + self.endpoint.unsignedShortValue, + self.cluster.unsignedLongLongValue, self.cluster.unsignedLongLongValue, MTRClusterNameForID(static_cast(self.cluster.unsignedLongLongValue)), + _attribute.unsignedLongLongValue, _attribute.unsignedLongLongValue, + MTRAttributeNameForID(static_cast(self.cluster.unsignedLongLongValue), static_cast(_attribute.unsignedLongLongValue))]; } + (MTRAttributePath *)attributePathWithEndpointID:(NSNumber *)endpointID @@ -2743,8 +2791,11 @@ - (instancetype)initWithPath:(const ConcreteEventPath &)path - (NSString *)description { return - [NSString stringWithFormat:@"", self.endpoint.unsignedShortValue, - self.cluster.unsignedLongLongValue, self.cluster.unsignedLongLongValue, _event.unsignedLongLongValue, _event.unsignedLongLongValue]; + [NSString stringWithFormat:@"", + self.endpoint.unsignedShortValue, + self.cluster.unsignedLongLongValue, self.cluster.unsignedLongLongValue, MTRClusterNameForID(static_cast(self.cluster.unsignedLongLongValue)), + _event.unsignedLongLongValue, _event.unsignedLongLongValue, + MTREventNameForID(static_cast(self.cluster.unsignedLongLongValue), static_cast(_event.unsignedLongLongValue))]; } + (MTREventPath *)eventPathWithEndpointID:(NSNumber *)endpointID clusterID:(NSNumber *)clusterID eventID:(NSNumber *)eventID From 213bf23f10760e88b943bcf28ebe9d19431a0244 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 4 Oct 2024 18:26:37 -0400 Subject: [PATCH 008/127] Fix formatting of unknown IDs in MTRClusterNames bits. (#35922) IDs are unsigned; we should not be formatting them with %d, because for vendor-prefixed ones that might make them look negative. --- .../CHIP/templates/MTRClusterNames-src.zapt | 14 +- .../CHIP/zap-generated/MTRClusterNames.mm | 970 +++++++++--------- 2 files changed, 492 insertions(+), 492 deletions(-) diff --git a/src/darwin/Framework/CHIP/templates/MTRClusterNames-src.zapt b/src/darwin/Framework/CHIP/templates/MTRClusterNames-src.zapt index 59281604dc..3ec7fe0b8a 100644 --- a/src/darwin/Framework/CHIP/templates/MTRClusterNames-src.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRClusterNames-src.zapt @@ -23,7 +23,7 @@ NSString * MTRClusterNameForID(MTRClusterIDType clusterID) {{/zcl_clusters}} default: - result = [NSString stringWithFormat:@"", clusterID]; + result = [NSString stringWithFormat:@"", clusterID]; break; } @@ -72,7 +72,7 @@ NSString * MTRAttributeNameForID(MTRClusterIDType clusterID, MTRAttributeIDType {{#if (isSupported (asUpperCamelCase label preserveAcronyms=true) isForIds=true)}} default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -80,7 +80,7 @@ NSString * MTRAttributeNameForID(MTRClusterIDType clusterID, MTRAttributeIDType {{/zcl_clusters}} default: - result = [NSString stringWithFormat:@"", clusterID]; + result = [NSString stringWithFormat:@"", clusterID]; break; } @@ -119,7 +119,7 @@ NSString * MTRAttributeNameForID(MTRClusterIDType clusterID, MTRAttributeIDType {{> commandIDs clusterName=label}} default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -127,7 +127,7 @@ NSString * MTRAttributeNameForID(MTRClusterIDType clusterID, MTRAttributeIDType {{/zcl_clusters}} default: - result = [NSString stringWithFormat:@"", clusterID]; + result = [NSString stringWithFormat:@"", clusterID]; break; } @@ -183,7 +183,7 @@ NSString * MTREventNameForID(MTRClusterIDType clusterID, MTREventIDType eventID) {{#if (isSupported (asUpperCamelCase label preserveAcronyms=true) isForIds=true)}} default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -191,7 +191,7 @@ NSString * MTREventNameForID(MTRClusterIDType clusterID, MTREventIDType eventID) {{/zcl_clusters}} default: - result = [NSString stringWithFormat:@"", clusterID]; + result = [NSString stringWithFormat:@"", clusterID]; break; } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm index dff1198510..b9be1f665d 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm @@ -389,7 +389,7 @@ break; default: - result = [NSString stringWithFormat:@"", clusterID]; + result = [NSString stringWithFormat:@"", clusterID]; break; } @@ -442,7 +442,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -481,7 +481,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -536,7 +536,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -627,7 +627,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -662,7 +662,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -717,7 +717,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -756,7 +756,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -819,7 +819,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -866,7 +866,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -993,7 +993,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -1028,7 +1028,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -1079,7 +1079,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -1122,7 +1122,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -1169,7 +1169,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -1208,7 +1208,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -1247,7 +1247,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -1410,7 +1410,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -1485,7 +1485,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -1564,7 +1564,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -1599,7 +1599,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -1670,7 +1670,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -1721,7 +1721,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -2008,7 +2008,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -2095,7 +2095,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -2166,7 +2166,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -2253,7 +2253,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -2356,7 +2356,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -2403,7 +2403,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -2450,7 +2450,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -2509,7 +2509,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -2560,7 +2560,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -2599,7 +2599,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -2638,7 +2638,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -2677,7 +2677,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -2752,7 +2752,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -2799,7 +2799,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -2858,7 +2858,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -2909,7 +2909,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -2952,7 +2952,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -3011,7 +3011,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -3062,7 +3062,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -3113,7 +3113,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -3164,7 +3164,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -3207,7 +3207,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -3250,7 +3250,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -3309,7 +3309,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -3356,7 +3356,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -3407,7 +3407,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -3446,7 +3446,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -3533,7 +3533,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -3584,7 +3584,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -3627,7 +3627,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -3698,7 +3698,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -3757,7 +3757,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -3816,7 +3816,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -3863,7 +3863,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -3922,7 +3922,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -3981,7 +3981,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -4048,7 +4048,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -4127,7 +4127,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -4238,7 +4238,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -4297,7 +4297,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -4356,7 +4356,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -4423,7 +4423,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -4466,7 +4466,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -4533,7 +4533,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -4660,7 +4660,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -4715,7 +4715,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -4758,7 +4758,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -4809,7 +4809,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -4860,7 +4860,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -4911,7 +4911,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -5126,7 +5126,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -5249,7 +5249,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -5308,7 +5308,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -5435,7 +5435,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -5710,7 +5710,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -5793,7 +5793,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -5840,7 +5840,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -6083,7 +6083,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -6174,7 +6174,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -6229,7 +6229,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -6280,7 +6280,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -6351,7 +6351,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -6402,7 +6402,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -6453,7 +6453,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -6544,7 +6544,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -6623,7 +6623,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -6702,7 +6702,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -6781,7 +6781,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -6860,7 +6860,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -6939,7 +6939,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -7018,7 +7018,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -7097,7 +7097,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -7176,7 +7176,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -7255,7 +7255,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -7334,7 +7334,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -7377,7 +7377,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -7436,7 +7436,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -7483,7 +7483,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -7526,7 +7526,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -7573,7 +7573,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -7616,7 +7616,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -7695,7 +7695,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -7738,7 +7738,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -7773,7 +7773,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -7808,7 +7808,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -7851,7 +7851,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -7894,7 +7894,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -7937,7 +7937,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -8004,7 +8004,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -8039,7 +8039,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -8106,7 +8106,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -8141,7 +8141,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -8180,7 +8180,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -8227,7 +8227,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -8270,7 +8270,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -8309,7 +8309,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -8700,7 +8700,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -8739,13 +8739,13 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; default: - result = [NSString stringWithFormat:@"", clusterID]; + result = [NSString stringWithFormat:@"", clusterID]; break; } @@ -8773,7 +8773,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -8807,7 +8807,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -8841,7 +8841,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -8887,7 +8887,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -8897,7 +8897,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -8907,7 +8907,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -8917,7 +8917,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -8931,7 +8931,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -8989,7 +8989,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -8999,7 +8999,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9021,7 +9021,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9035,7 +9035,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9045,7 +9045,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9055,7 +9055,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9065,7 +9065,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9075,7 +9075,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9085,7 +9085,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9111,7 +9111,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9149,7 +9149,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9163,7 +9163,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9185,7 +9185,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9199,7 +9199,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9213,7 +9213,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9227,7 +9227,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9241,7 +9241,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9271,7 +9271,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9285,7 +9285,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9295,7 +9295,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9317,7 +9317,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9359,7 +9359,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9385,7 +9385,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9395,7 +9395,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9405,7 +9405,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9415,7 +9415,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9437,7 +9437,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9463,7 +9463,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9489,7 +9489,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9503,7 +9503,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9513,7 +9513,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9527,7 +9527,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9541,7 +9541,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9555,7 +9555,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9565,7 +9565,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9579,7 +9579,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9593,7 +9593,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9607,7 +9607,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9617,7 +9617,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9631,7 +9631,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9641,7 +9641,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9655,7 +9655,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9673,7 +9673,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9683,7 +9683,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9701,7 +9701,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9727,7 +9727,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9749,7 +9749,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9791,7 +9791,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9805,7 +9805,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9819,7 +9819,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9837,7 +9837,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9855,7 +9855,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9865,7 +9865,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9875,7 +9875,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9893,7 +9893,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9923,7 +9923,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9941,7 +9941,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9983,7 +9983,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10021,7 +10021,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10031,7 +10031,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10041,7 +10041,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10055,7 +10055,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10069,7 +10069,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10083,7 +10083,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10177,7 +10177,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10215,7 +10215,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10233,7 +10233,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10243,7 +10243,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10281,7 +10281,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10295,7 +10295,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10305,7 +10305,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10391,7 +10391,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10401,7 +10401,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10411,7 +10411,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10421,7 +10421,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10431,7 +10431,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10441,7 +10441,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10451,7 +10451,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10461,7 +10461,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10471,7 +10471,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10481,7 +10481,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10491,7 +10491,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10501,7 +10501,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10511,7 +10511,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10521,7 +10521,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10531,7 +10531,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10541,7 +10541,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10551,7 +10551,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10561,7 +10561,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10575,7 +10575,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10601,7 +10601,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10623,7 +10623,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10633,7 +10633,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10667,7 +10667,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10681,7 +10681,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10747,7 +10747,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10773,7 +10773,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10787,7 +10787,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10801,7 +10801,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10819,7 +10819,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10837,7 +10837,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10859,7 +10859,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10869,7 +10869,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10891,7 +10891,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10941,7 +10941,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10955,7 +10955,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10985,7 +10985,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10999,7 +10999,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11009,7 +11009,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11027,7 +11027,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11145,7 +11145,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11163,13 +11163,13 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; default: - result = [NSString stringWithFormat:@"", clusterID]; + result = [NSString stringWithFormat:@"", clusterID]; break; } @@ -11187,7 +11187,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11213,7 +11213,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11223,7 +11223,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11233,7 +11233,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11243,7 +11243,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11253,7 +11253,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11263,7 +11263,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11277,7 +11277,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11287,7 +11287,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11297,7 +11297,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11315,7 +11315,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11325,7 +11325,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11335,7 +11335,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11345,7 +11345,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11355,7 +11355,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11365,7 +11365,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11375,7 +11375,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11401,7 +11401,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11427,7 +11427,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11441,7 +11441,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11459,7 +11459,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11469,7 +11469,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11479,7 +11479,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11489,7 +11489,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11499,7 +11499,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11513,7 +11513,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11523,7 +11523,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11533,7 +11533,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11543,7 +11543,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11569,7 +11569,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11587,7 +11587,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11597,7 +11597,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11607,7 +11607,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11617,7 +11617,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11635,7 +11635,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11645,7 +11645,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11659,7 +11659,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11673,7 +11673,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11683,7 +11683,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11693,7 +11693,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11707,7 +11707,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11721,7 +11721,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11731,7 +11731,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11745,7 +11745,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11759,7 +11759,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11769,7 +11769,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11779,7 +11779,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11793,7 +11793,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11803,7 +11803,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11813,7 +11813,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11823,7 +11823,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11833,7 +11833,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11843,7 +11843,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11857,7 +11857,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11871,7 +11871,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11909,7 +11909,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11919,7 +11919,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11929,7 +11929,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11939,7 +11939,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11949,7 +11949,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11959,7 +11959,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11969,7 +11969,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11979,7 +11979,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11989,7 +11989,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11999,7 +11999,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12009,7 +12009,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12023,7 +12023,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12033,7 +12033,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12043,7 +12043,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12057,7 +12057,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12071,7 +12071,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12085,7 +12085,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12119,7 +12119,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12129,7 +12129,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12147,7 +12147,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12157,7 +12157,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12175,7 +12175,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12185,7 +12185,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12195,7 +12195,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12205,7 +12205,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12215,7 +12215,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12225,7 +12225,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12235,7 +12235,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12245,7 +12245,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12255,7 +12255,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12265,7 +12265,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12275,7 +12275,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12285,7 +12285,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12295,7 +12295,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12305,7 +12305,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12315,7 +12315,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12325,7 +12325,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12335,7 +12335,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12345,7 +12345,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12355,7 +12355,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12365,7 +12365,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12375,7 +12375,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12389,7 +12389,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12403,7 +12403,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12417,7 +12417,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12427,7 +12427,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12445,7 +12445,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12459,7 +12459,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12473,7 +12473,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12483,7 +12483,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12493,7 +12493,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12507,7 +12507,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12521,7 +12521,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12531,7 +12531,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12545,7 +12545,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12555,7 +12555,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12569,7 +12569,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12583,7 +12583,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12597,7 +12597,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12615,7 +12615,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12625,7 +12625,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12635,7 +12635,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12649,7 +12649,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12723,7 +12723,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12737,13 +12737,13 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; default: - result = [NSString stringWithFormat:@"", clusterID]; + result = [NSString stringWithFormat:@"", clusterID]; break; } @@ -12763,7 +12763,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -12773,7 +12773,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -12783,7 +12783,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -12793,7 +12793,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -12803,7 +12803,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -12813,7 +12813,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -12823,7 +12823,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -12846,7 +12846,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -12865,7 +12865,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -12892,7 +12892,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -12902,7 +12902,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -12925,7 +12925,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -12935,7 +12935,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -12945,7 +12945,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -12955,7 +12955,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -12965,7 +12965,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -12988,7 +12988,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -12998,7 +12998,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13008,7 +13008,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13018,7 +13018,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13045,7 +13045,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13060,7 +13060,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13079,7 +13079,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13102,7 +13102,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13112,7 +13112,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13143,7 +13143,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13174,7 +13174,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13213,7 +13213,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13223,7 +13223,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13233,7 +13233,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13243,7 +13243,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13253,7 +13253,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13263,7 +13263,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13278,7 +13278,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13288,7 +13288,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13298,7 +13298,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13317,7 +13317,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13327,7 +13327,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13337,7 +13337,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13347,7 +13347,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13357,7 +13357,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13367,7 +13367,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13377,7 +13377,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13387,7 +13387,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13397,7 +13397,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13407,7 +13407,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13422,7 +13422,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13432,7 +13432,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13442,7 +13442,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13497,7 +13497,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13512,7 +13512,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13522,7 +13522,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13532,7 +13532,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13551,7 +13551,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13570,7 +13570,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13580,7 +13580,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13590,7 +13590,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13600,7 +13600,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13619,7 +13619,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13638,7 +13638,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13653,7 +13653,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13672,7 +13672,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13691,7 +13691,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13706,7 +13706,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13729,7 +13729,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13756,7 +13756,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13791,7 +13791,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13801,7 +13801,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13811,7 +13811,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13821,7 +13821,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13831,7 +13831,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13841,7 +13841,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13872,7 +13872,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13882,7 +13882,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13892,7 +13892,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13971,7 +13971,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13981,7 +13981,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13991,7 +13991,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14001,7 +14001,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14011,7 +14011,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14021,7 +14021,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14031,7 +14031,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14041,7 +14041,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14051,7 +14051,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14061,7 +14061,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14071,7 +14071,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14086,7 +14086,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14096,7 +14096,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14106,7 +14106,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14116,7 +14116,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14126,7 +14126,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14136,7 +14136,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14146,7 +14146,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14156,7 +14156,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14166,7 +14166,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14176,7 +14176,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14186,7 +14186,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14196,7 +14196,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14206,7 +14206,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14216,7 +14216,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14226,7 +14226,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14236,7 +14236,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14251,7 +14251,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14266,7 +14266,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14276,7 +14276,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14286,7 +14286,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14296,7 +14296,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14306,7 +14306,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14316,7 +14316,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14326,7 +14326,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14336,7 +14336,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14351,7 +14351,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14366,7 +14366,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14376,7 +14376,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14386,7 +14386,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14396,7 +14396,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14406,7 +14406,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14421,7 +14421,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14444,7 +14444,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14459,13 +14459,13 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; default: - result = [NSString stringWithFormat:@"", clusterID]; + result = [NSString stringWithFormat:@"", clusterID]; break; } From 641103f33acd8e17a191e150e06e21725c59dd9d Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 4 Oct 2024 19:30:45 -0400 Subject: [PATCH 009/127] Fix some error messages when XPC exceptions happen. (#35923) Things got a bit too copy/pasted. --- src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm b/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm index 45c675121e..038be7934c 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm @@ -64,7 +64,7 @@ - (void)_unregisterNodeID:(NSNumber *)nodeID MTR_LOG_ERROR("Unregister node error: %@ nodeID: %@", error, nodeID); }] deviceController:self.uniqueIdentifier unregisterNodeID:nodeID]; } @catch (NSException * exception) { - MTR_LOG_ERROR("Exception registering nodeID: %@", exception); + MTR_LOG_ERROR("Exception unregistering nodeID: %@", exception); } } @@ -78,7 +78,7 @@ - (void)_checkinWithContext:(NSDictionary *)context MTR_LOG_ERROR("Checkin error: %@", error); }] deviceController:self.uniqueIdentifier checkInWithContext:context]; } @catch (NSException * exception) { - MTR_LOG_ERROR("Exception registering nodeID: %@", exception); + MTR_LOG_ERROR("Exception checking in with context: %@", exception); } } From 89f78ca5f1ad1b70887ed6c04633be9d16115d45 Mon Sep 17 00:00:00 2001 From: Philip Gregor <147669098+pgregorr-amazon@users.noreply.github.com> Date: Fri, 4 Oct 2024 16:53:00 -0700 Subject: [PATCH 010/127] tv-casting-app fix load stale binding endpoints from un-needed fabrics (#35907) * tv-casting-app fix loading stale binding endpoints from un-needed fabrics * Fixing style issues * Addressed comments by sharadb-amazon * Addressed comments by sharadb-amazon 2 * Addressed comments by sharadb-amazon 3 --- .../linux/simple-app-helper.cpp | 3 ++ .../tv-casting-common/core/CastingPlayer.cpp | 4 +- .../tv-casting-common/core/Endpoint.h | 7 +--- .../support/CastingStore.cpp | 26 ++++++++---- .../support/ChipDeviceEventHandler.cpp | 20 +++++---- .../support/EndpointListLoader.cpp | 42 ++++++++++++++----- 6 files changed, 67 insertions(+), 35 deletions(-) diff --git a/examples/tv-casting-app/linux/simple-app-helper.cpp b/examples/tv-casting-app/linux/simple-app-helper.cpp index 115fe9f786..4bdf660bd5 100644 --- a/examples/tv-casting-app/linux/simple-app-helper.cpp +++ b/examples/tv-casting-app/linux/simple-app-helper.cpp @@ -450,6 +450,9 @@ CHIP_ERROR CommandHandler(int argc, char ** argv) targetCastingPlayer->VerifyOrEstablishConnection(connectionCallbacks, matter::casting::core::kCommissioningWindowTimeoutSec, idOptions); + ChipLogProgress(AppServer, "CommandHandler() request, VerifyOrEstablishConnection() called, calling StopDiscovery()"); + // Stop discovery since we have discovered, and are now connecting to the desired CastingPlayer. + matter::casting::core::CastingPlayerDiscovery::GetInstance()->StopDiscovery(); return CHIP_NO_ERROR; } if (strcmp(argv[0], "setcommissionerpasscode") == 0) diff --git a/examples/tv-casting-app/tv-casting-common/core/CastingPlayer.cpp b/examples/tv-casting-app/tv-casting-common/core/CastingPlayer.cpp index 83fc6b4b56..37d442f714 100644 --- a/examples/tv-casting-app/tv-casting-common/core/CastingPlayer.cpp +++ b/examples/tv-casting-app/tv-casting-common/core/CastingPlayer.cpp @@ -380,10 +380,10 @@ chip::Inet::IPAddress * CastingPlayer::GetIpAddressForUDCRequest() void CastingPlayer::FindOrEstablishSession(void * clientContext, chip::OnDeviceConnected onDeviceConnected, chip::OnDeviceConnectionFailure onDeviceConnectionFailure) { - ChipLogProgress(AppServer, "CastingPlayer.FindOrEstablishSession called on nodeId=0x" ChipLogFormatX64 " fabricIndex=%d", + ChipLogProgress(AppServer, "CastingPlayer::FindOrEstablishSession() called on nodeId=0x" ChipLogFormatX64 " fabricIndex=%d", ChipLogValueX64(mAttributes.nodeId), mAttributes.fabricIndex); VerifyOrReturn(mAttributes.nodeId != 0 && mAttributes.fabricIndex != 0, - ChipLogError(AppServer, "CastingPlayer.FindOrEstablishSession called on invalid nodeId/fabricIndex")); + ChipLogError(AppServer, "CastingPlayer::FindOrEstablishSession() called on invalid nodeId/fabricIndex")); ConnectionContext * connectionContext = new ConnectionContext(clientContext, this, onDeviceConnected, onDeviceConnectionFailure); diff --git a/examples/tv-casting-app/tv-casting-common/core/Endpoint.h b/examples/tv-casting-app/tv-casting-common/core/Endpoint.h index 734f1e3d5a..85e67dbfe9 100644 --- a/examples/tv-casting-app/tv-casting-common/core/Endpoint.h +++ b/examples/tv-casting-app/tv-casting-common/core/Endpoint.h @@ -105,7 +105,6 @@ class Endpoint : public std::enable_shared_from_this */ std::vector GetServerList() { - ChipLogProgress(AppServer, "Endpoint::GetServerList() mClusters.size(): %d", static_cast(mClusters.size())); std::vector serverList; for (auto const & cluster : mClusters) { @@ -123,7 +122,6 @@ class Endpoint : public std::enable_shared_from_this template void RegisterCluster(const chip::ClusterId clusterId) { - ChipLogProgress(AppServer, "Endpoint::RegisterCluster() Registering clusterId %d for endpointId %d", clusterId, GetId()); static_assert(std::is_base_of::value, "T must be derived from BaseCluster"); auto cluster = std::make_shared(shared_from_this()); cluster->SetUp(); @@ -137,7 +135,6 @@ class Endpoint : public std::enable_shared_from_this memory::Strong GetCluster() { static_assert(std::is_base_of::value, "T must be derived from BaseCluster"); - ChipLogProgress(AppServer, "Endpoint::GetCluster() mClusters.size(): %d", static_cast(mClusters.size())); for (const auto & pair : mClusters) { auto cluster = std::dynamic_pointer_cast(pair.second); @@ -151,8 +148,8 @@ class Endpoint : public std::enable_shared_from_this void LogDetail() const { - ChipLogProgress(AppServer, "Endpoint::LogDetail() Endpoint ID: %d, Vendor ID: %d, Product ID: %d", mAttributes.mId, - mAttributes.mVendorId, mAttributes.mProductId); + ChipLogProgress(AppServer, "Endpoint::LogDetail() Endpoint ID: %d, Vendor ID: %d, Product ID: %d, Clusters: %d", + mAttributes.mId, mAttributes.mVendorId, mAttributes.mProductId, static_cast(mClusters.size())); } }; diff --git a/examples/tv-casting-app/tv-casting-common/support/CastingStore.cpp b/examples/tv-casting-app/tv-casting-common/support/CastingStore.cpp index 93bd00616d..1ddf40a9b2 100644 --- a/examples/tv-casting-app/tv-casting-common/support/CastingStore.cpp +++ b/examples/tv-casting-app/tv-casting-common/support/CastingStore.cpp @@ -78,8 +78,9 @@ std::vector CastingStore::ReadAll() size_t castingStoreDataSize = 0; err = chip::DeviceLayer::PersistedStorage::KeyValueStoreMgr().Get(kCastingStoreDataKey, castingStoreData, kCastingStoreDataMaxBytes, &castingStoreDataSize); - VerifyOrReturnValue(err == CHIP_NO_ERROR, std::vector(), - ChipLogError(AppServer, "KeyValueStoreMgr.Get failed %" CHIP_ERROR_FORMAT, err.Format())); + VerifyOrReturnValue( + err == CHIP_NO_ERROR, std::vector(), + ChipLogError(AppServer, "CastingStore::ReadAll() KeyValueStoreMgr.Get failed %" CHIP_ERROR_FORMAT, err.Format())); ChipLogProgress(AppServer, "CastingStore::ReadAll() Read TLV(CastingStoreData) from KVS store with size: %lu bytes", static_cast(castingStoreDataSize)); @@ -252,6 +253,9 @@ std::vector CastingStore::ReadAll() if (endpointContainerTagNum == kCastingPlayerEndpointIdTag) { err = reader.Get(endpointAttributes.mId); + // Log which endpoints we cached. + ChipLogProgress(AppServer, "CastingStore::ReadAll() Endpoints container endpointAttributes.mId: %d", + endpointAttributes.mId); VerifyOrReturnValue(err == CHIP_NO_ERROR, std::vector(), ChipLogError(AppServer, "TLVReader.Get failed %" CHIP_ERROR_FORMAT, err.Format())); continue; @@ -475,7 +479,7 @@ CHIP_ERROR CastingStore::WriteAll(std::vector castingPlayer for (auto & castingPlayer : castingPlayers) { - ChipLogProgress(AppServer, "CastingStore::WriteAll() writing castingPlayer:"); + ChipLogProgress(AppServer, "CastingStore::WriteAll() writing CastingPlayer:"); chip::TLV::TLVType castingPlayerContainerType; // CastingPlayer container starts ReturnErrorOnFailure( @@ -547,7 +551,8 @@ CHIP_ERROR CastingStore::WriteAll(std::vector castingPlayer ReturnErrorOnFailure(tlvWriter.StartContainer(chip::TLV::ContextTag(kCastingPlayerEndpointServerListContainerTag), chip::TLV::kTLVType_Structure, serverListContainerType)); std::vector serverList = endpoint->GetServerList(); - ChipLogProgress(AppServer, "CastingStore::WriteAll() writing CastingPlayer Endpoint ServerList:"); + ChipLogProgress(AppServer, "CastingStore::WriteAll() writing CastingPlayer Endpoint ID: %d ServerList.size(): %d", + endpoint->GetId(), static_cast(serverList.size())); for (chip::ClusterId clusterId : serverList) { ChipLogProgress(AppServer, "CastingStore::WriteAll() clusterId: %d", clusterId); @@ -586,7 +591,7 @@ CHIP_ERROR CastingStore::DeleteAll() CHIP_ERROR err = chip::DeviceLayer::PersistedStorage::KeyValueStoreMgr().Delete(kCastingStoreDataKey); if (err == CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND) // no error, if the key-value pair was not stored { - ChipLogProgress(AppServer, "CastingStore::DeleteAll ignoring error %" CHIP_ERROR_FORMAT, err.Format()); + ChipLogProgress(AppServer, "CastingStore::DeleteAll() ignoring error %" CHIP_ERROR_FORMAT, err.Format()); return CHIP_NO_ERROR; } return err; @@ -594,7 +599,7 @@ CHIP_ERROR CastingStore::DeleteAll() CHIP_ERROR CastingStore::Delete(core::CastingPlayer castingPlayer) { - ChipLogProgress(AppServer, "CastingStore::Delete"); + ChipLogProgress(AppServer, "CastingStore::Delete()"); // Read cache of CastingPlayers std::vector castingPlayers = ReadAll(); @@ -608,7 +613,7 @@ CHIP_ERROR CastingStore::Delete(core::CastingPlayer castingPlayer) if (it != castingPlayers.end()) { - ChipLogProgress(AppServer, "CastingStore::Delete deleting CastingPlayer %s from CastingStore cache", it->GetId()); + ChipLogProgress(AppServer, "CastingStore::Delete() deleting CastingPlayer %s from CastingStore cache", it->GetId()); castingPlayers.erase(it); return WriteAll(castingPlayers); } @@ -618,7 +623,7 @@ CHIP_ERROR CastingStore::Delete(core::CastingPlayer castingPlayer) void CastingStore::OnFabricRemoved(const chip::FabricTable & fabricTable, chip::FabricIndex fabricIndex) { - ChipLogProgress(AppServer, "CastingStore::OnFabricRemoved"); + ChipLogProgress(AppServer, "CastingStore::OnFabricRemoved()"); // Read cache of CastingPlayers std::vector castingPlayers = ReadAll(); @@ -633,12 +638,15 @@ void CastingStore::OnFabricRemoved(const chip::FabricTable & fabricTable, chip:: if (it != castingPlayers.end()) { - ChipLogProgress(AppServer, "CastingStore::OnFabricRemoved deleting CastingPlayer %s from CastingStore cache", + ChipLogProgress(AppServer, "CastingStore::OnFabricRemoved() deleting CastingPlayer %s from CastingStore cache", it->GetId()); castingPlayers.erase(it); WriteAll(castingPlayers); } } + CHIP_ERROR err = chip::Server::GetInstance().GetSessionResumptionStorage()->DeleteAll(fabricIndex); + ChipLogProgress(AppServer, "CastingStore::OnFabricRemoved() SessionResumptionStorage.DeleteAll(%d) status %" CHIP_ERROR_FORMAT, + fabricIndex, err.Format()); } }; // namespace support diff --git a/examples/tv-casting-app/tv-casting-common/support/ChipDeviceEventHandler.cpp b/examples/tv-casting-app/tv-casting-common/support/ChipDeviceEventHandler.cpp index cf8ca82366..f027c8d1c4 100644 --- a/examples/tv-casting-app/tv-casting-common/support/ChipDeviceEventHandler.cpp +++ b/examples/tv-casting-app/tv-casting-common/support/ChipDeviceEventHandler.cpp @@ -62,6 +62,7 @@ void ChipDeviceEventHandler::Handle(const chip::DeviceLayer::ChipDeviceEvent * e CastingPlayer::GetTargetCastingPlayer()->SetNodeId(targetNodeId); CastingPlayer::GetTargetCastingPlayer()->SetFabricIndex(targetFabricIndex); + ChipLogProgress(AppServer, "ChipDeviceEventHandler::Handle() calling FindOrEstablishSession()"); CastingPlayer::GetTargetCastingPlayer()->FindOrEstablishSession( nullptr, [](void * context, chip::Messaging::ExchangeManager & exchangeMgr, const chip::SessionHandle & sessionHandle) { @@ -144,12 +145,12 @@ void ChipDeviceEventHandler::HandleBindingsChangedViaCluster(const chip::DeviceL bool & runPostCommissioning, chip::NodeId & targetNodeId, chip::FabricIndex & targetFabricIndex) { - ChipLogProgress(AppServer, "ChipDeviceEventHandler::HandleBindingsChangedViaCluster called"); + ChipLogProgress(AppServer, "ChipDeviceEventHandler::HandleBindingsChangedViaCluster() called"); if (CastingPlayer::GetTargetCastingPlayer()->IsConnected()) { // re-use existing nodeId and fabricIndex - ChipLogProgress(AppServer, "ChipDeviceEventHandler::HandleBindingsChangedViaCluster already connected to video player"); + ChipLogProgress(AppServer, "ChipDeviceEventHandler::HandleBindingsChangedViaCluster() already connected to video player"); runPostCommissioning = true; targetNodeId = CastingPlayer::GetTargetCastingPlayer()->GetNodeId(); targetFabricIndex = CastingPlayer::GetTargetCastingPlayer()->GetFabricIndex(); @@ -159,7 +160,7 @@ void ChipDeviceEventHandler::HandleBindingsChangedViaCluster(const chip::DeviceL else if (sUdcInProgress) { ChipLogProgress(AppServer, - "ChipDeviceEventHandler::HandleBindingsChangedViaCluster UDC is in progress while handling " + "ChipDeviceEventHandler::HandleBindingsChangedViaCluster() UDC is in progress while handling " "kBindingsChangedViaCluster with " "fabricIndex: %d", event->BindingsChanged.fabricIndex); @@ -170,7 +171,7 @@ void ChipDeviceEventHandler::HandleBindingsChangedViaCluster(const chip::DeviceL for (const auto & binding : chip::BindingTable::GetInstance()) { ChipLogProgress(AppServer, - "ChipDeviceEventHandler::HandleBindingsChangedViaCluster Read cached binding type=%d fabrixIndex=%d " + "ChipDeviceEventHandler::HandleBindingsChangedViaCluster() Read cached binding type=%d fabrixIndex=%d " "nodeId=0x" ChipLogFormatX64 " groupId=%d local endpoint=%d remote endpoint=%d cluster=" ChipLogFormatMEI, binding.type, binding.fabricIndex, ChipLogValueX64(binding.nodeId), binding.groupId, binding.local, @@ -178,7 +179,7 @@ void ChipDeviceEventHandler::HandleBindingsChangedViaCluster(const chip::DeviceL if (binding.type == MATTER_UNICAST_BINDING && event->BindingsChanged.fabricIndex == binding.fabricIndex) { ChipLogProgress(AppServer, - "ChipDeviceEventHandler::HandleBindingsChangedViaCluster Matched accessingFabricIndex with " + "ChipDeviceEventHandler::HandleBindingsChangedViaCluster() Matched accessingFabricIndex with " "nodeId=0x" ChipLogFormatX64, ChipLogValueX64(binding.nodeId)); targetNodeId = binding.nodeId; @@ -190,9 +191,10 @@ void ChipDeviceEventHandler::HandleBindingsChangedViaCluster(const chip::DeviceL if (targetNodeId == 0 && runPostCommissioning == false) { - ChipLogError(AppServer, - "ChipDeviceEventHandler::HandleBindingsChangedViaCluster accessingFabricIndex: %d did not match bindings", - event->BindingsChanged.fabricIndex); + ChipLogError( + AppServer, + "ChipDeviceEventHandler::HandleBindingsChangedViaCluster() accessingFabricIndex: %d did not match bindings", + event->BindingsChanged.fabricIndex); CastingPlayer::GetTargetCastingPlayer()->mOnCompleted(CHIP_ERROR_INCORRECT_STATE, CastingPlayer::GetTargetCastingPlayer()); return; @@ -204,7 +206,7 @@ void ChipDeviceEventHandler::HandleCommissioningComplete(const chip::DeviceLayer bool & runPostCommissioning, chip::NodeId & targetNodeId, chip::FabricIndex & targetFabricIndex) { - ChipLogProgress(AppServer, "ChipDeviceEventHandler::HandleCommissioningComplete called"); + ChipLogProgress(AppServer, "ChipDeviceEventHandler::HandleCommissioningComplete() called"); sUdcInProgress = false; targetNodeId = event->CommissioningComplete.nodeId; targetFabricIndex = event->CommissioningComplete.fabricIndex; diff --git a/examples/tv-casting-app/tv-casting-common/support/EndpointListLoader.cpp b/examples/tv-casting-app/tv-casting-common/support/EndpointListLoader.cpp index 44e76f628b..a54c4ddc59 100644 --- a/examples/tv-casting-app/tv-casting-common/support/EndpointListLoader.cpp +++ b/examples/tv-casting-app/tv-casting-common/support/EndpointListLoader.cpp @@ -51,9 +51,17 @@ void EndpointListLoader::Initialize(chip::Messaging::ExchangeManager * exchangeM mExchangeMgr = exchangeMgr; mSessionHandle = sessionHandle; + chip::NodeId targetCastingPlayerNodeId = CastingPlayer::GetTargetCastingPlayer()->GetNodeId(); + chip::FabricIndex targetCastingPlayerFabricIndex = CastingPlayer::GetTargetCastingPlayer()->GetFabricIndex(); + ChipLogProgress(AppServer, + "EndpointListLoader::Initialize() targetCastingPlayerNodeId: 0x" ChipLogFormatX64 + ", targetCastingPlayerFabricIndex: %d", + ChipLogValueX64(targetCastingPlayerNodeId), targetCastingPlayerFabricIndex); + for (const auto & binding : chip::BindingTable::GetInstance()) { - if (binding.type == MATTER_UNICAST_BINDING && CastingPlayer::GetTargetCastingPlayer()->GetNodeId() == binding.nodeId) + if (binding.type == MATTER_UNICAST_BINDING && targetCastingPlayerNodeId == binding.nodeId && + targetCastingPlayerFabricIndex == binding.fabricIndex) { // check to see if we discovered a new endpoint in the bindings chip::EndpointId endpointId = binding.remote; @@ -66,6 +74,8 @@ void EndpointListLoader::Initialize(chip::Messaging::ExchangeManager * exchangeM } } } + ChipLogProgress(AppServer, "EndpointListLoader::Initialize() mNewEndpointsToLoad++, mNewEndpointsToLoad: %lu", + mNewEndpointsToLoad); mPendingAttributeReads = mNewEndpointsToLoad * kTotalDesiredAttributes; mEndpointAttributesList = new EndpointAttributes[mNewEndpointsToLoad]; @@ -78,16 +88,24 @@ CHIP_ERROR EndpointListLoader::Load() VerifyOrReturnError(CastingPlayer::GetTargetCastingPlayer() != nullptr, CHIP_ERROR_INCORRECT_STATE); + chip::NodeId targetCastingPlayerNodeId = CastingPlayer::GetTargetCastingPlayer()->GetNodeId(); + chip::FabricIndex targetCastingPlayerFabricIndex = CastingPlayer::GetTargetCastingPlayer()->GetFabricIndex(); + ChipLogProgress(AppServer, + "EndpointListLoader::Load() targetCastingPlayerNodeId: 0x" ChipLogFormatX64 + ", targetCastingPlayerFabricIndex: %d", + ChipLogValueX64(targetCastingPlayerNodeId), targetCastingPlayerFabricIndex); + int endpointIndex = -1; bool isLoadingRequired = false; for (const auto & binding : chip::BindingTable::GetInstance()) { ChipLogProgress(AppServer, - "Binding type=%d fab=%d nodeId=0x" ChipLogFormatX64 + "EndpointListLoader::Load() Binding type=%d fab=%d nodeId=0x" ChipLogFormatX64 " groupId=%d local endpoint=%d remote endpoint=%d cluster=" ChipLogFormatMEI, binding.type, binding.fabricIndex, ChipLogValueX64(binding.nodeId), binding.groupId, binding.local, binding.remote, ChipLogValueMEI(binding.clusterId.value_or(0))); - if (binding.type == MATTER_UNICAST_BINDING && CastingPlayer::GetTargetCastingPlayer()->GetNodeId() == binding.nodeId) + if (binding.type == MATTER_UNICAST_BINDING && targetCastingPlayerNodeId == binding.nodeId && + targetCastingPlayerFabricIndex == binding.fabricIndex) { // if we discovered a new Endpoint from the bindings, read its EndpointAttributes chip::EndpointId endpointId = binding.remote; @@ -98,7 +116,8 @@ CHIP_ERROR EndpointListLoader::Load() }) == endpoints.end()) { // Read attributes and mEndpointAttributesList for (endpointIndex + 1) - ChipLogProgress(AppServer, "EndpointListLoader::Load Reading attributes for endpointId %d", endpointId); + ChipLogProgress(AppServer, "EndpointListLoader::Load() Reading attributes for endpointId: %d, on fabricIndex: %d", + endpointId, binding.fabricIndex); isLoadingRequired = true; mEndpointAttributesList[++endpointIndex].mId = endpointId; ReadVendorId(&mEndpointAttributesList[endpointIndex]); @@ -121,7 +140,7 @@ CHIP_ERROR EndpointListLoader::Load() void EndpointListLoader::Complete() { - ChipLogProgress(AppServer, "EndpointListLoader::Complete called with mPendingAttributeReads %lu", mPendingAttributeReads); + ChipLogProgress(AppServer, "EndpointListLoader::Complete() called with mPendingAttributeReads: %lu", mPendingAttributeReads); if (mPendingAttributeReads > 0) { mPendingAttributeReads--; @@ -161,7 +180,7 @@ void EndpointListLoader::Complete() // callback client OnCompleted VerifyOrReturn(CastingPlayer::GetTargetCastingPlayer()->mOnCompleted, - ChipLogError(AppServer, "EndpointListLoader::Complete mOnCompleted() not found")); + ChipLogError(AppServer, "EndpointListLoader::Complete() mOnCompleted() not found")); CastingPlayer::GetTargetCastingPlayer()->mOnCompleted(CHIP_NO_ERROR, CastingPlayer::GetTargetCastingPlayer()); } } @@ -180,7 +199,8 @@ CHIP_ERROR EndpointListLoader::ReadVendorId(EndpointAttributes * endpointAttribu }, [](void * context, CHIP_ERROR err) { EndpointAttributes * _endpointAttributes = static_cast(context); - ChipLogError(AppServer, "EndpointListLoader ReadAttribute(VendorID) failed for endpointID %d. Err: %" CHIP_ERROR_FORMAT, + ChipLogError(AppServer, + "EndpointListLoader::ReadAttribute(VendorID) failed for endpointID %d. Err: %" CHIP_ERROR_FORMAT, _endpointAttributes->mId, err.Format()); EndpointListLoader::GetInstance()->Complete(); }); @@ -201,7 +221,7 @@ CHIP_ERROR EndpointListLoader::ReadProductId(EndpointAttributes * endpointAttrib [](void * context, CHIP_ERROR err) { EndpointAttributes * _endpointAttributes = static_cast(context); ChipLogError(AppServer, - "EndpointListLoader ReadAttribute(ProductID) failed for endpointID %d. Err: %" CHIP_ERROR_FORMAT, + "EndpointListLoader::ReadAttribute(ProductID) failed for endpointID %d. Err: %" CHIP_ERROR_FORMAT, _endpointAttributes->mId, err.Format()); EndpointListLoader::GetInstance()->Complete(); }); @@ -227,7 +247,7 @@ CHIP_ERROR EndpointListLoader::ReadDeviceTypeList(EndpointAttributes * endpointA [](void * context, CHIP_ERROR err) { EndpointAttributes * _endpointAttributes = static_cast(context); ChipLogError(AppServer, - "EndpointListLoader ReadAttribute(DeviceTypeList) failed for endpointID %d. Err: %" CHIP_ERROR_FORMAT, + "EndpointListLoader::ReadAttribute(DeviceTypeList) failed for endpointID %d. Err: %" CHIP_ERROR_FORMAT, _endpointAttributes->mId, err.Format()); EndpointListLoader::GetInstance()->Complete(); }); @@ -251,7 +271,9 @@ CHIP_ERROR EndpointListLoader::ReadServerList(std::vector * end EndpointListLoader::GetInstance()->Complete(); }, [](void * context, CHIP_ERROR err) { - ChipLogError(AppServer, "EndpointListLoader ReadAttribute(ServerList) failed. Err: %" CHIP_ERROR_FORMAT, err.Format()); + ChipLogError(AppServer, + "EndpointListLoader::ReadServerList() ReadAttribute(ServerList) failed. Err: %" CHIP_ERROR_FORMAT, + err.Format()); EndpointListLoader::GetInstance()->Complete(); }); } From 425b53c5d4d7a3dab16b1dbf66b9d5a6d5862fbb Mon Sep 17 00:00:00 2001 From: Marcos B <15697303+gmarcosb@users.noreply.github.com> Date: Fri, 4 Oct 2024 23:42:54 -0600 Subject: [PATCH 011/127] Re-enerated using updated alchemy which recognizes Cameras domain (#35895) --- src/app/zap-templates/zcl/data-model/chip/chime-cluster.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/zap-templates/zcl/data-model/chip/chime-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/chime-cluster.xml index 42a538e7a0..379caa47ce 100644 --- a/src/app/zap-templates/zcl/data-model/chip/chime-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/chime-cluster.xml @@ -18,7 +18,7 @@ limitations under the License. XML generated by Alchemy; DO NOT EDIT. Source: src/app_clusters/Chime.adoc Parameters: in-progress -Git: 0.9-fall2024-225-g1da0e33be +Git: 0.9-fall2024-301-g4e2f0c1c4 --> @@ -29,7 +29,7 @@ Git: 0.9-fall2024-225-g1da0e33be - + Chime 0x0556 CHIME_CLUSTER From 5c9d4f9db1ec71a0b188e8a4de891c0af9783fcb Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Sat, 5 Oct 2024 15:31:26 -0400 Subject: [PATCH 012/127] Update Darwin availability annotations for new camera bits. (#35925) --- src/darwin/Framework/CHIP/templates/availability.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/darwin/Framework/CHIP/templates/availability.yaml b/src/darwin/Framework/CHIP/templates/availability.yaml index 0237acfb46..fdf5c00538 100644 --- a/src/darwin/Framework/CHIP/templates/availability.yaml +++ b/src/darwin/Framework/CHIP/templates/availability.yaml @@ -9753,6 +9753,9 @@ - WaterHeaterManagement - WaterHeaterMode - WiFiNetworkManagement + # Targeting Camera enablement + - Chime + - WebRTCTransportProvider attributes: AccessControl: # Targeting 1.4 @@ -9856,6 +9859,8 @@ - LandmarkTag - PositionTag - RelativePositionTag + # Targeting Camera enablement + - ThreeLevelAutoEnum enum values: ApplicationLauncher: StatusEnum: From ef0132bc778bfd597593c6c60f2cc7f4361ff7bc Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Sat, 5 Oct 2024 12:31:51 -0700 Subject: [PATCH 013/127] [Fabric-Sync] Fix compile warnings (#35927) --- examples/fabric-admin/device_manager/DeviceManager.cpp | 4 ++-- examples/fabric-admin/device_manager/DeviceManager.h | 6 +++--- examples/fabric-admin/rpc/RpcServer.cpp | 4 ++-- examples/fabric-bridge-app/linux/main.cpp | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/fabric-admin/device_manager/DeviceManager.cpp b/examples/fabric-admin/device_manager/DeviceManager.cpp index 4f7b1c7755..8acb5636f4 100644 --- a/examples/fabric-admin/device_manager/DeviceManager.cpp +++ b/examples/fabric-admin/device_manager/DeviceManager.cpp @@ -114,7 +114,7 @@ void DeviceManager::RemoveSyncedDevice(NodeId nodeId) ChipLogValueX64(device->GetNodeId()), device->GetEndpointId()); } -void DeviceManager::OpenDeviceCommissioningWindow(NodeId nodeId, uint32_t commissioningTimeoutSec, uint32_t iterations, +void DeviceManager::OpenDeviceCommissioningWindow(NodeId nodeId, uint32_t iterations, uint16_t commissioningTimeoutSec, uint16_t discriminator, const ByteSpan & salt, const ByteSpan & verifier) { ChipLogProgress(NotSpecified, "Opening commissioning window for Node ID: " ChipLogFormatX64, ChipLogValueX64(nodeId)); @@ -422,7 +422,7 @@ void DeviceManager::HandleReverseOpenCommissioningWindow(TLV::TLVReader & data) ChipLogProgress(NotSpecified, " PAKEPasscodeVerifier size: %lu", value.PAKEPasscodeVerifier.size()); ChipLogProgress(NotSpecified, " salt size: %lu", value.salt.size()); - OpenDeviceCommissioningWindow(mLocalBridgeNodeId, value.commissioningTimeout, value.iterations, value.discriminator, + OpenDeviceCommissioningWindow(mLocalBridgeNodeId, value.iterations, value.commissioningTimeout, value.discriminator, ByteSpan(value.salt.data(), value.salt.size()), ByteSpan(value.PAKEPasscodeVerifier.data(), value.PAKEPasscodeVerifier.size())); } diff --git a/examples/fabric-admin/device_manager/DeviceManager.h b/examples/fabric-admin/device_manager/DeviceManager.h index 5e43e78e3a..1514c417be 100644 --- a/examples/fabric-admin/device_manager/DeviceManager.h +++ b/examples/fabric-admin/device_manager/DeviceManager.h @@ -94,17 +94,17 @@ class DeviceManager : public PairingDelegate * This function initiates the process to open the commissioning window for a device identified by the given node ID. * * @param nodeId The ID of the node that should open the commissioning window. - * @param commissioningTimeoutSec The time in seconds before the commissioning window closes. This value determines - * how long the commissioning window remains open for incoming connections. * @param iterations The number of PBKDF (Password-Based Key Derivation Function) iterations to use * for deriving the PAKE (Password Authenticated Key Exchange) verifier. + * @param commissioningTimeoutSec The time in seconds before the commissioning window closes. This value determines + * how long the commissioning window remains open for incoming connections. * @param discriminator The device-specific discriminator, determined during commissioning, which helps * to uniquely identify the device among others. * @param salt The salt used in the cryptographic operations for commissioning. * @param verifier The PAKE verifier used to authenticate the commissioning process. * */ - void OpenDeviceCommissioningWindow(chip::NodeId nodeId, uint32_t commissioningTimeoutSec, uint32_t iterations, + void OpenDeviceCommissioningWindow(chip::NodeId nodeId, uint32_t iterations, uint16_t commissioningTimeoutSec, uint16_t discriminator, const chip::ByteSpan & salt, const chip::ByteSpan & verifier); /** diff --git a/examples/fabric-admin/rpc/RpcServer.cpp b/examples/fabric-admin/rpc/RpcServer.cpp index d68eb11786..8613d06c6f 100644 --- a/examples/fabric-admin/rpc/RpcServer.cpp +++ b/examples/fabric-admin/rpc/RpcServer.cpp @@ -101,9 +101,9 @@ class FabricAdmin final : public rpc::FabricAdmin, public IcdManager::Delegate // TODO(#35875): OpenDeviceCommissioningWindow uses the same controller every time and doesn't currently accept // FabricIndex. For now we are dropping fabric index from the scoped node id. NodeId nodeId = request.id.node_id; - uint32_t commissioningTimeoutSec = request.commissioning_timeout; uint32_t iterations = request.iterations; uint16_t discriminator = request.discriminator; + uint16_t commissioningTimeoutSec = static_cast(request.commissioning_timeout); // Log the request details for debugging ChipLogProgress(NotSpecified, @@ -111,7 +111,7 @@ class FabricAdmin final : public rpc::FabricAdmin, public IcdManager::Delegate static_cast(nodeId), commissioningTimeoutSec, iterations, discriminator); // Open the device commissioning window using raw binary data for salt and verifier - DeviceMgr().OpenDeviceCommissioningWindow(nodeId, commissioningTimeoutSec, iterations, discriminator, + DeviceMgr().OpenDeviceCommissioningWindow(nodeId, iterations, commissioningTimeoutSec, discriminator, ByteSpan(request.salt.bytes, request.salt.size), ByteSpan(request.verifier.bytes, request.verifier.size)); diff --git a/examples/fabric-bridge-app/linux/main.cpp b/examples/fabric-bridge-app/linux/main.cpp index 3e93c9878f..a101fd3d32 100644 --- a/examples/fabric-bridge-app/linux/main.cpp +++ b/examples/fabric-bridge-app/linux/main.cpp @@ -81,10 +81,10 @@ bool HandleCustomOption(const char * aProgram, ArgParser::OptionSet * aOptions, switch (aIdentifier) { case kOptionFabricAdminServerPortNumber: - gFabricAdminServerPort = atoi(aValue); + gFabricAdminServerPort = static_cast(atoi(aValue)); break; case kOptionLocalServerPortNumber: - gLocalServerPort = atoi(aValue); + gLocalServerPort = static_cast(atoi(aValue)); break; default: ArgParser::PrintArgError("%s: INTERNAL ERROR: Unhandled option: %s\n", aProgram, aName); From 45a68f88939dec2f2372a7e37abeeae627f81411 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Sun, 6 Oct 2024 19:39:53 -0700 Subject: [PATCH 014/127] Use ScheduleLambda() instead of PlatformMgr().ScheduleWork to excute command (#35926) * Use ScheduleLambda() instead of PlatformMgr().ScheduleWork to excute command * Restyled by clang-format --------- Co-authored-by: Restyled.io --- .../fabric-sync/FabricSyncCommand.cpp | 11 +- .../device_manager/PairingManager.cpp | 269 ++++++++---------- .../device_manager/PairingManager.h | 52 +--- 3 files changed, 129 insertions(+), 203 deletions(-) diff --git a/examples/fabric-admin/commands/fabric-sync/FabricSyncCommand.cpp b/examples/fabric-admin/commands/fabric-sync/FabricSyncCommand.cpp index c8d9f3da96..879d28cd15 100644 --- a/examples/fabric-admin/commands/fabric-sync/FabricSyncCommand.cpp +++ b/examples/fabric-admin/commands/fabric-sync/FabricSyncCommand.cpp @@ -30,15 +30,6 @@ using namespace ::chip; -namespace { - -void CheckFabricBridgeSynchronizationSupport(intptr_t ignored) -{ - DeviceMgr().ReadSupportedDeviceCategories(); -} - -} // namespace - void FabricSyncAddBridgeCommand::OnCommissioningComplete(NodeId deviceId, CHIP_ERROR err) { if (mBridgeNodeId != deviceId) @@ -73,7 +64,7 @@ void FabricSyncAddBridgeCommand::OnCommissioningComplete(NodeId deviceId, CHIP_E // // Note: The Fabric-Admin MUST NOT send the RequestCommissioningApproval command // if the remote Fabric-Bridge lacks Fabric Synchronization support. - DeviceLayer::PlatformMgr().ScheduleWork(CheckFabricBridgeSynchronizationSupport, 0); + DeviceLayer::SystemLayer().ScheduleLambda([]() { DeviceMgr().ReadSupportedDeviceCategories(); }); } } else diff --git a/examples/fabric-admin/device_manager/PairingManager.cpp b/examples/fabric-admin/device_manager/PairingManager.cpp index c46a0ca000..41b4c8744e 100644 --- a/examples/fabric-admin/device_manager/PairingManager.cpp +++ b/examples/fabric-admin/device_manager/PairingManager.cpp @@ -131,98 +131,97 @@ CHIP_ERROR PairingManager::OpenCommissioningWindow(NodeId nodeId, EndpointId end return CHIP_ERROR_INCORRECT_STATE; } - auto params = Platform::MakeUnique(); - params->nodeId = nodeId; - params->endpointId = endpointId; - params->commissioningWindowTimeout = commissioningTimeoutSec; - params->iteration = iterations; - params->discriminator = discriminator; + // Ensure salt and verifier sizes are valid + if (!salt.empty() && salt.size() > chip::Crypto::kSpake2p_Max_PBKDF_Salt_Length) + { + ChipLogError(NotSpecified, "Salt size exceeds buffer capacity"); + return CHIP_ERROR_BUFFER_TOO_SMALL; + } - if (!salt.empty()) + if (!verifier.empty() && verifier.size() > chip::Crypto::kSpake2p_VerifierSerialized_Length) { - if (salt.size() > sizeof(params->saltBuffer)) - { - ChipLogError(NotSpecified, "Salt size exceeds buffer capacity"); - return CHIP_ERROR_BUFFER_TOO_SMALL; - } + ChipLogError(NotSpecified, "Verifier size exceeds buffer capacity"); + return CHIP_ERROR_BUFFER_TOO_SMALL; + } - memcpy(params->saltBuffer, salt.data(), salt.size()); - params->salt = ByteSpan(params->saltBuffer, salt.size()); + if (!salt.empty()) + { + memcpy(mSaltBuffer, salt.data(), salt.size()); + mSalt = ByteSpan(mSaltBuffer, salt.size()); + } + else + { + mSalt = ByteSpan(); } if (!verifier.empty()) { - if (verifier.size() > sizeof(params->verifierBuffer)) - { - ChipLogError(NotSpecified, "Verifier size exceeds buffer capacity"); - return CHIP_ERROR_BUFFER_TOO_SMALL; - } - - memcpy(params->verifierBuffer, verifier.data(), verifier.size()); - params->verifier = ByteSpan(params->verifierBuffer, verifier.size()); + memcpy(mVerifierBuffer, verifier.data(), verifier.size()); + mVerifier = ByteSpan(mVerifierBuffer, verifier.size()); } - - // Schedule work on the Matter thread - return DeviceLayer::PlatformMgr().ScheduleWork(OnOpenCommissioningWindow, reinterpret_cast(params.release())); -} - -void PairingManager::OnOpenCommissioningWindow(intptr_t context) -{ - Platform::UniquePtr params(reinterpret_cast(context)); - PairingManager & self = PairingManager::Instance(); - - if (self.mCommissioner == nullptr) + else { - ChipLogError(NotSpecified, "Commissioner is null, cannot open commissioning window"); - return; + mVerifier = ByteSpan(); } - self.mWindowOpener = Platform::MakeUnique(self.mCommissioner); + return DeviceLayer::SystemLayer().ScheduleLambda([nodeId, endpointId, commissioningTimeoutSec, iterations, discriminator]() { + PairingManager & self = PairingManager::Instance(); - if (!params->verifier.empty()) - { - if (params->salt.empty()) + if (self.mCommissioner == nullptr) { - ChipLogError(NotSpecified, "Salt is required when verifier is set"); - self.mWindowOpener.reset(); + ChipLogError(NotSpecified, "Commissioner is null, cannot open commissioning window"); return; } - CHIP_ERROR err = - self.mWindowOpener->OpenCommissioningWindow(Controller::CommissioningWindowVerifierParams() - .SetNodeId(params->nodeId) - .SetEndpointId(params->endpointId) - .SetTimeout(params->commissioningWindowTimeout) - .SetIteration(params->iteration) - .SetDiscriminator(params->discriminator) - .SetVerifier(params->verifier) - .SetSalt(params->salt) - .SetCallback(&self.mOnOpenCommissioningWindowVerifierCallback)); - if (err != CHIP_NO_ERROR) + self.mWindowOpener = Platform::MakeUnique(self.mCommissioner); + + if (!self.mVerifier.empty()) { - ChipLogError(NotSpecified, "Failed to open commissioning window with verifier: %s", ErrorStr(err)); - self.mWindowOpener.reset(); + if (self.mSalt.empty()) + { + ChipLogError(NotSpecified, "Salt is required when verifier is set"); + self.mWindowOpener.reset(); + return; + } + + // Open the commissioning window with verifier parameters + CHIP_ERROR err = + self.mWindowOpener->OpenCommissioningWindow(Controller::CommissioningWindowVerifierParams() + .SetNodeId(nodeId) + .SetEndpointId(endpointId) + .SetTimeout(commissioningTimeoutSec) + .SetIteration(iterations) + .SetDiscriminator(discriminator) + .SetVerifier(self.mVerifier) + .SetSalt(self.mSalt) + .SetCallback(&self.mOnOpenCommissioningWindowVerifierCallback)); + if (err != CHIP_NO_ERROR) + { + ChipLogError(NotSpecified, "Failed to open commissioning window with verifier: %s", ErrorStr(err)); + self.mWindowOpener.reset(); + } } - } - else - { - SetupPayload ignored; - CHIP_ERROR err = self.mWindowOpener->OpenCommissioningWindow(Controller::CommissioningWindowPasscodeParams() - .SetNodeId(params->nodeId) - .SetEndpointId(params->endpointId) - .SetTimeout(params->commissioningWindowTimeout) - .SetIteration(params->iteration) - .SetDiscriminator(params->discriminator) - .SetSetupPIN(NullOptional) - .SetSalt(NullOptional) - .SetCallback(&self.mOnOpenCommissioningWindowCallback), - ignored); - if (err != CHIP_NO_ERROR) + else { - ChipLogError(NotSpecified, "Failed to open commissioning window with passcode: %s", ErrorStr(err)); - self.mWindowOpener.reset(); + SetupPayload ignored; + // Open the commissioning window with passcode parameters + CHIP_ERROR err = self.mWindowOpener->OpenCommissioningWindow(Controller::CommissioningWindowPasscodeParams() + .SetNodeId(nodeId) + .SetEndpointId(endpointId) + .SetTimeout(commissioningTimeoutSec) + .SetIteration(iterations) + .SetDiscriminator(discriminator) + .SetSetupPIN(NullOptional) + .SetSalt(NullOptional) + .SetCallback(&self.mOnOpenCommissioningWindowCallback), + ignored); + if (err != CHIP_NO_ERROR) + { + ChipLogError(NotSpecified, "Failed to open commissioning window with passcode: %s", ErrorStr(err)); + self.mWindowOpener.reset(); + } } - } + }); } void PairingManager::OnOpenCommissioningWindowResponse(void * context, NodeId remoteId, CHIP_ERROR err, SetupPayload payload) @@ -290,7 +289,7 @@ void PairingManager::OnCommissioningComplete(NodeId nodeId, CHIP_ERROR err) if (err == CHIP_NO_ERROR) { // print to console - fprintf(stderr, "New device with Node ID: " ChipLogFormatX64 "has been successfully added.\n", ChipLogValueX64(nodeId)); + fprintf(stderr, "New device with Node ID: " ChipLogFormatX64 " has been successfully added.\n", ChipLogValueX64(nodeId)); // mCommissioner has a lifetime that is the entire life of the application itself // so it is safe to provide to StartDeviceSynchronization. @@ -580,34 +579,24 @@ CHIP_ERROR PairingManager::PairDeviceWithCode(NodeId nodeId, const char * payloa return CHIP_ERROR_INVALID_STRING_LENGTH; } - auto params = Platform::MakeUnique(); - VerifyOrReturnError(params != nullptr, CHIP_ERROR_NO_MEMORY); - - params->nodeId = nodeId; - Platform::CopyString(params->payloadBuffer, sizeof(params->payloadBuffer), payload); + Platform::CopyString(mOnboardingPayload, sizeof(mOnboardingPayload), payload); - // Schedule work on the Matter thread - return DeviceLayer::PlatformMgr().ScheduleWork(OnPairDeviceWithCode, reinterpret_cast(params.release())); -} - -void PairingManager::OnPairDeviceWithCode(intptr_t context) -{ - Platform::UniquePtr params(reinterpret_cast(context)); - PairingManager & self = PairingManager::Instance(); + return DeviceLayer::SystemLayer().ScheduleLambda([nodeId]() { + PairingManager & self = PairingManager::Instance(); - self.InitPairingCommand(); + self.InitPairingCommand(); - CommissioningParameters commissioningParams = self.GetCommissioningParameters(); - auto discoveryType = DiscoveryType::kDiscoveryNetworkOnly; + CommissioningParameters commissioningParams = self.GetCommissioningParameters(); + auto discoveryType = DiscoveryType::kDiscoveryNetworkOnly; - self.mNodeId = params->nodeId; - self.mOnboardingPayload = params->payloadBuffer; + self.mNodeId = nodeId; - CHIP_ERROR err = self.mCommissioner->PairDevice(params->nodeId, params->payloadBuffer, commissioningParams, discoveryType); - if (err != CHIP_NO_ERROR) - { - ChipLogError(NotSpecified, "Failed to pair device with code, error: %s", ErrorStr(err)); - } + CHIP_ERROR err = self.mCommissioner->PairDevice(nodeId, self.mOnboardingPayload, commissioningParams, discoveryType); + if (err != CHIP_NO_ERROR) + { + ChipLogError(NotSpecified, "Failed to pair device with code, error: %s", ErrorStr(err)); + } + }); } CHIP_ERROR PairingManager::PairDevice(chip::NodeId nodeId, uint32_t setupPINCode, const char * deviceRemoteIp, @@ -619,72 +608,50 @@ CHIP_ERROR PairingManager::PairDevice(chip::NodeId nodeId, uint32_t setupPINCode return CHIP_ERROR_INVALID_STRING_LENGTH; } - auto params = Platform::MakeUnique(); - VerifyOrReturnError(params != nullptr, CHIP_ERROR_NO_MEMORY); - - params->nodeId = nodeId; - params->setupPINCode = setupPINCode; - params->deviceRemotePort = deviceRemotePort; - - Platform::CopyString(params->ipAddrBuffer, sizeof(params->ipAddrBuffer), deviceRemoteIp); - - // Schedule work on the Matter thread - return DeviceLayer::PlatformMgr().ScheduleWork(OnPairDevice, reinterpret_cast(params.release())); -} + Platform::CopyString(mRemoteIpAddr, sizeof(mRemoteIpAddr), deviceRemoteIp); -void PairingManager::OnPairDevice(intptr_t context) -{ - Platform::UniquePtr params(reinterpret_cast(context)); - PairingManager & self = PairingManager::Instance(); + return DeviceLayer::SystemLayer().ScheduleLambda([nodeId, setupPINCode, deviceRemotePort]() { + PairingManager & self = PairingManager::Instance(); - self.InitPairingCommand(); - self.mSetupPINCode = params->setupPINCode; + self.InitPairingCommand(); + self.mSetupPINCode = setupPINCode; - Inet::IPAddress address; - Inet::InterfaceId interfaceId; + Inet::IPAddress address; + Inet::InterfaceId interfaceId; - if (!ParseAddressWithInterface(params->ipAddrBuffer, address, interfaceId)) - { - ChipLogError(NotSpecified, "Invalid IP address: %s", params->ipAddrBuffer); - return; - } + if (!ParseAddressWithInterface(self.mRemoteIpAddr, address, interfaceId)) + { + ChipLogError(NotSpecified, "Invalid IP address: %s", self.mRemoteIpAddr); + return; + } - CHIP_ERROR err = self.Pair(params->nodeId, Transport::PeerAddress::UDP(address, params->deviceRemotePort, interfaceId)); - if (err != CHIP_NO_ERROR) - { - ChipLogError(NotSpecified, "Failed to pair device, error: %s", ErrorStr(err)); - } + CHIP_ERROR err = self.Pair(nodeId, Transport::PeerAddress::UDP(address, deviceRemotePort, interfaceId)); + if (err != CHIP_NO_ERROR) + { + ChipLogError(NotSpecified, "Failed to pair device, error: %s", ErrorStr(err)); + } + }); } CHIP_ERROR PairingManager::UnpairDevice(NodeId nodeId) { - auto params = Platform::MakeUnique(); - VerifyOrReturnError(params != nullptr, CHIP_ERROR_NO_MEMORY); - - params->nodeId = nodeId; - - // Schedule work on the Matter thread - return DeviceLayer::PlatformMgr().ScheduleWork(OnUnpairDevice, reinterpret_cast(params.release())); -} - -void PairingManager::OnUnpairDevice(intptr_t context) -{ - Platform::UniquePtr params(reinterpret_cast(context)); - PairingManager & self = PairingManager::Instance(); + return DeviceLayer::SystemLayer().ScheduleLambda([nodeId]() { + PairingManager & self = PairingManager::Instance(); - self.InitPairingCommand(); + self.InitPairingCommand(); - self.mCurrentFabricRemover = Platform::MakeUnique(self.mCommissioner); + self.mCurrentFabricRemover = Platform::MakeUnique(self.mCommissioner); - if (!self.mCurrentFabricRemover) - { - ChipLogError(NotSpecified, "Failed to unpair device, mCurrentFabricRemover is null"); - return; - } + if (!self.mCurrentFabricRemover) + { + ChipLogError(NotSpecified, "Failed to unpair device, mCurrentFabricRemover is null"); + return; + } - CHIP_ERROR err = self.mCurrentFabricRemover->RemoveCurrentFabric(params->nodeId, &self.mCurrentFabricRemoveCallback); - if (err != CHIP_NO_ERROR) - { - ChipLogError(NotSpecified, "Failed to unpair device, error: %s", ErrorStr(err)); - } + CHIP_ERROR err = self.mCurrentFabricRemover->RemoveCurrentFabric(nodeId, &self.mCurrentFabricRemoveCallback); + if (err != CHIP_NO_ERROR) + { + ChipLogError(NotSpecified, "Failed to unpair device, error: %s", ErrorStr(err)); + } + }); } diff --git a/examples/fabric-admin/device_manager/PairingManager.h b/examples/fabric-admin/device_manager/PairingManager.h index 563d129079..50e64f9f0c 100644 --- a/examples/fabric-admin/device_manager/PairingManager.h +++ b/examples/fabric-admin/device_manager/PairingManager.h @@ -140,39 +140,6 @@ class PairingManager : public chip::Controller::DevicePairingDelegate, CHIP_ERROR UnpairDevice(chip::NodeId nodeId); private: - struct CommissioningWindowParams - { - chip::NodeId nodeId; - chip::EndpointId endpointId; - uint16_t commissioningWindowTimeout; - uint32_t iteration; - uint16_t discriminator; - chip::Optional setupPIN; - uint8_t verifierBuffer[chip::Crypto::kSpake2p_VerifierSerialized_Length]; - chip::ByteSpan verifier; - uint8_t saltBuffer[chip::Crypto::kSpake2p_Max_PBKDF_Salt_Length]; - chip::ByteSpan salt; - }; - - struct PairDeviceWithCodeParams - { - chip::NodeId nodeId; - char payloadBuffer[kMaxManualCodeLength + 1]; - }; - - struct PairDeviceParams - { - chip::NodeId nodeId; - uint32_t setupPINCode; - uint16_t deviceRemotePort; - char ipAddrBuffer[chip::Inet::IPAddress::kMaxStringLength]; - }; - - struct UnpairDeviceParams - { - chip::NodeId nodeId; - }; - // Constructors PairingManager(); PairingManager(const PairingManager &) = delete; @@ -202,14 +169,10 @@ class PairingManager : public chip::Controller::DevicePairingDelegate, const chip::Credentials::DeviceAttestationVerifier::AttestationDeviceInfo & info, chip::Credentials::AttestationVerificationResult attestationResult) override; - static void OnOpenCommissioningWindow(intptr_t context); static void OnOpenCommissioningWindowResponse(void * context, chip::NodeId deviceId, CHIP_ERROR status, chip::SetupPayload payload); static void OnOpenCommissioningWindowVerifierResponse(void * context, chip::NodeId deviceId, CHIP_ERROR status); static void OnCurrentFabricRemove(void * context, chip::NodeId remoteNodeId, CHIP_ERROR status); - static void OnPairDeviceWithCode(intptr_t context); - static void OnPairDevice(intptr_t context); - static void OnUnpairDevice(intptr_t context); // Private data members chip::Controller::DeviceCommissioner * mCommissioner = nullptr; @@ -219,12 +182,17 @@ class PairingManager : public chip::Controller::DevicePairingDelegate, CommissioningDelegate * mCommissioningDelegate = nullptr; PairingDelegate * mPairingDelegate = nullptr; - chip::NodeId mNodeId = chip::kUndefinedNodeId; - uint16_t mDiscriminator = 0; - uint32_t mSetupPINCode = 0; - const char * mOnboardingPayload = nullptr; - bool mDeviceIsICD = false; + chip::NodeId mNodeId = chip::kUndefinedNodeId; + chip::ByteSpan mVerifier; + chip::ByteSpan mSalt; + uint16_t mDiscriminator = 0; + uint32_t mSetupPINCode = 0; + bool mDeviceIsICD = false; uint8_t mRandomGeneratedICDSymmetricKey[chip::Crypto::kAES_CCM128_Key_Length]; + uint8_t mVerifierBuffer[chip::Crypto::kSpake2p_VerifierSerialized_Length]; + uint8_t mSaltBuffer[chip::Crypto::kSpake2p_Max_PBKDF_Salt_Length]; + char mRemoteIpAddr[chip::Inet::IPAddress::kMaxStringLength]; + char mOnboardingPayload[kMaxManualCodeLength + 1]; chip::Optional mICDRegistration; chip::Optional mICDCheckInNodeId; From 386816bfebbbb3435110eeefdae9d678c0b372c0 Mon Sep 17 00:00:00 2001 From: crlonxp <88241281+crlonxp@users.noreply.github.com> Date: Mon, 7 Oct 2024 12:47:53 +0800 Subject: [PATCH 015/127] Enable MRP in WiFi-PAF commissioning (#35500) * Enable MRP in WiFi-PAF commissioning Signed-off-by: Lo,Chin-Ran * Restyled by clang-format --------- Signed-off-by: Lo,Chin-Ran Co-authored-by: Restyled.io --- src/transport/SecureSession.h | 6 +++++- src/transport/UnauthenticatedSessionTable.h | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/transport/SecureSession.h b/src/transport/SecureSession.h index ba586a3095..574d5f40cc 100644 --- a/src/transport/SecureSession.h +++ b/src/transport/SecureSession.h @@ -158,7 +158,11 @@ class SecureSession : public Session, public ReferenceCounted Date: Mon, 7 Oct 2024 11:50:53 +0200 Subject: [PATCH 016/127] [Linux] Matter Linux Water Leak Detector Example (#35392) * [Linux] Matter Linux Water Leak Detector Example * Update README.md Remote Echo protocol section * Update water-leak-detector-app.zap * Symlinks * New sym links * Update README.md Fix typo * Create water-leak-detector-app.matter * Update water-leak-detector-app.matter Remove last line * Update README.md * Update water-leak-detector-app.matter * Update water-leak-detector-app.zap * Update water-leak-detector-app.matter * Update water-leak-detector-app.zap * Update water-leak-detector-app.matter * Delete examples/water-leak-detector-app/linux/README.md * Update targets.py to add WATER_LEAK_DETECTOR * Update host.py to add WATER_LEAK_DETECTOR * Update water-leak-detector-app.matter Fix ThreeLevelAutoEnum * Update all_targets_linux_x64.txt Add water-leak-detector --- examples/water-leak-detector-app/linux/.gn | 25 + .../water-leak-detector-app/linux/BUILD.gn | 64 + .../water-leak-detector-app/linux/args.gni | 28 + .../linux/build_overrides | 1 + .../linux/include/CHIPProjectAppConfig.h | 39 + .../water-leak-detector-app/linux/main.cpp | 53 + .../linux/third_party/connectedhomeip | 1 + .../water-leak-detector-common/BUILD.gn | 21 + .../water-leak-detector-app.matter | 1961 ++++++++++ .../water-leak-detector-app.zap | 3214 +++++++++++++++++ scripts/build/build/targets.py | 1 + scripts/build/builders/host.py | 6 + .../build/testdata/all_targets_linux_x64.txt | 2 +- 13 files changed, 5415 insertions(+), 1 deletion(-) create mode 100644 examples/water-leak-detector-app/linux/.gn create mode 100644 examples/water-leak-detector-app/linux/BUILD.gn create mode 100644 examples/water-leak-detector-app/linux/args.gni create mode 120000 examples/water-leak-detector-app/linux/build_overrides create mode 100644 examples/water-leak-detector-app/linux/include/CHIPProjectAppConfig.h create mode 100644 examples/water-leak-detector-app/linux/main.cpp create mode 120000 examples/water-leak-detector-app/linux/third_party/connectedhomeip create mode 100644 examples/water-leak-detector-app/water-leak-detector-common/BUILD.gn create mode 100644 examples/water-leak-detector-app/water-leak-detector-common/water-leak-detector-app.matter create mode 100644 examples/water-leak-detector-app/water-leak-detector-common/water-leak-detector-app.zap diff --git a/examples/water-leak-detector-app/linux/.gn b/examples/water-leak-detector-app/linux/.gn new file mode 100644 index 0000000000..3b11e2ba2e --- /dev/null +++ b/examples/water-leak-detector-app/linux/.gn @@ -0,0 +1,25 @@ +# Copyright (c) 2024 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/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 = { + import("//args.gni") +} diff --git a/examples/water-leak-detector-app/linux/BUILD.gn b/examples/water-leak-detector-app/linux/BUILD.gn new file mode 100644 index 0000000000..c5caf26d8e --- /dev/null +++ b/examples/water-leak-detector-app/linux/BUILD.gn @@ -0,0 +1,64 @@ +# Copyright (c) 2024 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/chip.gni") + +import("${chip_root}/build/chip/tools.gni") +import("${chip_root}/src/app/common_flags.gni") +import("${chip_root}/third_party/imgui/imgui.gni") + +assert(chip_build_tools) + +config("includes") { + include_dirs = [ + ".", + "include", + ] +} + +executable("water-leak-detector-app") { + sources = [ + "include/CHIPProjectAppConfig.h", + "main.cpp", + ] + + deps = [ + "${chip_root}/examples/platform/linux:app-main", + "${chip_root}/examples/water-leak-detector-app/water-leak-detector-common", + "${chip_root}/src/lib", + ] + + if (chip_examples_enable_imgui_ui) { + deps += [ + "${chip_root}/examples/common/imgui_ui", + "${chip_root}/examples/common/imgui_ui/windows:boolean_state", + "${chip_root}/examples/common/imgui_ui/windows:occupancy_sensing", + "${chip_root}/examples/common/imgui_ui/windows:qrcode", + ] + } + + include_dirs = [ "include" ] + + cflags = [ "-Wconversion" ] + + output_dir = root_out_dir +} + +group("linux") { + deps = [ ":water-leak-detector-app" ] +} + +group("default") { + deps = [ ":linux" ] +} diff --git a/examples/water-leak-detector-app/linux/args.gni b/examples/water-leak-detector-app/linux/args.gni new file mode 100644 index 0000000000..5be50537dd --- /dev/null +++ b/examples/water-leak-detector-app/linux/args.gni @@ -0,0 +1,28 @@ +# 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. + +# CHIPProjectConfig.h + +import("//build_overrides/chip.gni") + +import("${chip_root}/config/standalone/args.gni") + +chip_device_project_config_include = "" +chip_project_config_include = "" +chip_system_project_config_include = "" + +chip_project_config_include_dirs = + [ "${chip_root}/examples/water-leak-detector-app/linux/include" ] +chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ] +matter_enable_tracing_support = true diff --git a/examples/water-leak-detector-app/linux/build_overrides b/examples/water-leak-detector-app/linux/build_overrides new file mode 120000 index 0000000000..e578e73312 --- /dev/null +++ b/examples/water-leak-detector-app/linux/build_overrides @@ -0,0 +1 @@ +../../build_overrides \ No newline at end of file diff --git a/examples/water-leak-detector-app/linux/include/CHIPProjectAppConfig.h b/examples/water-leak-detector-app/linux/include/CHIPProjectAppConfig.h new file mode 100644 index 0000000000..14ec70af42 --- /dev/null +++ b/examples/water-leak-detector-app/linux/include/CHIPProjectAppConfig.h @@ -0,0 +1,39 @@ +/* + * + * 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 the CHIPProjectConfig from config/standalone +#include + +#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY 0 + +// Bulbs do not typically use this - enabled so we can use shell to discover commissioners +#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT 1 + +#define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 + +#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_TYPE 1 + +#define CHIP_DEVICE_CONFIG_DEVICE_TYPE 0x0043 // Water Leak Detector + +#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_NAME 1 + +#define CHIP_DEVICE_ENABLE_PORT_PARAMS 1 + +#define CHIP_DEVICE_CONFIG_DEVICE_NAME "Water Leak Detector" diff --git a/examples/water-leak-detector-app/linux/main.cpp b/examples/water-leak-detector-app/linux/main.cpp new file mode 100644 index 0000000000..02a91b82ce --- /dev/null +++ b/examples/water-leak-detector-app/linux/main.cpp @@ -0,0 +1,53 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#if defined(CHIP_IMGUI_ENABLED) && CHIP_IMGUI_ENABLED +#include +#include +#include +#include +#endif + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; + +void ApplicationInit() {} + +void ApplicationShutdown() {} + +int main(int argc, char * argv[]) +{ + VerifyOrDie(ChipLinuxAppInit(argc, argv) == 0); + +#if defined(CHIP_IMGUI_ENABLED) && CHIP_IMGUI_ENABLED + example::Ui::ImguiUi ui; + + ui.AddWindow(std::make_unique()); + ui.AddWindow(std::make_unique(chip::EndpointId(1), "Water Leak Detector")); + + ChipLinuxAppMainLoop(&ui); +#else + ChipLinuxAppMainLoop(); +#endif + + return 0; +} diff --git a/examples/water-leak-detector-app/linux/third_party/connectedhomeip b/examples/water-leak-detector-app/linux/third_party/connectedhomeip new file mode 120000 index 0000000000..c866b86874 --- /dev/null +++ b/examples/water-leak-detector-app/linux/third_party/connectedhomeip @@ -0,0 +1 @@ +../../../.. \ No newline at end of file diff --git a/examples/water-leak-detector-app/water-leak-detector-common/BUILD.gn b/examples/water-leak-detector-app/water-leak-detector-common/BUILD.gn new file mode 100644 index 0000000000..47031e0dbc --- /dev/null +++ b/examples/water-leak-detector-app/water-leak-detector-common/BUILD.gn @@ -0,0 +1,21 @@ +# Copyright (c) 2024 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/chip.gni") +import("${chip_root}/src/app/chip_data_model.gni") + +chip_data_model("water-leak-detector-common") { + zap_file = "water-leak-detector-app.zap" + is_server = true +} diff --git a/examples/water-leak-detector-app/water-leak-detector-common/water-leak-detector-app.matter b/examples/water-leak-detector-app/water-leak-detector-common/water-leak-detector-app.matter new file mode 100644 index 0000000000..b01d083abb --- /dev/null +++ b/examples/water-leak-detector-app/water-leak-detector-common/water-leak-detector-app.matter @@ -0,0 +1,1961 @@ +// This IDL was generated automatically by ZAP. +// It is for view/code review purposes only. + +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum AtomicRequestTypeEnum : enum8 { + kBeginWrite = 0; + kCommitWrite = 1; + kRollbackWrite = 2; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; +} + +enum RelativePositionTag : enum8 { + kUnder = 0; + kNextTo = 1; + kAround = 2; + kOn = 3; + kAbove = 4; + kFrontOf = 5; + kBehind = 6; +} + +enum TestGlobalEnum : enum8 { + kSomeValue = 0; + kSomeOtherValue = 1; + kFinalValue = 2; +} + +enum ThreeLevelAutoEnum : enum8 { + kLow = 0; + kMedium = 1; + kHigh = 2; + kAutomatic = 3; +} + +bitmap TestGlobalBitmap : bitmap32 { + kFirstBit = 0x1; + kSecondBit = 0x2; +} + +struct TestGlobalStruct { + char_string<128> name = 0; + nullable TestGlobalBitmap myBitmap = 1; + optional nullable TestGlobalEnum myEnum = 2; +} + +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + +struct AtomicAttributeStatusStruct { + attrib_id attributeID = 0; + status statusCode = 1; +} + +/** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ +cluster Identify = 3 { + revision 4; + + enum EffectIdentifierEnum : enum8 { + kBlink = 0; + kBreathe = 1; + kOkay = 2; + kChannelChange = 11; + kFinishEffect = 254; + kStopEffect = 255; + } + + enum EffectVariantEnum : enum8 { + kDefault = 0; + } + + enum IdentifyTypeEnum : enum8 { + kNone = 0; + kLightOutput = 1; + kVisibleIndicator = 2; + kAudibleBeep = 3; + kDisplay = 4; + kActuator = 5; + } + + attribute int16u identifyTime = 0; + readonly attribute IdentifyTypeEnum identifyType = 1; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct IdentifyRequest { + int16u identifyTime = 0; + } + + request struct TriggerEffectRequest { + EffectIdentifierEnum effectIdentifier = 0; + EffectVariantEnum effectVariant = 1; + } + + /** Command description for Identify */ + command access(invoke: manage) Identify(IdentifyRequest): DefaultSuccess = 0; + /** Command description for TriggerEffect */ + command access(invoke: manage) TriggerEffect(TriggerEffectRequest): DefaultSuccess = 64; +} + +/** Attributes and commands for group configuration and manipulation. */ +cluster Groups = 4 { + revision 4; + + bitmap Feature : bitmap32 { + kGroupNames = 0x1; + } + + bitmap NameSupportBitmap : bitmap8 { + kGroupNames = 0x80; + } + + readonly attribute NameSupportBitmap nameSupport = 0; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AddGroupRequest { + group_id groupID = 0; + char_string<16> groupName = 1; + } + + response struct AddGroupResponse = 0 { + enum8 status = 0; + group_id groupID = 1; + } + + request struct ViewGroupRequest { + group_id groupID = 0; + } + + response struct ViewGroupResponse = 1 { + enum8 status = 0; + group_id groupID = 1; + char_string<16> groupName = 2; + } + + request struct GetGroupMembershipRequest { + group_id groupList[] = 0; + } + + response struct GetGroupMembershipResponse = 2 { + nullable int8u capacity = 0; + group_id groupList[] = 1; + } + + request struct RemoveGroupRequest { + group_id groupID = 0; + } + + response struct RemoveGroupResponse = 3 { + enum8 status = 0; + group_id groupID = 1; + } + + request struct AddGroupIfIdentifyingRequest { + group_id groupID = 0; + char_string<16> groupName = 1; + } + + /** Command description for AddGroup */ + fabric command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; + /** Command description for ViewGroup */ + fabric command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; + /** Command description for GetGroupMembership */ + fabric command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; + /** Command description for RemoveGroup */ + fabric command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; + /** Command description for RemoveAllGroups */ + fabric command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; + /** Command description for AddGroupIfIdentifying */ + fabric command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; +} + +/** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ +cluster Descriptor = 29 { + revision 2; + + bitmap Feature : bitmap32 { + kTagList = 0x1; + } + + struct DeviceTypeStruct { + devtype_id deviceType = 0; + int16u revision = 1; + } + + struct SemanticTagStruct { + nullable vendor_id mfgCode = 0; + enum8 namespaceID = 1; + enum8 tag = 2; + optional nullable char_string label = 3; + } + + readonly attribute DeviceTypeStruct deviceTypeList[] = 0; + readonly attribute cluster_id serverList[] = 1; + readonly attribute cluster_id clientList[] = 2; + readonly attribute endpoint_no partsList[] = 3; + readonly attribute optional SemanticTagStruct tagList[] = 4; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** The Access Control Cluster exposes a data model view of a + Node's Access Control List (ACL), which codifies the rules used to manage + and enforce Access Control for the Node's endpoints and their associated + cluster instances. */ +cluster AccessControl = 31 { + revision 2; + + enum AccessControlEntryAuthModeEnum : enum8 { + kPASE = 1; + kCASE = 2; + kGroup = 3; + } + + enum AccessControlEntryPrivilegeEnum : enum8 { + kView = 1; + kProxyView = 2; + kOperate = 3; + kManage = 4; + kAdminister = 5; + } + + enum AccessRestrictionTypeEnum : enum8 { + kAttributeAccessForbidden = 0; + kAttributeWriteForbidden = 1; + kCommandForbidden = 2; + kEventForbidden = 3; + } + + enum ChangeTypeEnum : enum8 { + kChanged = 0; + kAdded = 1; + kRemoved = 2; + } + + bitmap Feature : bitmap32 { + kExtension = 0x1; + kManagedDevice = 0x2; + } + + struct AccessRestrictionStruct { + AccessRestrictionTypeEnum type = 0; + nullable int32u id = 1; + } + + struct CommissioningAccessRestrictionEntryStruct { + endpoint_no endpoint = 0; + cluster_id cluster = 1; + AccessRestrictionStruct restrictions[] = 2; + } + + fabric_scoped struct AccessRestrictionEntryStruct { + fabric_sensitive endpoint_no endpoint = 0; + fabric_sensitive cluster_id cluster = 1; + fabric_sensitive AccessRestrictionStruct restrictions[] = 2; + fabric_idx fabricIndex = 254; + } + + struct AccessControlTargetStruct { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + + fabric_scoped struct AccessControlEntryStruct { + fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; + fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; + nullable fabric_sensitive int64u subjects[] = 3; + nullable fabric_sensitive AccessControlTargetStruct targets[] = 4; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct AccessControlExtensionStruct { + fabric_sensitive octet_string<128> data = 1; + fabric_idx fabricIndex = 254; + } + + fabric_sensitive info event access(read: administer) AccessControlEntryChanged = 0 { + nullable node_id adminNodeID = 1; + nullable int16u adminPasscodeID = 2; + ChangeTypeEnum changeType = 3; + nullable AccessControlEntryStruct latestValue = 4; + fabric_idx fabricIndex = 254; + } + + fabric_sensitive info event access(read: administer) AccessControlExtensionChanged = 1 { + nullable node_id adminNodeID = 1; + nullable int16u adminPasscodeID = 2; + ChangeTypeEnum changeType = 3; + nullable AccessControlExtensionStruct latestValue = 4; + fabric_idx fabricIndex = 254; + } + + fabric_sensitive info event access(read: administer) FabricRestrictionReviewUpdate = 2 { + int64u token = 0; + optional long_char_string instruction = 1; + optional long_char_string ARLRequestFlowUrl = 2; + fabric_idx fabricIndex = 254; + } + + attribute access(read: administer, write: administer) AccessControlEntryStruct acl[] = 0; + attribute access(read: administer, write: administer) optional AccessControlExtensionStruct extension[] = 1; + readonly attribute int16u subjectsPerAccessControlEntry = 2; + readonly attribute int16u targetsPerAccessControlEntry = 3; + readonly attribute int16u accessControlEntriesPerFabric = 4; + readonly attribute optional CommissioningAccessRestrictionEntryStruct commissioningARL[] = 5; + readonly attribute optional AccessRestrictionEntryStruct arl[] = 6; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ReviewFabricRestrictionsRequest { + CommissioningAccessRestrictionEntryStruct arl[] = 0; + } + + response struct ReviewFabricRestrictionsResponse = 1 { + int64u token = 0; + } + + /** This command signals to the service associated with the device vendor that the fabric administrator would like a review of the current restrictions on the accessing fabric. */ + fabric command access(invoke: administer) ReviewFabricRestrictions(ReviewFabricRestrictionsRequest): ReviewFabricRestrictionsResponse = 0; +} + +/** This cluster provides attributes and events for determining basic information about Nodes, which supports both + Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, + which apply to the whole Node. Also allows setting user device information such as location. */ +cluster BasicInformation = 40 { + revision 3; + + enum ColorEnum : enum8 { + kBlack = 0; + kNavy = 1; + kGreen = 2; + kTeal = 3; + kMaroon = 4; + kPurple = 5; + kOlive = 6; + kGray = 7; + kBlue = 8; + kLime = 9; + kAqua = 10; + kRed = 11; + kFuchsia = 12; + kYellow = 13; + kWhite = 14; + kNickel = 15; + kChrome = 16; + kBrass = 17; + kCopper = 18; + kSilver = 19; + kGold = 20; + } + + enum ProductFinishEnum : enum8 { + kOther = 0; + kMatte = 1; + kSatin = 2; + kPolished = 3; + kRugged = 4; + kFabric = 5; + } + + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + + struct ProductAppearanceStruct { + ProductFinishEnum finish = 0; + nullable ColorEnum primaryColor = 1; + } + + critical event StartUp = 0 { + int32u softwareVersion = 0; + } + + critical event ShutDown = 1 { + } + + info event Leave = 2 { + fabric_idx fabricIndex = 0; + } + + info event ReachableChanged = 3 { + boolean reachableNewValue = 0; + } + + readonly attribute int16u dataModelRevision = 0; + readonly attribute char_string<32> vendorName = 1; + readonly attribute vendor_id vendorID = 2; + readonly attribute char_string<32> productName = 3; + readonly attribute int16u productID = 4; + attribute access(write: manage) char_string<32> nodeLabel = 5; + attribute access(write: administer) char_string<2> location = 6; + readonly attribute int16u hardwareVersion = 7; + readonly attribute char_string<64> hardwareVersionString = 8; + readonly attribute int32u softwareVersion = 9; + readonly attribute char_string<64> softwareVersionString = 10; + readonly attribute optional char_string<16> manufacturingDate = 11; + readonly attribute optional char_string<32> partNumber = 12; + readonly attribute optional long_char_string<256> productURL = 13; + readonly attribute optional char_string<64> productLabel = 14; + readonly attribute optional char_string<32> serialNumber = 15; + attribute access(write: manage) optional boolean localConfigDisabled = 16; + readonly attribute optional boolean reachable = 17; + readonly attribute char_string<32> uniqueID = 18; + readonly attribute CapabilityMinimaStruct capabilityMinima = 19; + readonly attribute optional ProductAppearanceStruct productAppearance = 20; + readonly attribute int32u specificationVersion = 21; + readonly attribute int16u maxPathsPerInvoke = 22; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + command MfgSpecificPing(): DefaultSuccess = 0; +} + +/** Nodes should be expected to be deployed to any and all regions of the world. These global regions + may have differing common languages, units of measurements, and numerical formatting + standards. As such, Nodes that visually or audibly convey information need a mechanism by which + they can be configured to use a user’s preferred language, units, etc */ +cluster LocalizationConfiguration = 43 { + revision 1; // NOTE: Default/not specifically set + + attribute access(write: manage) char_string<35> activeLocale = 0; + readonly attribute char_string supportedLocales[] = 1; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** This cluster is used to describe the configuration and capabilities of a physical power source that provides power to the Node. */ +cluster PowerSource = 47 { + revision 1; // NOTE: Default/not specifically set + + enum BatApprovedChemistryEnum : enum16 { + kUnspecified = 0; + kAlkaline = 1; + kLithiumCarbonFluoride = 2; + kLithiumChromiumOxide = 3; + kLithiumCopperOxide = 4; + kLithiumIronDisulfide = 5; + kLithiumManganeseDioxide = 6; + kLithiumThionylChloride = 7; + kMagnesium = 8; + kMercuryOxide = 9; + kNickelOxyhydride = 10; + kSilverOxide = 11; + kZincAir = 12; + kZincCarbon = 13; + kZincChloride = 14; + kZincManganeseDioxide = 15; + kLeadAcid = 16; + kLithiumCobaltOxide = 17; + kLithiumIon = 18; + kLithiumIonPolymer = 19; + kLithiumIronPhosphate = 20; + kLithiumSulfur = 21; + kLithiumTitanate = 22; + kNickelCadmium = 23; + kNickelHydrogen = 24; + kNickelIron = 25; + kNickelMetalHydride = 26; + kNickelZinc = 27; + kSilverZinc = 28; + kSodiumIon = 29; + kSodiumSulfur = 30; + kZincBromide = 31; + kZincCerium = 32; + } + + enum BatChargeFaultEnum : enum8 { + kUnspecified = 0; + kAmbientTooHot = 1; + kAmbientTooCold = 2; + kBatteryTooHot = 3; + kBatteryTooCold = 4; + kBatteryAbsent = 5; + kBatteryOverVoltage = 6; + kBatteryUnderVoltage = 7; + kChargerOverVoltage = 8; + kChargerUnderVoltage = 9; + kSafetyTimeout = 10; + } + + enum BatChargeLevelEnum : enum8 { + kOK = 0; + kWarning = 1; + kCritical = 2; + } + + enum BatChargeStateEnum : enum8 { + kUnknown = 0; + kIsCharging = 1; + kIsAtFullCharge = 2; + kIsNotCharging = 3; + } + + enum BatCommonDesignationEnum : enum16 { + kUnspecified = 0; + kAAA = 1; + kAA = 2; + kC = 3; + kD = 4; + k4v5 = 5; + k6v0 = 6; + k9v0 = 7; + k12AA = 8; + kAAAA = 9; + kA = 10; + kB = 11; + kF = 12; + kN = 13; + kNo6 = 14; + kSubC = 15; + kA23 = 16; + kA27 = 17; + kBA5800 = 18; + kDuplex = 19; + k4SR44 = 20; + k523 = 21; + k531 = 22; + k15v0 = 23; + k22v5 = 24; + k30v0 = 25; + k45v0 = 26; + k67v5 = 27; + kJ = 28; + kCR123A = 29; + kCR2 = 30; + k2CR5 = 31; + kCRP2 = 32; + kCRV3 = 33; + kSR41 = 34; + kSR43 = 35; + kSR44 = 36; + kSR45 = 37; + kSR48 = 38; + kSR54 = 39; + kSR55 = 40; + kSR57 = 41; + kSR58 = 42; + kSR59 = 43; + kSR60 = 44; + kSR63 = 45; + kSR64 = 46; + kSR65 = 47; + kSR66 = 48; + kSR67 = 49; + kSR68 = 50; + kSR69 = 51; + kSR516 = 52; + kSR731 = 53; + kSR712 = 54; + kLR932 = 55; + kA5 = 56; + kA10 = 57; + kA13 = 58; + kA312 = 59; + kA675 = 60; + kAC41E = 61; + k10180 = 62; + k10280 = 63; + k10440 = 64; + k14250 = 65; + k14430 = 66; + k14500 = 67; + k14650 = 68; + k15270 = 69; + k16340 = 70; + kRCR123A = 71; + k17500 = 72; + k17670 = 73; + k18350 = 74; + k18500 = 75; + k18650 = 76; + k19670 = 77; + k25500 = 78; + k26650 = 79; + k32600 = 80; + } + + enum BatFaultEnum : enum8 { + kUnspecified = 0; + kOverTemp = 1; + kUnderTemp = 2; + } + + enum BatReplaceabilityEnum : enum8 { + kUnspecified = 0; + kNotReplaceable = 1; + kUserReplaceable = 2; + kFactoryReplaceable = 3; + } + + enum PowerSourceStatusEnum : enum8 { + kUnspecified = 0; + kActive = 1; + kStandby = 2; + kUnavailable = 3; + } + + enum WiredCurrentTypeEnum : enum8 { + kAC = 0; + kDC = 1; + } + + enum WiredFaultEnum : enum8 { + kUnspecified = 0; + kOverVoltage = 1; + kUnderVoltage = 2; + } + + bitmap Feature : bitmap32 { + kWired = 0x1; + kBattery = 0x2; + kRechargeable = 0x4; + kReplaceable = 0x8; + } + + struct BatChargeFaultChangeType { + BatChargeFaultEnum current[] = 0; + BatChargeFaultEnum previous[] = 1; + } + + struct BatFaultChangeType { + BatFaultEnum current[] = 0; + BatFaultEnum previous[] = 1; + } + + struct WiredFaultChangeType { + WiredFaultEnum current[] = 0; + WiredFaultEnum previous[] = 1; + } + + info event WiredFaultChange = 0 { + WiredFaultEnum current[] = 0; + WiredFaultEnum previous[] = 1; + } + + info event BatFaultChange = 1 { + BatFaultEnum current[] = 0; + BatFaultEnum previous[] = 1; + } + + info event BatChargeFaultChange = 2 { + BatChargeFaultEnum current[] = 0; + BatChargeFaultEnum previous[] = 1; + } + + readonly attribute PowerSourceStatusEnum status = 0; + readonly attribute int8u order = 1; + readonly attribute char_string<60> description = 2; + readonly attribute optional nullable int32u wiredAssessedInputVoltage = 3; + readonly attribute optional nullable int16u wiredAssessedInputFrequency = 4; + readonly attribute optional WiredCurrentTypeEnum wiredCurrentType = 5; + readonly attribute optional nullable int32u wiredAssessedCurrent = 6; + readonly attribute optional int32u wiredNominalVoltage = 7; + readonly attribute optional int32u wiredMaximumCurrent = 8; + readonly attribute optional boolean wiredPresent = 9; + readonly attribute optional WiredFaultEnum activeWiredFaults[] = 10; + readonly attribute optional nullable int32u batVoltage = 11; + readonly attribute optional nullable int8u batPercentRemaining = 12; + readonly attribute optional nullable int32u batTimeRemaining = 13; + readonly attribute optional BatChargeLevelEnum batChargeLevel = 14; + readonly attribute optional boolean batReplacementNeeded = 15; + readonly attribute optional BatReplaceabilityEnum batReplaceability = 16; + readonly attribute optional boolean batPresent = 17; + readonly attribute optional BatFaultEnum activeBatFaults[] = 18; + readonly attribute optional char_string<60> batReplacementDescription = 19; + readonly attribute optional BatCommonDesignationEnum batCommonDesignation = 20; + readonly attribute optional char_string<20> batANSIDesignation = 21; + readonly attribute optional char_string<20> batIECDesignation = 22; + readonly attribute optional BatApprovedChemistryEnum batApprovedChemistry = 23; + readonly attribute optional int32u batCapacity = 24; + readonly attribute optional int8u batQuantity = 25; + readonly attribute optional BatChargeStateEnum batChargeState = 26; + readonly attribute optional nullable int32u batTimeToFullCharge = 27; + readonly attribute optional boolean batFunctionalWhileCharging = 28; + readonly attribute optional nullable int32u batChargingCurrent = 29; + readonly attribute optional BatChargeFaultEnum activeBatChargeFaults[] = 30; + readonly attribute endpoint_no endpointList[] = 31; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** This cluster is used to manage global aspects of the Commissioning flow. */ +cluster GeneralCommissioning = 48 { + revision 1; // NOTE: Default/not specifically set + + enum CommissioningErrorEnum : enum8 { + kOK = 0; + kValueOutsideRange = 1; + kInvalidAuthentication = 2; + kNoFailSafe = 3; + kBusyWithOtherAdmin = 4; + kRequiredTCNotAccepted = 5; + kTCAcknowledgementsNotReceived = 6; + kTCMinVersionNotMet = 7; + } + + enum RegulatoryLocationTypeEnum : enum8 { + kIndoor = 0; + kOutdoor = 1; + kIndoorOutdoor = 2; + } + + bitmap Feature : bitmap32 { + kTermsAndConditions = 0x1; + } + + struct BasicCommissioningInfo { + int16u failSafeExpiryLengthSeconds = 0; + int16u maxCumulativeFailsafeSeconds = 1; + } + + attribute access(write: administer) int64u breadcrumb = 0; + readonly attribute BasicCommissioningInfo basicCommissioningInfo = 1; + readonly attribute RegulatoryLocationTypeEnum regulatoryConfig = 2; + readonly attribute RegulatoryLocationTypeEnum locationCapability = 3; + readonly attribute boolean supportsConcurrentConnection = 4; + provisional readonly attribute access(read: administer) optional int16u TCAcceptedVersion = 5; + provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; + provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; + provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ArmFailSafeRequest { + int16u expiryLengthSeconds = 0; + int64u breadcrumb = 1; + } + + response struct ArmFailSafeResponse = 1 { + CommissioningErrorEnum errorCode = 0; + char_string<128> debugText = 1; + } + + request struct SetRegulatoryConfigRequest { + RegulatoryLocationTypeEnum newRegulatoryConfig = 0; + char_string<2> countryCode = 1; + int64u breadcrumb = 2; + } + + response struct SetRegulatoryConfigResponse = 3 { + CommissioningErrorEnum errorCode = 0; + char_string debugText = 1; + } + + response struct CommissioningCompleteResponse = 5 { + CommissioningErrorEnum errorCode = 0; + char_string debugText = 1; + } + + request struct SetTCAcknowledgementsRequest { + int16u TCVersion = 0; + bitmap16 TCUserResponse = 1; + } + + response struct SetTCAcknowledgementsResponse = 7 { + CommissioningErrorEnum errorCode = 0; + } + + /** Arm the persistent fail-safe timer with an expiry time of now + ExpiryLengthSeconds using device clock */ + command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; + /** Set the regulatory configuration to be used during commissioning */ + command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; + /** Signals the Server that the Client has successfully completed all steps of Commissioning/Recofiguration needed during fail-safe period. */ + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + /** This command sets the user acknowledgements received in the Enhanced Setup Flow Terms and Conditions into the node. */ + command access(invoke: administer) SetTCAcknowledgements(SetTCAcknowledgementsRequest): SetTCAcknowledgementsResponse = 6; +} + +/** Functionality to configure, enable, disable network credentials and access on a Matter device. */ +cluster NetworkCommissioning = 49 { + revision 1; // NOTE: Default/not specifically set + + enum NetworkCommissioningStatusEnum : enum8 { + kSuccess = 0; + kOutOfRange = 1; + kBoundsExceeded = 2; + kNetworkIDNotFound = 3; + kDuplicateNetworkID = 4; + kNetworkNotFound = 5; + kRegulatoryError = 6; + kAuthFailure = 7; + kUnsupportedSecurity = 8; + kOtherConnectionFailure = 9; + kIPV6Failed = 10; + kIPBindFailed = 11; + kUnknownError = 12; + } + + enum WiFiBandEnum : enum8 { + k2G4 = 0; + k3G65 = 1; + k5G = 2; + k6G = 3; + k60G = 4; + k1G = 5; + } + + bitmap Feature : bitmap32 { + kWiFiNetworkInterface = 0x1; + kThreadNetworkInterface = 0x2; + kEthernetNetworkInterface = 0x4; + kPerDeviceCredentials = 0x8; + } + + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { + kUnencrypted = 0x1; + kWEP = 0x2; + kWPAPersonal = 0x4; + kWPA2Personal = 0x8; + kWPA3Personal = 0x10; + kWPA3MatterPDC = 0x20; + } + + struct NetworkInfoStruct { + octet_string<32> networkID = 0; + boolean connected = 1; + optional nullable octet_string<20> networkIdentifier = 2; + optional nullable octet_string<20> clientIdentifier = 3; + } + + struct ThreadInterfaceScanResultStruct { + int16u panId = 0; + int64u extendedPanId = 1; + char_string<16> networkName = 2; + int16u channel = 3; + int8u version = 4; + octet_string<8> extendedAddress = 5; + int8s rssi = 6; + int8u lqi = 7; + } + + struct WiFiInterfaceScanResultStruct { + WiFiSecurityBitmap security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBandEnum wiFiBand = 4; + int8s rssi = 5; + } + + readonly attribute access(read: administer) int8u maxNetworks = 0; + readonly attribute access(read: administer) NetworkInfoStruct networks[] = 1; + readonly attribute optional int8u scanMaxTimeSeconds = 2; + readonly attribute optional int8u connectMaxTimeSeconds = 3; + attribute access(write: administer) boolean interfaceEnabled = 4; + readonly attribute access(read: administer) nullable NetworkCommissioningStatusEnum lastNetworkingStatus = 5; + readonly attribute access(read: administer) nullable octet_string<32> lastNetworkID = 6; + readonly attribute access(read: administer) nullable int32s lastConnectErrorValue = 7; + provisional readonly attribute optional WiFiBandEnum supportedWiFiBands[] = 8; + provisional readonly attribute optional ThreadCapabilitiesBitmap supportedThreadFeatures = 9; + provisional readonly attribute optional int16u threadVersion = 10; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ScanNetworksRequest { + optional nullable octet_string<32> ssid = 0; + optional int64u breadcrumb = 1; + } + + response struct ScanNetworksResponse = 1 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional char_string debugText = 1; + optional WiFiInterfaceScanResultStruct wiFiScanResults[] = 2; + optional ThreadInterfaceScanResultStruct threadScanResults[] = 3; + } + + request struct AddOrUpdateWiFiNetworkRequest { + octet_string<32> ssid = 0; + octet_string<64> credentials = 1; + optional int64u breadcrumb = 2; + optional octet_string<140> networkIdentity = 3; + optional octet_string<20> clientIdentifier = 4; + optional octet_string<32> possessionNonce = 5; + } + + request struct AddOrUpdateThreadNetworkRequest { + octet_string<254> operationalDataset = 0; + optional int64u breadcrumb = 1; + } + + request struct RemoveNetworkRequest { + octet_string<32> networkID = 0; + optional int64u breadcrumb = 1; + } + + response struct NetworkConfigResponse = 5 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional char_string<512> debugText = 1; + optional int8u networkIndex = 2; + optional octet_string<140> clientIdentity = 3; + optional octet_string<64> possessionSignature = 4; + } + + request struct ConnectNetworkRequest { + octet_string<32> networkID = 0; + optional int64u breadcrumb = 1; + } + + response struct ConnectNetworkResponse = 7 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional char_string debugText = 1; + nullable int32s errorValue = 2; + } + + request struct ReorderNetworkRequest { + octet_string<32> networkID = 0; + int8u networkIndex = 1; + optional int64u breadcrumb = 2; + } + + request struct QueryIdentityRequest { + octet_string<20> keyIdentifier = 0; + optional octet_string<32> possessionNonce = 1; + } + + response struct QueryIdentityResponse = 10 { + octet_string<140> identity = 0; + optional octet_string<64> possessionSignature = 1; + } + + /** Detemine the set of networks the device sees as available. */ + command access(invoke: administer) ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; + /** Add or update the credentials for a given Wi-Fi network. */ + command access(invoke: administer) AddOrUpdateWiFiNetwork(AddOrUpdateWiFiNetworkRequest): NetworkConfigResponse = 2; + /** Add or update the credentials for a given Thread network. */ + command access(invoke: administer) AddOrUpdateThreadNetwork(AddOrUpdateThreadNetworkRequest): NetworkConfigResponse = 3; + /** Remove the definition of a given network (including its credentials). */ + command access(invoke: administer) RemoveNetwork(RemoveNetworkRequest): NetworkConfigResponse = 4; + /** Connect to the specified network, using previously-defined credentials. */ + command access(invoke: administer) ConnectNetwork(ConnectNetworkRequest): ConnectNetworkResponse = 6; + /** Modify the order in which networks will be presented in the Networks attribute. */ + command access(invoke: administer) ReorderNetwork(ReorderNetworkRequest): NetworkConfigResponse = 8; + /** Retrieve details about and optionally proof of possession of a network client identity. */ + command access(invoke: administer) QueryIdentity(QueryIdentityRequest): QueryIdentityResponse = 9; +} + +/** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ +cluster DiagnosticLogs = 50 { + revision 1; // NOTE: Default/not specifically set + + enum IntentEnum : enum8 { + kEndUserSupport = 0; + kNetworkDiag = 1; + kCrashLogs = 2; + } + + enum StatusEnum : enum8 { + kSuccess = 0; + kExhausted = 1; + kNoLogs = 2; + kBusy = 3; + kDenied = 4; + } + + enum TransferProtocolEnum : enum8 { + kResponsePayload = 0; + kBDX = 1; + } + + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct RetrieveLogsRequestRequest { + IntentEnum intent = 0; + TransferProtocolEnum requestedProtocol = 1; + optional char_string<32> transferFileDesignator = 2; + } + + response struct RetrieveLogsResponse = 1 { + StatusEnum status = 0; + long_octet_string logContent = 1; + optional epoch_us UTCTimeStamp = 2; + optional systime_us timeSinceBoot = 3; + } + + /** Retrieving diagnostic logs from a Node */ + command RetrieveLogsRequest(RetrieveLogsRequestRequest): RetrieveLogsResponse = 0; +} + +/** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ +cluster GeneralDiagnostics = 51 { + revision 2; + + enum BootReasonEnum : enum8 { + kUnspecified = 0; + kPowerOnReboot = 1; + kBrownOutReset = 2; + kSoftwareWatchdogReset = 3; + kHardwareWatchdogReset = 4; + kSoftwareUpdateCompleted = 5; + kSoftwareReset = 6; + } + + enum HardwareFaultEnum : enum8 { + kUnspecified = 0; + kRadio = 1; + kSensor = 2; + kResettableOverTemp = 3; + kNonResettableOverTemp = 4; + kPowerSource = 5; + kVisualDisplayFault = 6; + kAudioOutputFault = 7; + kUserInterfaceFault = 8; + kNonVolatileMemoryError = 9; + kTamperDetected = 10; + } + + enum InterfaceTypeEnum : enum8 { + kUnspecified = 0; + kWiFi = 1; + kEthernet = 2; + kCellular = 3; + kThread = 4; + } + + enum NetworkFaultEnum : enum8 { + kUnspecified = 0; + kHardwareFailure = 1; + kNetworkJammed = 2; + kConnectionFailed = 3; + } + + enum RadioFaultEnum : enum8 { + kUnspecified = 0; + kWiFiFault = 1; + kCellularFault = 2; + kThreadFault = 3; + kNFCFault = 4; + kBLEFault = 5; + kEthernetFault = 6; + } + + bitmap Feature : bitmap32 { + kDataModelTest = 0x1; + } + + struct NetworkInterface { + char_string<32> name = 0; + boolean isOperational = 1; + nullable boolean offPremiseServicesReachableIPv4 = 2; + nullable boolean offPremiseServicesReachableIPv6 = 3; + octet_string<8> hardwareAddress = 4; + octet_string IPv4Addresses[] = 5; + octet_string IPv6Addresses[] = 6; + InterfaceTypeEnum type = 7; + } + + critical event HardwareFaultChange = 0 { + HardwareFaultEnum current[] = 0; + HardwareFaultEnum previous[] = 1; + } + + critical event RadioFaultChange = 1 { + RadioFaultEnum current[] = 0; + RadioFaultEnum previous[] = 1; + } + + critical event NetworkFaultChange = 2 { + NetworkFaultEnum current[] = 0; + NetworkFaultEnum previous[] = 1; + } + + critical event BootReason = 3 { + BootReasonEnum bootReason = 0; + } + + readonly attribute NetworkInterface networkInterfaces[] = 0; + readonly attribute int16u rebootCount = 1; + readonly attribute optional int64u upTime = 2; + readonly attribute optional int32u totalOperationalHours = 3; + readonly attribute optional BootReasonEnum bootReason = 4; + readonly attribute optional HardwareFaultEnum activeHardwareFaults[] = 5; + readonly attribute optional RadioFaultEnum activeRadioFaults[] = 6; + readonly attribute optional NetworkFaultEnum activeNetworkFaults[] = 7; + readonly attribute boolean testEventTriggersEnabled = 8; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct TestEventTriggerRequest { + octet_string<16> enableKey = 0; + int64u eventTrigger = 1; + } + + response struct TimeSnapshotResponse = 2 { + systime_ms systemTimeMs = 0; + nullable posix_ms posixTimeMs = 1; + } + + request struct PayloadTestRequestRequest { + octet_string<16> enableKey = 0; + int8u value = 1; + int16u count = 2; + } + + response struct PayloadTestResponse = 4 { + octet_string payload = 0; + } + + /** Provide a means for certification tests to trigger some test-plan-specific events */ + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + /** Take a snapshot of system time and epoch time. */ + command TimeSnapshot(): TimeSnapshotResponse = 1; + /** Request a variable length payload response. */ + command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3; +} + +/** Commands to trigger a Node to allow a new Administrator to commission it. */ +cluster AdministratorCommissioning = 60 { + revision 1; // NOTE: Default/not specifically set + + enum CommissioningWindowStatusEnum : enum8 { + kWindowNotOpen = 0; + kEnhancedWindowOpen = 1; + kBasicWindowOpen = 2; + } + + enum StatusCode : enum8 { + kBusy = 2; + kPAKEParameterError = 3; + kWindowNotOpen = 4; + } + + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable vendor_id adminVendorId = 2; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct OpenCommissioningWindowRequest { + int16u commissioningTimeout = 0; + octet_string PAKEPasscodeVerifier = 1; + int16u discriminator = 2; + int32u iterations = 3; + octet_string<32> salt = 4; + } + + request struct OpenBasicCommissioningWindowRequest { + int16u commissioningTimeout = 0; + } + + /** This command is used by a current Administrator to instruct a Node to go into commissioning mode using enhanced commissioning method. */ + timed command access(invoke: administer) OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0; + /** This command is used by a current Administrator to instruct a Node to go into commissioning mode using basic commissioning method, if the node supports it. */ + timed command access(invoke: administer) OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1; + /** This command is used by a current Administrator to instruct a Node to revoke any active Open Commissioning Window or Open Basic Commissioning Window command. */ + timed command access(invoke: administer) RevokeCommissioning(): DefaultSuccess = 2; +} + +/** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ +cluster OperationalCredentials = 62 { + revision 1; // NOTE: Default/not specifically set + + enum CertificateChainTypeEnum : enum8 { + kDACCertificate = 1; + kPAICertificate = 2; + } + + enum NodeOperationalCertStatusEnum : enum8 { + kOK = 0; + kInvalidPublicKey = 1; + kInvalidNodeOpId = 2; + kInvalidNOC = 3; + kMissingCsr = 4; + kTableFull = 5; + kInvalidAdminSubject = 6; + kFabricConflict = 9; + kLabelConflict = 10; + kInvalidFabricIndex = 11; + } + + fabric_scoped struct FabricDescriptorStruct { + octet_string<65> rootPublicKey = 1; + vendor_id vendorID = 2; + fabric_id fabricID = 3; + node_id nodeID = 4; + char_string<32> label = 5; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; + readonly attribute FabricDescriptorStruct fabrics[] = 1; + readonly attribute int8u supportedFabrics = 2; + readonly attribute int8u commissionedFabrics = 3; + readonly attribute octet_string trustedRootCertificates[] = 4; + readonly attribute int8u currentFabricIndex = 5; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AttestationRequestRequest { + octet_string<32> attestationNonce = 0; + } + + response struct AttestationResponse = 1 { + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; + } + + request struct CertificateChainRequestRequest { + CertificateChainTypeEnum certificateType = 0; + } + + response struct CertificateChainResponse = 3 { + octet_string<600> certificate = 0; + } + + request struct CSRRequestRequest { + octet_string<32> CSRNonce = 0; + optional boolean isForUpdateNOC = 1; + } + + response struct CSRResponse = 5 { + octet_string NOCSRElements = 0; + octet_string attestationSignature = 1; + } + + request struct AddNOCRequest { + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; + int64u caseAdminSubject = 3; + vendor_id adminVendorId = 4; + } + + request struct UpdateNOCRequest { + octet_string NOCValue = 0; + optional octet_string ICACValue = 1; + } + + response struct NOCResponse = 8 { + NodeOperationalCertStatusEnum statusCode = 0; + optional fabric_idx fabricIndex = 1; + optional char_string<128> debugText = 2; + } + + request struct UpdateFabricLabelRequest { + char_string<32> label = 0; + } + + request struct RemoveFabricRequest { + fabric_idx fabricIndex = 0; + } + + request struct AddTrustedRootCertificateRequest { + octet_string rootCACertificate = 0; + } + + /** Sender is requesting attestation information from the receiver. */ + command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; + /** Sender is requesting a device attestation certificate from the receiver. */ + command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; + /** Sender is requesting a certificate signing request (CSR) from the receiver. */ + command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; + /** Sender is requesting to add the new node operational certificates. */ + command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; + /** Sender is requesting to update the node operational certificates. */ + fabric command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; + /** This command SHALL be used by an Administrative Node to set the user-visible Label field for a given Fabric, as reflected by entries in the Fabrics attribute. */ + fabric command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + /** This command is used by Administrative Nodes to remove a given fabric index and delete all associated fabric-scoped data. */ + command access(invoke: administer) RemoveFabric(RemoveFabricRequest): NOCResponse = 10; + /** This command SHALL add a Trusted Root CA Certificate, provided as its CHIP Certificate representation. */ + command access(invoke: administer) AddTrustedRootCertificate(AddTrustedRootCertificateRequest): DefaultSuccess = 11; +} + +/** The Group Key Management Cluster is the mechanism by which group keys are managed. */ +cluster GroupKeyManagement = 63 { + revision 1; // NOTE: Default/not specifically set + + enum GroupKeySecurityPolicyEnum : enum8 { + kTrustFirst = 0; + kCacheAndSync = 1; + } + + bitmap Feature : bitmap32 { + kCacheAndSync = 0x1; + } + + fabric_scoped struct GroupInfoMapStruct { + group_id groupId = 1; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct GroupKeyMapStruct { + group_id groupId = 1; + int16u groupKeySetID = 2; + fabric_idx fabricIndex = 254; + } + + struct GroupKeySetStruct { + int16u groupKeySetID = 0; + GroupKeySecurityPolicyEnum groupKeySecurityPolicy = 1; + nullable octet_string<16> epochKey0 = 2; + nullable epoch_us epochStartTime0 = 3; + nullable octet_string<16> epochKey1 = 4; + nullable epoch_us epochStartTime1 = 5; + nullable octet_string<16> epochKey2 = 6; + nullable epoch_us epochStartTime2 = 7; + } + + attribute access(write: manage) GroupKeyMapStruct groupKeyMap[] = 0; + readonly attribute GroupInfoMapStruct groupTable[] = 1; + readonly attribute int16u maxGroupsPerFabric = 2; + readonly attribute int16u maxGroupKeysPerFabric = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct KeySetWriteRequest { + GroupKeySetStruct groupKeySet = 0; + } + + request struct KeySetReadRequest { + int16u groupKeySetID = 0; + } + + response struct KeySetReadResponse = 2 { + GroupKeySetStruct groupKeySet = 0; + } + + request struct KeySetRemoveRequest { + int16u groupKeySetID = 0; + } + + response struct KeySetReadAllIndicesResponse = 5 { + int16u groupKeySetIDs[] = 0; + } + + /** Write a new set of keys for the given key set id. */ + fabric command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; + /** Read the keys for a given key set id. */ + fabric command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; + /** Revoke a Root Key from a Group */ + fabric command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; + /** Return the list of Group Key Sets associated with the accessing fabric */ + fabric command access(invoke: administer) KeySetReadAllIndices(): KeySetReadAllIndicesResponse = 4; +} + +/** This cluster provides an interface to a boolean state called StateValue. */ +cluster BooleanState = 69 { + revision 1; + + info event StateChange = 0 { + boolean stateValue = 0; + } + + readonly attribute boolean stateValue = 0; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** This cluster is used to configure a boolean sensor. */ +cluster BooleanStateConfiguration = 128 { + revision 1; + + bitmap AlarmModeBitmap : bitmap8 { + kVisual = 0x1; + kAudible = 0x2; + } + + bitmap Feature : bitmap32 { + kVisual = 0x1; + kAudible = 0x2; + kAlarmSuppress = 0x4; + kSensitivityLevel = 0x8; + } + + bitmap SensorFaultBitmap : bitmap16 { + kGeneralFault = 0x1; + } + + info event AlarmsStateChanged = 0 { + AlarmModeBitmap alarmsActive = 0; + optional AlarmModeBitmap alarmsSuppressed = 1; + } + + info event SensorFault = 1 { + SensorFaultBitmap sensorFault = 0; + } + + attribute optional int8u currentSensitivityLevel = 0; + readonly attribute optional int8u supportedSensitivityLevels = 1; + readonly attribute optional int8u defaultSensitivityLevel = 2; + readonly attribute optional AlarmModeBitmap alarmsActive = 3; + readonly attribute optional AlarmModeBitmap alarmsSuppressed = 4; + readonly attribute optional AlarmModeBitmap alarmsEnabled = 5; + readonly attribute optional AlarmModeBitmap alarmsSupported = 6; + readonly attribute optional SensorFaultBitmap sensorFault = 7; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct SuppressAlarmRequest { + AlarmModeBitmap alarmsToSuppress = 0; + } + + request struct EnableDisableAlarmRequest { + AlarmModeBitmap alarmsToEnableDisable = 0; + } + + /** This command is used to suppress the specified alarm mode. */ + command SuppressAlarm(SuppressAlarmRequest): DefaultSuccess = 0; + /** This command is used to enable or disable the specified alarm mode. */ + command EnableDisableAlarm(EnableDisableAlarmRequest): DefaultSuccess = 1; +} + +endpoint 0 { + device type ma_rootdevice = 22, version 1; + + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + callback attribute featureMap; + callback attribute clusterRevision; + } + + server cluster AccessControl { + emits event AccessControlEntryChanged; + emits event AccessControlExtensionChanged; + callback attribute acl; + callback attribute extension; + callback attribute subjectsPerAccessControlEntry; + callback attribute targetsPerAccessControlEntry; + callback attribute accessControlEntriesPerFabric; + callback attribute attributeList; + ram attribute featureMap default = 0; + callback attribute clusterRevision; + } + + server cluster BasicInformation { + emits event StartUp; + emits event ShutDown; + emits event Leave; + callback attribute dataModelRevision; + callback attribute vendorName; + callback attribute vendorID; + callback attribute productName; + callback attribute productID; + persist attribute nodeLabel; + callback attribute location; + callback attribute hardwareVersion; + callback attribute hardwareVersionString; + callback attribute softwareVersion; + callback attribute softwareVersionString; + callback attribute manufacturingDate; + callback attribute partNumber; + callback attribute productURL; + callback attribute productLabel; + callback attribute serialNumber; + persist attribute localConfigDisabled default = 0; + callback attribute uniqueID; + callback attribute capabilityMinima; + callback attribute specificationVersion; + callback attribute maxPathsPerInvoke; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 2; + } + + server cluster LocalizationConfiguration { + ram attribute activeLocale; + callback attribute supportedLocales; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster GeneralCommissioning { + ram attribute breadcrumb default = 0x0000000000000000; + callback attribute basicCommissioningInfo; + callback attribute regulatoryConfig; + callback attribute locationCapability; + callback attribute supportsConcurrentConnection; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 0x0001; + + handle command ArmFailSafe; + handle command ArmFailSafeResponse; + handle command SetRegulatoryConfig; + handle command SetRegulatoryConfigResponse; + handle command CommissioningComplete; + handle command CommissioningCompleteResponse; + } + + server cluster NetworkCommissioning { + ram attribute maxNetworks; + callback attribute networks; + ram attribute scanMaxTimeSeconds; + ram attribute connectMaxTimeSeconds; + ram attribute interfaceEnabled; + ram attribute lastNetworkingStatus; + ram attribute lastNetworkID; + ram attribute lastConnectErrorValue; + ram attribute featureMap default = 1; + ram attribute clusterRevision default = 0x0001; + + handle command ScanNetworks; + handle command ScanNetworksResponse; + handle command AddOrUpdateWiFiNetwork; + handle command AddOrUpdateThreadNetwork; + handle command RemoveNetwork; + handle command NetworkConfigResponse; + handle command ConnectNetwork; + handle command ConnectNetworkResponse; + handle command ReorderNetwork; + } + + server cluster DiagnosticLogs { + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command RetrieveLogsRequest; + handle command RetrieveLogsResponse; + } + + server cluster GeneralDiagnostics { + emits event BootReason; + callback attribute networkInterfaces; + callback attribute rebootCount; + callback attribute upTime; + callback attribute totalOperationalHours; + callback attribute bootReason; + callback attribute activeHardwareFaults; + callback attribute activeRadioFaults; + callback attribute activeNetworkFaults; + callback attribute testEventTriggersEnabled default = false; + callback attribute featureMap; + callback attribute clusterRevision; + + handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; + } + + server cluster AdministratorCommissioning { + callback attribute windowStatus; + callback attribute adminFabricIndex; + callback attribute adminVendorId; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 0x0001; + + handle command OpenCommissioningWindow; + handle command OpenBasicCommissioningWindow; + handle command RevokeCommissioning; + } + + server cluster OperationalCredentials { + callback attribute NOCs; + callback attribute fabrics; + callback attribute supportedFabrics; + callback attribute commissionedFabrics; + callback attribute trustedRootCertificates; + callback attribute currentFabricIndex; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 0x0001; + + handle command AttestationRequest; + handle command AttestationResponse; + handle command CertificateChainRequest; + handle command CertificateChainResponse; + handle command CSRRequest; + handle command CSRResponse; + handle command AddNOC; + handle command UpdateNOC; + handle command NOCResponse; + handle command UpdateFabricLabel; + handle command RemoveFabric; + handle command AddTrustedRootCertificate; + } + + server cluster GroupKeyManagement { + callback attribute groupKeyMap; + callback attribute groupTable; + callback attribute maxGroupsPerFabric; + callback attribute maxGroupKeysPerFabric; + callback attribute featureMap; + callback attribute clusterRevision; + + handle command KeySetWrite; + handle command KeySetRead; + handle command KeySetReadResponse; + handle command KeySetRemove; + handle command KeySetReadAllIndices; + handle command KeySetReadAllIndicesResponse; + } +} +endpoint 1 { + device type ma_powersource = 17, version 1; + device type ma_water_leak_detector = 67, version 1; + + + server cluster Identify { + ram attribute identifyTime default = 0x0; + ram attribute identifyType default = 0x0; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 2; + + handle command Identify; + handle command TriggerEffect; + } + + server cluster Groups { + ram attribute nameSupport; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 3; + + handle command AddGroup; + handle command AddGroupResponse; + handle command ViewGroup; + handle command ViewGroupResponse; + handle command GetGroupMembership; + handle command GetGroupMembershipResponse; + handle command RemoveGroup; + handle command RemoveGroupResponse; + handle command RemoveAllGroups; + handle command AddGroupIfIdentifying; + } + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap; + callback attribute clusterRevision; + } + + server cluster PowerSource { + ram attribute status default = 1; + ram attribute order default = 1; + ram attribute description default = "Primary Battery"; + ram attribute batVoltage default = 4100; + ram attribute batPercentRemaining default = 95; + ram attribute batTimeRemaining default = 518400; + ram attribute batChargeLevel default = 0; + ram attribute batReplacementNeeded default = 0; + ram attribute batReplaceability default = 1; + ram attribute batPresent default = 1; + ram attribute batCapacity default = 350; + ram attribute batChargeState default = 4; + ram attribute batFunctionalWhileCharging default = 1; + callback attribute endpointList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster BooleanState { + ram attribute stateValue; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster BooleanStateConfiguration { + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } +} + + diff --git a/examples/water-leak-detector-app/water-leak-detector-common/water-leak-detector-app.zap b/examples/water-leak-detector-app/water-leak-detector-common/water-leak-detector-app.zap new file mode 100644 index 0000000000..1dc7adb63a --- /dev/null +++ b/examples/water-leak-detector-app/water-leak-detector-common/water-leak-detector-app.zap @@ -0,0 +1,3214 @@ +{ + "fileFormat": 2, + "featureLevel": 103, + "creator": "zap", + "keyValuePairs": [ + { + "key": "commandDiscovery", + "value": "1" + }, + { + "key": "defaultResponsePolicy", + "value": "always" + }, + { + "key": "manufacturerCodes", + "value": "0x1002" + } + ], + "package": [ + { + "pathRelativity": "relativeToZap", + "path": "../../../src/app/zap-templates/zcl/zcl.json", + "type": "zcl-properties", + "category": "matter", + "version": 1, + "description": "Matter SDK ZCL data" + }, + { + "pathRelativity": "relativeToZap", + "path": "../../../src/app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "category": "matter", + "version": "chip-v1" + } + ], + "endpointTypes": [ + { + "id": 1, + "name": "MA-rootdevice", + "deviceTypeRef": { + "code": 22, + "profileId": 259, + "label": "MA-rootdevice", + "name": "MA-rootdevice" + }, + "deviceTypes": [ + { + "code": 22, + "profileId": 259, + "label": "MA-rootdevice", + "name": "MA-rootdevice" + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 22 + ], + "deviceTypeName": "MA-rootdevice", + "deviceTypeCode": 22, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Access Control", + "code": 31, + "mfgCode": null, + "define": "ACCESS_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "ACL", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Extension", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SubjectsPerAccessControlEntry", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TargetsPerAccessControlEntry", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AccessControlEntriesPerFabric", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "AccessControlEntryChanged", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "AccessControlExtensionChanged", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Basic Information", + "code": 40, + "mfgCode": null, + "define": "BASIC_INFORMATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DataModelRevision", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorName", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorID", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "vendor_id", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductName", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductID", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NodeLabel", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Location", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersion", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersionString", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersion", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersionString", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ManufacturingDate", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartNumber", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductURL", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "long_char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductLabel", + "code": 14, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SerialNumber", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LocalConfigDisabled", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UniqueID", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CapabilityMinima", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "CapabilityMinimaStruct", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SpecificationVersion", + "code": 21, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxPathsPerInvoke", + "code": 22, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "StartUp", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "ShutDown", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "Leave", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Localization Configuration", + "code": 43, + "mfgCode": null, + "define": "LOCALIZATION_CONFIGURATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "ActiveLocale", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportedLocales", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "General Commissioning", + "code": 48, + "mfgCode": null, + "define": "GENERAL_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ArmFailSafe", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ArmFailSafeResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "SetRegulatoryConfig", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "SetRegulatoryConfigResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "CommissioningComplete", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CommissioningCompleteResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "Breadcrumb", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BasicCommissioningInfo", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "BasicCommissioningInfo", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RegulatoryConfig", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LocationCapability", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportsConcurrentConnection", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Network Commissioning", + "code": 49, + "mfgCode": null, + "define": "NETWORK_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ScanNetworks", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ScanNetworksResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "AddOrUpdateWiFiNetwork", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "AddOrUpdateThreadNetwork", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RemoveNetwork", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "NetworkConfigResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ConnectNetwork", + "code": 6, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ConnectNetworkResponse", + "code": 7, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ReorderNetwork", + "code": 8, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "MaxNetworks", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Networks", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ScanMaxTimeSeconds", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ConnectMaxTimeSeconds", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "InterfaceEnabled", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkingStatus", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "NetworkCommissioningStatusEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkID", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastConnectErrorValue", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int32s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Diagnostic Logs", + "code": 50, + "mfgCode": null, + "define": "DIAGNOSTIC_LOGS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "RetrieveLogsRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RetrieveLogsResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "General Diagnostics", + "code": 51, + "mfgCode": null, + "define": "GENERAL_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "TestEventTrigger", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "NetworkInterfaces", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RebootCount", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TotalOperationalHours", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BootReason", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "BootReasonEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveHardwareFaults", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveRadioFaults", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveNetworkFaults", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TestEventTriggersEnabled", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "false", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "BootReason", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Administrator Commissioning", + "code": 60, + "mfgCode": null, + "define": "ADMINISTRATOR_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "OpenCommissioningWindow", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "OpenBasicCommissioningWindow", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RevokeCommissioning", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "WindowStatus", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "CommissioningWindowStatusEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AdminFabricIndex", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "fabric_idx", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AdminVendorId", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "vendor_id", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Operational Credentials", + "code": 62, + "mfgCode": null, + "define": "OPERATIONAL_CREDENTIALS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "AttestationRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "AttestationResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "CertificateChainRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CertificateChainResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "CSRRequest", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CSRResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "AddNOC", + "code": 6, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "UpdateNOC", + "code": 7, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "NOCResponse", + "code": 8, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "UpdateFabricLabel", + "code": 9, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RemoveFabric", + "code": 10, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "AddTrustedRootCertificate", + "code": 11, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "NOCs", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Fabrics", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SupportedFabrics", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CommissionedFabrics", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TrustedRootCertificates", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentFabricIndex", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Group Key Management", + "code": 63, + "mfgCode": null, + "define": "GROUP_KEY_MANAGEMENT_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "KeySetWrite", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetRead", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetReadResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "KeySetRemove", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetReadAllIndices", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetReadAllIndicesResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "GroupKeyMap", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GroupTable", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxGroupsPerFabric", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxGroupKeysPerFabric", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + }, + { + "id": 2, + "name": "Anonymous Endpoint Type", + "deviceTypeRef": { + "code": 67, + "profileId": 259, + "label": "MA-water-leak-detector", + "name": "MA-water-leak-detector" + }, + "deviceTypes": [ + { + "code": 67, + "profileId": 259, + "label": "MA-water-leak-detector", + "name": "MA-water-leak-detector" + }, + { + "code": 17, + "profileId": 259, + "label": "MA-powersource", + "name": "MA-powersource" + } + ], + "deviceVersions": [ + 1, + 1 + ], + "deviceIdentifiers": [ + 67, + 17 + ], + "deviceTypeName": "MA-water-leak-detector", + "deviceTypeCode": 67, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "Identify", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TriggerEffect", + "code": 64, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "IdentifyTime", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "IdentifyType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "IdentifyTypeEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Groups", + "code": 4, + "mfgCode": null, + "define": "GROUPS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "AddGroup", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "AddGroupResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ViewGroup", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ViewGroupResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "GetGroupMembership", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "GetGroupMembershipResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "RemoveGroup", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RemoveGroupResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "RemoveAllGroups", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "AddGroupIfIdentifying", + "code": 5, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "NameSupport", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "NameSupportBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Power Source", + "code": 47, + "mfgCode": null, + "define": "POWER_SOURCE_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "Status", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "PowerSourceStatusEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Order", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Description", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "Primary Battery", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BatVoltage", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4100", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BatPercentRemaining", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "95", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BatTimeRemaining", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "518400", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BatChargeLevel", + "code": 14, + "mfgCode": null, + "side": "server", + "type": "BatChargeLevelEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BatReplacementNeeded", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BatReplaceability", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "BatReplaceabilityEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BatPresent", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BatCapacity", + "code": 24, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "350", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BatChargeState", + "code": 26, + "mfgCode": null, + "side": "server", + "type": "BatChargeStateEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BatFunctionalWhileCharging", + "code": 28, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EndpointList", + "code": 31, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Boolean State", + "code": 69, + "mfgCode": null, + "define": "BOOLEAN_STATE_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "StateValue", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Boolean State Configuration", + "code": 128, + "mfgCode": null, + "define": "BOOLEAN_STATE_CONFIGURATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + } + ], + "endpoints": [ + { + "endpointTypeName": "MA-rootdevice", + "endpointTypeIndex": 0, + "profileId": 259, + "endpointId": 0, + "networkId": 0, + "parentEndpointIdentifier": null + }, + { + "endpointTypeName": "Anonymous Endpoint Type", + "endpointTypeIndex": 1, + "profileId": 259, + "endpointId": 1, + "networkId": 0, + "parentEndpointIdentifier": 0 + } + ] +} diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index 8d1b30234c..0539af8bf6 100755 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -146,6 +146,7 @@ def BuildHostTarget(): TargetPart('air-quality-sensor', app=HostApp.AIR_QUALITY_SENSOR), TargetPart('network-manager', app=HostApp.NETWORK_MANAGER), TargetPart('energy-management', app=HostApp.ENERGY_MANAGEMENT), + TargetPart('water-leak-detector', app=HostApp.WATER_LEAK_DETECTOR), ] if (HostBoard.NATIVE.PlatformName() == 'darwin'): diff --git a/scripts/build/builders/host.py b/scripts/build/builders/host.py index 624bd9ad74..a07064795a 100644 --- a/scripts/build/builders/host.py +++ b/scripts/build/builders/host.py @@ -84,6 +84,7 @@ class HostApp(Enum): AIR_QUALITY_SENSOR = auto() NETWORK_MANAGER = auto() ENERGY_MANAGEMENT = auto() + WATER_LEAK_DETECTOR = auto() def ExamplePath(self): if self == HostApp.ALL_CLUSTERS: @@ -154,6 +155,8 @@ def ExamplePath(self): return 'network-manager-app/linux' elif self == HostApp.ENERGY_MANAGEMENT: return 'energy-management-app/linux' + elif self == HostApp.WATER_LEAK_DETECTOR: + return 'water-leak-detector/linux' else: raise Exception('Unknown app type: %r' % self) @@ -266,6 +269,9 @@ def OutputNames(self): elif self == HostApp.ENERGY_MANAGEMENT: yield 'chip-energy-management-app' yield 'chip-energy-management-app.map' + elif self == HostApp.WATER_LEAK_DETECTOR: + yield 'water-leak-detector-app' + yield 'water-leak-detector-app.map' else: raise Exception('Unknown app type: %r' % self) diff --git a/scripts/build/testdata/all_targets_linux_x64.txt b/scripts/build/testdata/all_targets_linux_x64.txt index 93e375c857..51d507072b 100644 --- a/scripts/build/testdata/all_targets_linux_x64.txt +++ b/scripts/build/testdata/all_targets_linux_x64.txt @@ -9,7 +9,7 @@ efr32-{brd2704b,brd4316a,brd4317a,brd4318a,brd4319a,brd4186a,brd4187a,brd2601b,b esp32-{m5stack,c3devkit,devkitc,qemu}-{all-clusters,all-clusters-minimal,energy-management,ota-provider,ota-requestor,shell,light,lock,bridge,temperature-measurement,ota-requestor,tests}[-rpc][-ipv6only][-tracing][-data-model-disabled][-data-model-enabled] genio-lighting-app linux-fake-tests[-mbedtls][-boringssl][-asan][-tsan][-ubsan][-libfuzzer][-ossfuzz][-pw-fuzztest][-coverage][-dmalloc][-clang] -linux-{x64,arm64}-{rpc-console,all-clusters,all-clusters-minimal,chip-tool,thermostat,java-matter-controller,kotlin-matter-controller,minmdns,light,light-data-model-no-unique-id,lock,shell,ota-provider,ota-requestor,simulated-app1,simulated-app2,python-bindings,tv-app,tv-casting-app,bridge,fabric-admin,fabric-bridge,tests,chip-cert,address-resolve-tool,contact-sensor,dishwasher,microwave-oven,refrigerator,rvc,air-purifier,lit-icd,air-quality-sensor,network-manager,energy-management}[-nodeps][-nlfaultinject][-platform-mdns][-minmdns-verbose][-libnl][-same-event-loop][-no-interactive][-ipv6only][-no-ble][-no-wifi][-no-thread][-no-shell][-mbedtls][-boringssl][-asan][-tsan][-ubsan][-libfuzzer][-ossfuzz][-pw-fuzztest][-coverage][-dmalloc][-clang][-test][-rpc][-with-ui][-evse-test-event][-enable-dnssd-tests][-disable-dnssd-tests][-chip-casting-simplified][-data-model-check][-data-model-disabled][-data-model-enabled][-check-failure-die] +linux-{x64,arm64}-{rpc-console,all-clusters,all-clusters-minimal,chip-tool,thermostat,java-matter-controller,kotlin-matter-controller,minmdns,light,light-data-model-no-unique-id,lock,shell,ota-provider,ota-requestor,simulated-app1,simulated-app2,python-bindings,tv-app,tv-casting-app,bridge,fabric-admin,fabric-bridge,tests,chip-cert,address-resolve-tool,contact-sensor,dishwasher,microwave-oven,refrigerator,rvc,air-purifier,lit-icd,air-quality-sensor,network-manager,energy-management,water-leak-detector}[-nodeps][-nlfaultinject][-platform-mdns][-minmdns-verbose][-libnl][-same-event-loop][-no-interactive][-ipv6only][-no-ble][-no-wifi][-no-thread][-no-shell][-mbedtls][-boringssl][-asan][-tsan][-ubsan][-libfuzzer][-ossfuzz][-pw-fuzztest][-coverage][-dmalloc][-clang][-test][-rpc][-with-ui][-evse-test-event][-enable-dnssd-tests][-disable-dnssd-tests][-chip-casting-simplified][-data-model-check][-data-model-disabled][-data-model-enabled][-check-failure-die] linux-x64-efr32-test-runner[-clang] imx-{chip-tool,lighting-app,thermostat,all-clusters-app,all-clusters-minimal-app,ota-provider-app}[-release] infineon-psoc6-{lock,light,all-clusters,all-clusters-minimal}[-ota][-updateimage][-trustm] From 1c2ad2e3ae5276a0b5aeb6239dad27ff64a67544 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Mon, 7 Oct 2024 17:47:18 +0200 Subject: [PATCH 017/127] =?UTF-8?q?[HotFix]=20Missing=20declaration=20in?= =?UTF-8?q?=20provisional=20water-leak-detector-app.m=E2=80=A6=20(#35938)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../water-leak-detector-common/water-leak-detector-app.matter | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/water-leak-detector-app/water-leak-detector-common/water-leak-detector-app.matter b/examples/water-leak-detector-app/water-leak-detector-common/water-leak-detector-app.matter index b01d083abb..f2cc365f2b 100644 --- a/examples/water-leak-detector-app/water-leak-detector-common/water-leak-detector-app.matter +++ b/examples/water-leak-detector-app/water-leak-detector-common/water-leak-detector-app.matter @@ -938,6 +938,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; From 4ec17169be31148cfbbe5b88c3915de3eb2c7809 Mon Sep 17 00:00:00 2001 From: andyg-apple <113489604+andyg-apple@users.noreply.github.com> Date: Tue, 8 Oct 2024 07:39:14 +1300 Subject: [PATCH 018/127] WebRTC requestor cluster (#35910) * Added WebRTC Requestor cluster xml file and associated references * Generated using ./scripts/tools/zap_regen_all.py * Fixed command descriptions. * (re)Generated using ./scripts/tools/zap_regen_all.py * (re)Generated using ./scripts/tools/zap_regen_all.py --- .github/workflows/tests.yaml | 1 + docs/zap_clusters.md | 1 + scripts/rules.matterlint | 1 + .../chip/webrtc-requestor-cluster.xml | 62 ++ .../zcl/zcl-with-test-extensions.json | 1 + src/app/zap-templates/zcl/zcl.json | 1 + src/app/zap_cluster_list.json | 2 + .../data_model/controller-clusters.matter | 87 ++ .../chip/devicecontroller/ChipClusters.java | 328 ++++++ .../chip/devicecontroller/ChipStructs.java | 227 ++++ .../devicecontroller/ClusterIDMapping.java | 176 ++++ .../devicecontroller/ClusterInfoMapping.java | 210 ++++ .../devicecontroller/ClusterReadMapping.java | 82 ++ .../devicecontroller/ClusterWriteMapping.java | 2 + .../chip/devicecontroller/cluster/files.gni | 2 + ...ransportRequestorClusterICEServerStruct.kt | 106 ++ ...portRequestorClusterWebRTCSessionStruct.kt | 115 +++ .../WebRTCTransportRequestorCluster.kt | 873 ++++++++++++++++ .../java/matter/controller/cluster/files.gni | 3 + ...ransportRequestorClusterICEServerStruct.kt | 106 ++ ...portRequestorClusterWebRTCSessionStruct.kt | 115 +++ .../CHIPAttributeTLVValueDecoder.cpp | 250 +++++ .../CHIPEventTLVValueDecoder.cpp | 10 + .../python/chip/clusters/CHIPClusters.py | 86 ++ .../python/chip/clusters/Objects.py | 293 ++++++ .../MTRAttributeSpecifiedCheck.mm | 33 + .../MTRAttributeTLVValueDecoder.mm | 56 + .../CHIP/zap-generated/MTRBaseClusters.h | 118 +++ .../CHIP/zap-generated/MTRBaseClusters.mm | 353 +++++++ .../CHIP/zap-generated/MTRClusterConstants.h | 16 + .../CHIP/zap-generated/MTRClusterNames.mm | 88 ++ .../CHIP/zap-generated/MTRClusters.h | 43 + .../CHIP/zap-generated/MTRClusters.mm | 147 +++ .../zap-generated/MTRCommandPayloadsObjc.h | 132 +++ .../zap-generated/MTRCommandPayloadsObjc.mm | 412 ++++++++ .../MTRCommandPayloads_Internal.h | 24 + .../zap-generated/MTRCommandTimedCheck.mm | 12 + .../zap-generated/MTREventTLVValueDecoder.mm | 15 + .../CHIP/zap-generated/MTRStructsObjc.h | 19 + .../CHIP/zap-generated/MTRStructsObjc.mm | 81 ++ .../zap-generated/attributes/Accessors.cpp | 100 ++ .../zap-generated/attributes/Accessors.h | 18 + .../app-common/zap-generated/callback.h | 67 ++ .../app-common/zap-generated/cluster-enums.h | 9 + .../zap-generated/cluster-objects.cpp | 207 ++++ .../zap-generated/cluster-objects.h | 253 +++++ .../app-common/zap-generated/ids/Attributes.h | 34 + .../app-common/zap-generated/ids/Clusters.h | 3 + .../app-common/zap-generated/ids/Commands.h | 22 + .../zap-generated/cluster/Commands.h | 242 +++++ .../cluster/logging/DataModelLogger.cpp | 43 + .../cluster/logging/EntryToText.cpp | 38 + .../zap-generated/cluster/Commands.h | 968 ++++++++++++++++++ 53 files changed, 6693 insertions(+) create mode 100644 src/app/zap-templates/zcl/data-model/chip/webrtc-requestor-cluster.xml create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/WebRTCTransportRequestorClusterICEServerStruct.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/WebRTCTransportRequestorClusterWebRTCSessionStruct.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/clusters/WebRTCTransportRequestorCluster.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/structs/WebRTCTransportRequestorClusterICEServerStruct.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/structs/WebRTCTransportRequestorClusterWebRTCSessionStruct.kt diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 04aa91020a..c96c4ea023 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -199,6 +199,7 @@ jobs: src/app/zap-templates/zcl/data-model/chip/wake-on-lan-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/washer-controls-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/water-heater-management-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/webrtc-requestor-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/webrtc-provider-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/wifi-network-diagnostics-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/wifi-network-management-cluster.xml \ diff --git a/docs/zap_clusters.md b/docs/zap_clusters.md index 1250a60b71..5803545d3e 100644 --- a/docs/zap_clusters.md +++ b/docs/zap_clusters.md @@ -130,6 +130,7 @@ Generally regenerate using one of: | 1295 | 0x50F | ContentControl | | 1296 | 0x510 | ContentAppObserver | | 1363 | 0x553 | WebRTCTransportProvider | +| 1364 | 0x554 | WebRTCTransportRequestor | | 1366 | 0x556 | Chime | | 1872 | 0x750 | EcosystemInformation | | 1873 | 0x751 | CommissionerControl | diff --git a/scripts/rules.matterlint b/scripts/rules.matterlint index 1573cc7065..b7ce7ef975 100644 --- a/scripts/rules.matterlint +++ b/scripts/rules.matterlint @@ -108,6 +108,7 @@ load "../src/app/zap-templates/zcl/data-model/chip/wake-on-lan-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/washer-controls-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/water-heater-management-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/water-heater-mode-cluster.xml"; +load "../src/app/zap-templates/zcl/data-model/chip/webrtc-requestor-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/webrtc-provider-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/wifi-network-diagnostics-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/wifi-network-management-cluster.xml"; diff --git a/src/app/zap-templates/zcl/data-model/chip/webrtc-requestor-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/webrtc-requestor-cluster.xml new file mode 100644 index 0000000000..557ebf8e7b --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/chip/webrtc-requestor-cluster.xml @@ -0,0 +1,62 @@ + + + + + + + Cameras + WebRTC Transport Requestor + 0x0554 + WEBRTC_TRANSPORT_REQUESTOR_CLUSTER + The WebRTC transport requestor cluster provides a way for stream consumers (e.g. Matter Stream Viewer) to establish a WebRTC connection with a stream provider. + true + true + + CurrentSessions + + This command provides the stream requestor with WebRTC session details. It is sent following the receipt of a SolicitOffer command or a re-Offer initiated by the Provider. + + + + + + + + This command provides the stream requestor with the WebRTC session details (i.e. Session ID and SDP answer). It is the next command in the Offer/Answer flow to the ProvideOffer command. + + + + + + This command provides an ICE candidate to the stream requestor in a WebRTC session. + + + + + + This command notifies the stream requestor that the provider has ended the WebRTC session. + + + + + + diff --git a/src/app/zap-templates/zcl/zcl-with-test-extensions.json b/src/app/zap-templates/zcl/zcl-with-test-extensions.json index e4c9a18e6c..61d46b6453 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -132,6 +132,7 @@ "water-heater-management-cluster.xml", "water-heater-mode-cluster.xml", "webrtc-provider-cluster.xml", + "webrtc-requestor-cluster.xml", "wifi-network-diagnostics-cluster.xml", "wifi-network-management-cluster.xml", "window-covering.xml", diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index b306dba223..f4e04ef1f2 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -126,6 +126,7 @@ "water-heater-management-cluster.xml", "water-heater-mode-cluster.xml", "webrtc-provider-cluster.xml", + "webrtc-requestor-cluster.xml", "wifi-network-diagnostics-cluster.xml", "wifi-network-management-cluster.xml", "window-covering.xml", diff --git a/src/app/zap_cluster_list.json b/src/app/zap_cluster_list.json index c240008e1c..aab95321af 100644 --- a/src/app/zap_cluster_list.json +++ b/src/app/zap_cluster_list.json @@ -132,6 +132,7 @@ "WATER_HEATER_MANAGEMENT_CLUSTER": [], "WATER_HEATER_MODE_CLUSTER": [], "WEB_RTC_PROVIDER_CLUSTER": [], + "WEBRTC_REQUESTOR_CLUSTER": [], "WIFI_NETWORK_DIAGNOSTICS_CLUSTER": [], "WINDOW_COVERING_CLUSTER": [] }, @@ -312,6 +313,7 @@ "LAUNDRY_WASHER_CONTROLS_CLUSTER": ["laundry-washer-controls-server"], "LAUNDRY_DRYER_CONTROLS_CLUSTER": ["laundry-dryer-controls-server"], "WEB_RTC_PROVIDER_CLUSTER": [], + "WEBRTC_REQUESTOR_CLUSTER": [], "WIFI_NETWORK_DIAGNOSTICS_CLUSTER": ["wifi-network-diagnostics-server"], "WIFI_NETWORK_MANAGEMENT_CLUSTER": ["wifi-network-management-server"], "WINDOW_COVERING_CLUSTER": ["window-covering-server"], diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 78c5a89323..07b98b1795 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -9531,6 +9531,93 @@ provisional cluster WebRTCTransportProvider = 1363 { command EndSession(EndSessionRequest): DefaultSuccess = 7; } +/** The WebRTC transport requestor cluster provides a way for stream consumers (e.g. Matter Stream Viewer) to establish a WebRTC connection with a stream provider. */ +cluster WebRTCTransportRequestor = 1364 { + revision 1; + + enum StreamTypeEnum : enum8 { + kInternal = 0; + kRecording = 1; + kAnalysis = 2; + kLiveView = 3; + } + + enum WebRTCEndReasonEnum : enum8 { + kIceFailed = 0; + kIceTimeout = 1; + kUserHangup = 2; + kUserBusy = 3; + kReplaced = 4; + kNoUserMedia = 5; + kInviteTimeout = 6; + kAnsweredElsewhere = 7; + kOutOfResources = 8; + kMediaTimeout = 9; + kLowPower = 10; + kUnknownReason = 11; + } + + bitmap WebRTCMetadataOptions : bitmap8 { + kDataTLV = 0x1; + } + + struct ICEServerStruct { + char_string urls[] = 1; + optional char_string username = 2; + optional char_string credential = 3; + optional int16u caid = 4; + } + + struct WebRTCSessionStruct { + int16u id = 1; + node_id peerNodeID = 2; + fabric_idx peerFabricIndex = 3; + StreamTypeEnum streamType = 4; + nullable int16u videoStreamID = 5; + nullable int16u audioStreamID = 6; + WebRTCMetadataOptions metadataOptions = 7; + } + + readonly attribute WebRTCSessionStruct currentSessions[] = 0; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct OfferRequest { + int16u webRTCSessionID = 0; + char_string sdp = 1; + optional ICEServerStruct ICEServers[] = 2; + optional char_string ICETransportPolicy = 3; + } + + request struct AnswerRequest { + int16u webRTCSessionID = 0; + char_string sdp = 1; + } + + request struct ICECandidateRequest { + int16u webRTCSessionID = 0; + char_string ICECandidate = 1; + } + + request struct EndRequest { + int16u webRTCSessionID = 0; + WebRTCEndReasonEnum reason = 1; + } + + /** This command provides the stream requestor with WebRTC session details. It is sent following the receipt of a SolicitOffer command or a re-Offer initiated by the Provider. */ + command Offer(OfferRequest): DefaultSuccess = 1; + /** This command provides the stream requestor with the WebRTC session details (i.e. Session ID and SDP answer). It is the next command in the Offer/Answer flow to the ProvideOffer command. */ + command Answer(AnswerRequest): DefaultSuccess = 2; + /** This command provides an ICE candidate to the stream requestor in a WebRTC session. */ + command ICECandidate(ICECandidateRequest): DefaultSuccess = 3; + /** This command notifies the stream requestor that the provider has ended the WebRTC session. */ + command End(EndRequest): DefaultSuccess = 4; +} + /** This cluster provides facilities to configure and play Chime sounds, such as those used in a doorbell. */ provisional cluster Chime = 1366 { revision 1; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java index 3a92667fb6..4104a75abb 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java @@ -59965,6 +59965,334 @@ public void onSuccess(byte[] tlv) { } } + public static class WebRTCTransportRequestorCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 1364L; + + private static final long CURRENT_SESSIONS_ATTRIBUTE_ID = 0L; + private static final long GENERATED_COMMAND_LIST_ATTRIBUTE_ID = 65528L; + private static final long ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID = 65529L; + private static final long EVENT_LIST_ATTRIBUTE_ID = 65530L; + private static final long ATTRIBUTE_LIST_ATTRIBUTE_ID = 65531L; + private static final long FEATURE_MAP_ATTRIBUTE_ID = 65532L; + private static final long CLUSTER_REVISION_ATTRIBUTE_ID = 65533L; + + public WebRTCTransportRequestorCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId, CLUSTER_ID); + } + + @Override + @Deprecated + public long initWithDevice(long devicePtr, int endpointId) { + return 0L; + } + + public void offer(DefaultClusterCallback callback, Integer webRTCSessionID, String sdp, Optional> ICEServers, Optional ICETransportPolicy) { + offer(callback, webRTCSessionID, sdp, ICEServers, ICETransportPolicy, 0); + } + + public void offer(DefaultClusterCallback callback, Integer webRTCSessionID, String sdp, Optional> ICEServers, Optional ICETransportPolicy, int timedInvokeTimeoutMs) { + final long commandId = 1L; + + ArrayList elements = new ArrayList<>(); + final long webRTCSessionIDFieldID = 0L; + BaseTLVType webRTCSessionIDtlvValue = new UIntType(webRTCSessionID); + elements.add(new StructElement(webRTCSessionIDFieldID, webRTCSessionIDtlvValue)); + + final long sdpFieldID = 1L; + BaseTLVType sdptlvValue = new StringType(sdp); + elements.add(new StructElement(sdpFieldID, sdptlvValue)); + + final long ICEServersFieldID = 2L; + BaseTLVType ICEServerstlvValue = ICEServers.map((nonOptionalICEServers) -> ArrayType.generateArrayType(nonOptionalICEServers, (elementnonOptionalICEServers) -> elementnonOptionalICEServers.encodeTlv())).orElse(new EmptyType()); + elements.add(new StructElement(ICEServersFieldID, ICEServerstlvValue)); + + final long ICETransportPolicyFieldID = 3L; + BaseTLVType ICETransportPolicytlvValue = ICETransportPolicy.map((nonOptionalICETransportPolicy) -> new StringType(nonOptionalICETransportPolicy)).orElse(new EmptyType()); + elements.add(new StructElement(ICETransportPolicyFieldID, ICETransportPolicytlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void answer(DefaultClusterCallback callback, Integer webRTCSessionID, String sdp) { + answer(callback, webRTCSessionID, sdp, 0); + } + + public void answer(DefaultClusterCallback callback, Integer webRTCSessionID, String sdp, int timedInvokeTimeoutMs) { + final long commandId = 2L; + + ArrayList elements = new ArrayList<>(); + final long webRTCSessionIDFieldID = 0L; + BaseTLVType webRTCSessionIDtlvValue = new UIntType(webRTCSessionID); + elements.add(new StructElement(webRTCSessionIDFieldID, webRTCSessionIDtlvValue)); + + final long sdpFieldID = 1L; + BaseTLVType sdptlvValue = new StringType(sdp); + elements.add(new StructElement(sdpFieldID, sdptlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void ICECandidate(DefaultClusterCallback callback, Integer webRTCSessionID, String ICECandidate) { + ICECandidate(callback, webRTCSessionID, ICECandidate, 0); + } + + public void ICECandidate(DefaultClusterCallback callback, Integer webRTCSessionID, String ICECandidate, int timedInvokeTimeoutMs) { + final long commandId = 3L; + + ArrayList elements = new ArrayList<>(); + final long webRTCSessionIDFieldID = 0L; + BaseTLVType webRTCSessionIDtlvValue = new UIntType(webRTCSessionID); + elements.add(new StructElement(webRTCSessionIDFieldID, webRTCSessionIDtlvValue)); + + final long ICECandidateFieldID = 1L; + BaseTLVType ICECandidatetlvValue = new StringType(ICECandidate); + elements.add(new StructElement(ICECandidateFieldID, ICECandidatetlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void end(DefaultClusterCallback callback, Integer webRTCSessionID, Integer reason) { + end(callback, webRTCSessionID, reason, 0); + } + + public void end(DefaultClusterCallback callback, Integer webRTCSessionID, Integer reason, int timedInvokeTimeoutMs) { + final long commandId = 4L; + + ArrayList elements = new ArrayList<>(); + final long webRTCSessionIDFieldID = 0L; + BaseTLVType webRTCSessionIDtlvValue = new UIntType(webRTCSessionID); + elements.add(new StructElement(webRTCSessionIDFieldID, webRTCSessionIDtlvValue)); + + final long reasonFieldID = 1L; + BaseTLVType reasontlvValue = new UIntType(reason); + elements.add(new StructElement(reasonFieldID, reasontlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public interface CurrentSessionsAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface AcceptedCommandListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface EventListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface AttributeListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public void readCurrentSessionsAttribute( + CurrentSessionsAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_SESSIONS_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CURRENT_SESSIONS_ATTRIBUTE_ID, true); + } + + public void subscribeCurrentSessionsAttribute( + CurrentSessionsAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_SESSIONS_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CURRENT_SESSIONS_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readEventListAttribute( + EventListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, EVENT_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, EVENT_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeEventListAttribute( + EventListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, EVENT_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, EVENT_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readAttributeListAttribute( + AttributeListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ATTRIBUTE_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ATTRIBUTE_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeAttributeListAttribute( + AttributeListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ATTRIBUTE_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ATTRIBUTE_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readFeatureMapAttribute( + LongAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FEATURE_MAP_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, FEATURE_MAP_ATTRIBUTE_ID, true); + } + + public void subscribeFeatureMapAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FEATURE_MAP_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, FEATURE_MAP_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readClusterRevisionAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CLUSTER_REVISION_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CLUSTER_REVISION_ATTRIBUTE_ID, true); + } + + public void subscribeClusterRevisionAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CLUSTER_REVISION_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CLUSTER_REVISION_ATTRIBUTE_ID, minInterval, maxInterval); + } + } + public static class ChimeCluster extends BaseChipCluster { public static final long CLUSTER_ID = 1366L; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java index 4c04d0ec0e..88684160d1 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java @@ -12951,6 +12951,233 @@ public String toString() { return output.toString(); } } +public static class WebRTCTransportRequestorClusterICEServerStruct { + public ArrayList urls; + public Optional username; + public Optional credential; + public Optional caid; + private static final long URLS_ID = 1L; + private static final long USERNAME_ID = 2L; + private static final long CREDENTIAL_ID = 3L; + private static final long CAID_ID = 4L; + + public WebRTCTransportRequestorClusterICEServerStruct( + ArrayList urls, + Optional username, + Optional credential, + Optional caid + ) { + this.urls = urls; + this.username = username; + this.credential = credential; + this.caid = caid; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(URLS_ID, ArrayType.generateArrayType(urls, (elementurls) -> new StringType(elementurls)))); + values.add(new StructElement(USERNAME_ID, username.map((nonOptionalusername) -> new StringType(nonOptionalusername)).orElse(new EmptyType()))); + values.add(new StructElement(CREDENTIAL_ID, credential.map((nonOptionalcredential) -> new StringType(nonOptionalcredential)).orElse(new EmptyType()))); + values.add(new StructElement(CAID_ID, caid.map((nonOptionalcaid) -> new UIntType(nonOptionalcaid)).orElse(new EmptyType()))); + + return new StructType(values); + } + + public static WebRTCTransportRequestorClusterICEServerStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + ArrayList urls = null; + Optional username = Optional.empty(); + Optional credential = Optional.empty(); + Optional caid = Optional.empty(); + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == URLS_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Array) { + ArrayType castingValue = element.value(ArrayType.class); + urls = castingValue.map((elementcastingValue) -> elementcastingValue.value(String.class)); + } + } else if (element.contextTagNum() == USERNAME_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + username = Optional.of(castingValue.value(String.class)); + } + } else if (element.contextTagNum() == CREDENTIAL_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + credential = Optional.of(castingValue.value(String.class)); + } + } else if (element.contextTagNum() == CAID_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + caid = Optional.of(castingValue.value(Integer.class)); + } + } + } + return new WebRTCTransportRequestorClusterICEServerStruct( + urls, + username, + credential, + caid + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("WebRTCTransportRequestorClusterICEServerStruct {\n"); + output.append("\turls: "); + output.append(urls); + output.append("\n"); + output.append("\tusername: "); + output.append(username); + output.append("\n"); + output.append("\tcredential: "); + output.append(credential); + output.append("\n"); + output.append("\tcaid: "); + output.append(caid); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class WebRTCTransportRequestorClusterWebRTCSessionStruct { + public Integer id; + public Long peerNodeID; + public Integer peerFabricIndex; + public Integer streamType; + public @Nullable Integer videoStreamID; + public @Nullable Integer audioStreamID; + public Integer metadataOptions; + private static final long ID_ID = 1L; + private static final long PEER_NODE_ID_ID = 2L; + private static final long PEER_FABRIC_INDEX_ID = 3L; + private static final long STREAM_TYPE_ID = 4L; + private static final long VIDEO_STREAM_ID_ID = 5L; + private static final long AUDIO_STREAM_ID_ID = 6L; + private static final long METADATA_OPTIONS_ID = 7L; + + public WebRTCTransportRequestorClusterWebRTCSessionStruct( + Integer id, + Long peerNodeID, + Integer peerFabricIndex, + Integer streamType, + @Nullable Integer videoStreamID, + @Nullable Integer audioStreamID, + Integer metadataOptions + ) { + this.id = id; + this.peerNodeID = peerNodeID; + this.peerFabricIndex = peerFabricIndex; + this.streamType = streamType; + this.videoStreamID = videoStreamID; + this.audioStreamID = audioStreamID; + this.metadataOptions = metadataOptions; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(ID_ID, new UIntType(id))); + values.add(new StructElement(PEER_NODE_ID_ID, new UIntType(peerNodeID))); + values.add(new StructElement(PEER_FABRIC_INDEX_ID, new UIntType(peerFabricIndex))); + values.add(new StructElement(STREAM_TYPE_ID, new UIntType(streamType))); + values.add(new StructElement(VIDEO_STREAM_ID_ID, videoStreamID != null ? new UIntType(videoStreamID) : new NullType())); + values.add(new StructElement(AUDIO_STREAM_ID_ID, audioStreamID != null ? new UIntType(audioStreamID) : new NullType())); + values.add(new StructElement(METADATA_OPTIONS_ID, new UIntType(metadataOptions))); + + return new StructType(values); + } + + public static WebRTCTransportRequestorClusterWebRTCSessionStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer id = null; + Long peerNodeID = null; + Integer peerFabricIndex = null; + Integer streamType = null; + @Nullable Integer videoStreamID = null; + @Nullable Integer audioStreamID = null; + Integer metadataOptions = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == ID_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + id = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == PEER_NODE_ID_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + peerNodeID = castingValue.value(Long.class); + } + } else if (element.contextTagNum() == PEER_FABRIC_INDEX_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + peerFabricIndex = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == STREAM_TYPE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + streamType = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == VIDEO_STREAM_ID_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + videoStreamID = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == AUDIO_STREAM_ID_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + audioStreamID = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == METADATA_OPTIONS_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + metadataOptions = castingValue.value(Integer.class); + } + } + } + return new WebRTCTransportRequestorClusterWebRTCSessionStruct( + id, + peerNodeID, + peerFabricIndex, + streamType, + videoStreamID, + audioStreamID, + metadataOptions + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("WebRTCTransportRequestorClusterWebRTCSessionStruct {\n"); + output.append("\tid: "); + output.append(id); + output.append("\n"); + output.append("\tpeerNodeID: "); + output.append(peerNodeID); + output.append("\n"); + output.append("\tpeerFabricIndex: "); + output.append(peerFabricIndex); + output.append("\n"); + output.append("\tstreamType: "); + output.append(streamType); + output.append("\n"); + output.append("\tvideoStreamID: "); + output.append(videoStreamID); + output.append("\n"); + output.append("\taudioStreamID: "); + output.append(audioStreamID); + output.append("\n"); + output.append("\tmetadataOptions: "); + output.append(metadataOptions); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} public static class ChimeClusterChimeSoundStruct { public Integer chimeID; public String name; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java index 113c958fad..28a415a300 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -382,6 +382,9 @@ public static BaseCluster getCluster(long clusterId) { if (clusterId == WebRTCTransportProvider.ID) { return new WebRTCTransportProvider(); } + if (clusterId == WebRTCTransportRequestor.ID) { + return new WebRTCTransportRequestor(); + } if (clusterId == Chime.ID) { return new Chime(); } @@ -17076,6 +17079,179 @@ public long getCommandID(String name) throws IllegalArgumentException { return Command.valueOf(name).getID(); } } + public static class WebRTCTransportRequestor implements BaseCluster { + public static final long ID = 1364L; + public long getID() { + return ID; + } + + public enum Attribute { + CurrentSessions(0L), + GeneratedCommandList(65528L), + AcceptedCommandList(65529L), + EventList(65530L), + AttributeList(65531L), + FeatureMap(65532L), + ClusterRevision(65533L),; + private final long id; + Attribute(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Attribute value(long id) throws NoSuchFieldError { + for (Attribute attribute : Attribute.values()) { + if (attribute.getID() == id) { + return attribute; + } + } + throw new NoSuchFieldError(); + } + } + + public enum Event {; + private final long id; + Event(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Event value(long id) throws NoSuchFieldError { + for (Event event : Event.values()) { + if (event.getID() == id) { + return event; + } + } + throw new NoSuchFieldError(); + } + } + + public enum Command { + Offer(1L), + Answer(2L), + ICECandidate(3L), + End(4L),; + private final long id; + Command(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Command value(long id) throws NoSuchFieldError { + for (Command command : Command.values()) { + if (command.getID() == id) { + return command; + } + } + throw new NoSuchFieldError(); + } + }public enum OfferCommandField {WebRTCSessionID(0),Sdp(1),ICEServers(2),ICETransportPolicy(3),; + private final int id; + OfferCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static OfferCommandField value(int id) throws NoSuchFieldError { + for (OfferCommandField field : OfferCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum AnswerCommandField {WebRTCSessionID(0),Sdp(1),; + private final int id; + AnswerCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static AnswerCommandField value(int id) throws NoSuchFieldError { + for (AnswerCommandField field : AnswerCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum ICECandidateCommandField {WebRTCSessionID(0),ICECandidate(1),; + private final int id; + ICECandidateCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static ICECandidateCommandField value(int id) throws NoSuchFieldError { + for (ICECandidateCommandField field : ICECandidateCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum EndCommandField {WebRTCSessionID(0),Reason(1),; + private final int id; + EndCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static EndCommandField value(int id) throws NoSuchFieldError { + for (EndCommandField field : EndCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }@Override + public String getAttributeName(long id) throws NoSuchFieldError { + return Attribute.value(id).toString(); + } + + @Override + public String getEventName(long id) throws NoSuchFieldError { + return Event.value(id).toString(); + } + + @Override + public String getCommandName(long id) throws NoSuchFieldError { + return Command.value(id).toString(); + } + + @Override + public long getAttributeID(String name) throws IllegalArgumentException { + return Attribute.valueOf(name).getID(); + } + + @Override + public long getEventID(String name) throws IllegalArgumentException { + return Event.valueOf(name).getID(); + } + + @Override + public long getCommandID(String name) throws IllegalArgumentException { + return Command.valueOf(name).getID(); + } + } public static class Chime implements BaseCluster { public static final long ID = 1366L; public long getID() { diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java index 295ada1c57..27dda463b3 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java @@ -20153,6 +20153,111 @@ public void onError(Exception ex) { } } + public static class DelegatedWebRTCTransportRequestorClusterCurrentSessionsAttributeCallback implements ChipClusters.WebRTCTransportRequestorCluster.CurrentSessionsAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedWebRTCTransportRequestorClusterGeneratedCommandListAttributeCallback implements ChipClusters.WebRTCTransportRequestorCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedWebRTCTransportRequestorClusterAcceptedCommandListAttributeCallback implements ChipClusters.WebRTCTransportRequestorCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedWebRTCTransportRequestorClusterEventListAttributeCallback implements ChipClusters.WebRTCTransportRequestorCluster.EventListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedWebRTCTransportRequestorClusterAttributeListAttributeCallback implements ChipClusters.WebRTCTransportRequestorCluster.AttributeListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public static class DelegatedChimeClusterInstalledChimeSoundsAttributeCallback implements ChipClusters.ChimeCluster.InstalledChimeSoundsAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override @@ -22598,6 +22703,10 @@ public Map initializeClusterMap() { (ptr, endpointId) -> new ChipClusters.WebRTCTransportProviderCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("webRTCTransportProvider", webRTCTransportProviderClusterInfo); + ClusterInfo webRTCTransportRequestorClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.WebRTCTransportRequestorCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("webRTCTransportRequestor", webRTCTransportRequestorClusterInfo); + ClusterInfo chimeClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.ChimeCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("chime", chimeClusterInfo); @@ -22744,6 +22853,7 @@ public void combineCommand(Map destination, Map> getCommandMap() { commandMap.put("webRTCTransportProvider", webRTCTransportProviderClusterInteractionInfoMap); + Map webRTCTransportRequestorClusterInteractionInfoMap = new LinkedHashMap<>(); + + Map webRTCTransportRequestorofferCommandParams = new LinkedHashMap(); + + CommandParameterInfo webRTCTransportRequestorofferwebRTCSessionIDCommandParameterInfo = new CommandParameterInfo("webRTCSessionID", Integer.class, Integer.class); + webRTCTransportRequestorofferCommandParams.put("webRTCSessionID",webRTCTransportRequestorofferwebRTCSessionIDCommandParameterInfo); + + CommandParameterInfo webRTCTransportRequestoroffersdpCommandParameterInfo = new CommandParameterInfo("sdp", String.class, String.class); + webRTCTransportRequestorofferCommandParams.put("sdp",webRTCTransportRequestoroffersdpCommandParameterInfo); + + + CommandParameterInfo webRTCTransportRequestorofferICETransportPolicyCommandParameterInfo = new CommandParameterInfo("ICETransportPolicy", Optional.class, String.class); + webRTCTransportRequestorofferCommandParams.put("ICETransportPolicy",webRTCTransportRequestorofferICETransportPolicyCommandParameterInfo); + InteractionInfo webRTCTransportRequestorofferInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WebRTCTransportRequestorCluster) cluster) + .offer((DefaultClusterCallback) callback + , (Integer) + commandArguments.get("webRTCSessionID") + , (String) + commandArguments.get("sdp") + , (Optional>) + commandArguments.get("ICEServers") + , (Optional) + commandArguments.get("ICETransportPolicy") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + webRTCTransportRequestorofferCommandParams + ); + webRTCTransportRequestorClusterInteractionInfoMap.put("offer", webRTCTransportRequestorofferInteractionInfo); + + Map webRTCTransportRequestoranswerCommandParams = new LinkedHashMap(); + + CommandParameterInfo webRTCTransportRequestoranswerwebRTCSessionIDCommandParameterInfo = new CommandParameterInfo("webRTCSessionID", Integer.class, Integer.class); + webRTCTransportRequestoranswerCommandParams.put("webRTCSessionID",webRTCTransportRequestoranswerwebRTCSessionIDCommandParameterInfo); + + CommandParameterInfo webRTCTransportRequestoranswersdpCommandParameterInfo = new CommandParameterInfo("sdp", String.class, String.class); + webRTCTransportRequestoranswerCommandParams.put("sdp",webRTCTransportRequestoranswersdpCommandParameterInfo); + InteractionInfo webRTCTransportRequestoranswerInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WebRTCTransportRequestorCluster) cluster) + .answer((DefaultClusterCallback) callback + , (Integer) + commandArguments.get("webRTCSessionID") + , (String) + commandArguments.get("sdp") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + webRTCTransportRequestoranswerCommandParams + ); + webRTCTransportRequestorClusterInteractionInfoMap.put("answer", webRTCTransportRequestoranswerInteractionInfo); + + Map webRTCTransportRequestorICECandidateCommandParams = new LinkedHashMap(); + + CommandParameterInfo webRTCTransportRequestorICECandidatewebRTCSessionIDCommandParameterInfo = new CommandParameterInfo("webRTCSessionID", Integer.class, Integer.class); + webRTCTransportRequestorICECandidateCommandParams.put("webRTCSessionID",webRTCTransportRequestorICECandidatewebRTCSessionIDCommandParameterInfo); + + CommandParameterInfo webRTCTransportRequestorICECandidateICECandidateCommandParameterInfo = new CommandParameterInfo("ICECandidate", String.class, String.class); + webRTCTransportRequestorICECandidateCommandParams.put("ICECandidate",webRTCTransportRequestorICECandidateICECandidateCommandParameterInfo); + InteractionInfo webRTCTransportRequestorICECandidateInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WebRTCTransportRequestorCluster) cluster) + .ICECandidate((DefaultClusterCallback) callback + , (Integer) + commandArguments.get("webRTCSessionID") + , (String) + commandArguments.get("ICECandidate") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + webRTCTransportRequestorICECandidateCommandParams + ); + webRTCTransportRequestorClusterInteractionInfoMap.put("ICECandidate", webRTCTransportRequestorICECandidateInteractionInfo); + + Map webRTCTransportRequestorendCommandParams = new LinkedHashMap(); + + CommandParameterInfo webRTCTransportRequestorendwebRTCSessionIDCommandParameterInfo = new CommandParameterInfo("webRTCSessionID", Integer.class, Integer.class); + webRTCTransportRequestorendCommandParams.put("webRTCSessionID",webRTCTransportRequestorendwebRTCSessionIDCommandParameterInfo); + + CommandParameterInfo webRTCTransportRequestorendreasonCommandParameterInfo = new CommandParameterInfo("reason", Integer.class, Integer.class); + webRTCTransportRequestorendCommandParams.put("reason",webRTCTransportRequestorendreasonCommandParameterInfo); + InteractionInfo webRTCTransportRequestorendInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WebRTCTransportRequestorCluster) cluster) + .end((DefaultClusterCallback) callback + , (Integer) + commandArguments.get("webRTCSessionID") + , (Integer) + commandArguments.get("reason") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + webRTCTransportRequestorendCommandParams + ); + webRTCTransportRequestorClusterInteractionInfoMap.put("end", webRTCTransportRequestorendInteractionInfo); + + commandMap.put("webRTCTransportRequestor", webRTCTransportRequestorClusterInteractionInfoMap); + Map chimeClusterInteractionInfoMap = new LinkedHashMap<>(); Map chimeplayChimeSoundCommandParams = new LinkedHashMap(); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java index 4da39ee645..41df5ac5c8 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java @@ -18328,6 +18328,87 @@ private static Map readWebRTCTransportProviderInteracti return result; } + private static Map readWebRTCTransportRequestorInteractionInfo() { + Map result = new LinkedHashMap<>();Map readWebRTCTransportRequestorCurrentSessionsCommandParams = new LinkedHashMap(); + InteractionInfo readWebRTCTransportRequestorCurrentSessionsAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WebRTCTransportRequestorCluster) cluster).readCurrentSessionsAttribute( + (ChipClusters.WebRTCTransportRequestorCluster.CurrentSessionsAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedWebRTCTransportRequestorClusterCurrentSessionsAttributeCallback(), + readWebRTCTransportRequestorCurrentSessionsCommandParams + ); + result.put("readCurrentSessionsAttribute", readWebRTCTransportRequestorCurrentSessionsAttributeInteractionInfo); + Map readWebRTCTransportRequestorGeneratedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readWebRTCTransportRequestorGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WebRTCTransportRequestorCluster) cluster).readGeneratedCommandListAttribute( + (ChipClusters.WebRTCTransportRequestorCluster.GeneratedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedWebRTCTransportRequestorClusterGeneratedCommandListAttributeCallback(), + readWebRTCTransportRequestorGeneratedCommandListCommandParams + ); + result.put("readGeneratedCommandListAttribute", readWebRTCTransportRequestorGeneratedCommandListAttributeInteractionInfo); + Map readWebRTCTransportRequestorAcceptedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readWebRTCTransportRequestorAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WebRTCTransportRequestorCluster) cluster).readAcceptedCommandListAttribute( + (ChipClusters.WebRTCTransportRequestorCluster.AcceptedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedWebRTCTransportRequestorClusterAcceptedCommandListAttributeCallback(), + readWebRTCTransportRequestorAcceptedCommandListCommandParams + ); + result.put("readAcceptedCommandListAttribute", readWebRTCTransportRequestorAcceptedCommandListAttributeInteractionInfo); + Map readWebRTCTransportRequestorEventListCommandParams = new LinkedHashMap(); + InteractionInfo readWebRTCTransportRequestorEventListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WebRTCTransportRequestorCluster) cluster).readEventListAttribute( + (ChipClusters.WebRTCTransportRequestorCluster.EventListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedWebRTCTransportRequestorClusterEventListAttributeCallback(), + readWebRTCTransportRequestorEventListCommandParams + ); + result.put("readEventListAttribute", readWebRTCTransportRequestorEventListAttributeInteractionInfo); + Map readWebRTCTransportRequestorAttributeListCommandParams = new LinkedHashMap(); + InteractionInfo readWebRTCTransportRequestorAttributeListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WebRTCTransportRequestorCluster) cluster).readAttributeListAttribute( + (ChipClusters.WebRTCTransportRequestorCluster.AttributeListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedWebRTCTransportRequestorClusterAttributeListAttributeCallback(), + readWebRTCTransportRequestorAttributeListCommandParams + ); + result.put("readAttributeListAttribute", readWebRTCTransportRequestorAttributeListAttributeInteractionInfo); + Map readWebRTCTransportRequestorFeatureMapCommandParams = new LinkedHashMap(); + InteractionInfo readWebRTCTransportRequestorFeatureMapAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WebRTCTransportRequestorCluster) cluster).readFeatureMapAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readWebRTCTransportRequestorFeatureMapCommandParams + ); + result.put("readFeatureMapAttribute", readWebRTCTransportRequestorFeatureMapAttributeInteractionInfo); + Map readWebRTCTransportRequestorClusterRevisionCommandParams = new LinkedHashMap(); + InteractionInfo readWebRTCTransportRequestorClusterRevisionAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WebRTCTransportRequestorCluster) cluster).readClusterRevisionAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readWebRTCTransportRequestorClusterRevisionCommandParams + ); + result.put("readClusterRevisionAttribute", readWebRTCTransportRequestorClusterRevisionAttributeInteractionInfo); + + return result; + } private static Map readChimeInteractionInfo() { Map result = new LinkedHashMap<>();Map readChimeInstalledChimeSoundsCommandParams = new LinkedHashMap(); InteractionInfo readChimeInstalledChimeSoundsAttributeInteractionInfo = new InteractionInfo( @@ -19882,6 +19963,7 @@ public Map> getReadAttributeMap() { put("contentControl", readContentControlInteractionInfo()); put("contentAppObserver", readContentAppObserverInteractionInfo()); put("webRTCTransportProvider", readWebRTCTransportProviderInteractionInfo()); + put("webRTCTransportRequestor", readWebRTCTransportRequestorInteractionInfo()); put("chime", readChimeInteractionInfo()); put("ecosystemInformation", readEcosystemInformationInteractionInfo()); put("commissionerControl", readCommissionerControlInteractionInfo()); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java index 0d561c36e7..b2ffaac83a 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java @@ -3474,6 +3474,8 @@ public Map> getWriteAttributeMap() { writeAttributeMap.put("contentAppObserver", writeContentAppObserverInteractionInfo); Map writeWebRTCTransportProviderInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("webRTCTransportProvider", writeWebRTCTransportProviderInteractionInfo); + Map writeWebRTCTransportRequestorInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("webRTCTransportRequestor", writeWebRTCTransportRequestorInteractionInfo); Map writeChimeInteractionInfo = new LinkedHashMap<>(); Map writeChimeActiveChimeIDCommandParams = new LinkedHashMap(); CommandParameterInfo chimeactiveChimeIDCommandParameterInfo = diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni b/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni index 6187cfbe7c..115bbe53cb 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni @@ -162,6 +162,8 @@ structs_sources = [ "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/WaterHeaterModeClusterModeTagStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/WebRTCTransportProviderClusterICEServerStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/WebRTCTransportProviderClusterWebRTCSessionStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/WebRTCTransportRequestorClusterICEServerStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/WebRTCTransportRequestorClusterWebRTCSessionStruct.kt", ] eventstructs_sources = [ diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/WebRTCTransportRequestorClusterICEServerStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/WebRTCTransportRequestorClusterICEServerStruct.kt new file mode 100644 index 0000000000..4c249b90b1 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/WebRTCTransportRequestorClusterICEServerStruct.kt @@ -0,0 +1,106 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.structs + +import chip.devicecontroller.cluster.* +import java.util.Optional +import matter.tlv.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class WebRTCTransportRequestorClusterICEServerStruct( + val urls: List, + val username: Optional, + val credential: Optional, + val caid: Optional, +) { + override fun toString(): String = buildString { + append("WebRTCTransportRequestorClusterICEServerStruct {\n") + append("\turls : $urls\n") + append("\tusername : $username\n") + append("\tcredential : $credential\n") + append("\tcaid : $caid\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + startArray(ContextSpecificTag(TAG_URLS)) + for (item in urls.iterator()) { + put(AnonymousTag, item) + } + endArray() + if (username.isPresent) { + val optusername = username.get() + put(ContextSpecificTag(TAG_USERNAME), optusername) + } + if (credential.isPresent) { + val optcredential = credential.get() + put(ContextSpecificTag(TAG_CREDENTIAL), optcredential) + } + if (caid.isPresent) { + val optcaid = caid.get() + put(ContextSpecificTag(TAG_CAID), optcaid) + } + endStructure() + } + } + + companion object { + private const val TAG_URLS = 1 + private const val TAG_USERNAME = 2 + private const val TAG_CREDENTIAL = 3 + private const val TAG_CAID = 4 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): WebRTCTransportRequestorClusterICEServerStruct { + tlvReader.enterStructure(tlvTag) + val urls = + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_URLS)) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getString(AnonymousTag)) + } + tlvReader.exitContainer() + } + val username = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_USERNAME))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_USERNAME))) + } else { + Optional.empty() + } + val credential = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_CREDENTIAL))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_CREDENTIAL))) + } else { + Optional.empty() + } + val caid = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_CAID))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_CAID))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return WebRTCTransportRequestorClusterICEServerStruct(urls, username, credential, caid) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/WebRTCTransportRequestorClusterWebRTCSessionStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/WebRTCTransportRequestorClusterWebRTCSessionStruct.kt new file mode 100644 index 0000000000..40c666bbd6 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/WebRTCTransportRequestorClusterWebRTCSessionStruct.kt @@ -0,0 +1,115 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.structs + +import chip.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class WebRTCTransportRequestorClusterWebRTCSessionStruct( + val id: UInt, + val peerNodeID: ULong, + val peerFabricIndex: UInt, + val streamType: UInt, + val videoStreamID: UInt?, + val audioStreamID: UInt?, + val metadataOptions: UInt, +) { + override fun toString(): String = buildString { + append("WebRTCTransportRequestorClusterWebRTCSessionStruct {\n") + append("\tid : $id\n") + append("\tpeerNodeID : $peerNodeID\n") + append("\tpeerFabricIndex : $peerFabricIndex\n") + append("\tstreamType : $streamType\n") + append("\tvideoStreamID : $videoStreamID\n") + append("\taudioStreamID : $audioStreamID\n") + append("\tmetadataOptions : $metadataOptions\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_ID), id) + put(ContextSpecificTag(TAG_PEER_NODE_ID), peerNodeID) + put(ContextSpecificTag(TAG_PEER_FABRIC_INDEX), peerFabricIndex) + put(ContextSpecificTag(TAG_STREAM_TYPE), streamType) + if (videoStreamID != null) { + put(ContextSpecificTag(TAG_VIDEO_STREAM_ID), videoStreamID) + } else { + putNull(ContextSpecificTag(TAG_VIDEO_STREAM_ID)) + } + if (audioStreamID != null) { + put(ContextSpecificTag(TAG_AUDIO_STREAM_ID), audioStreamID) + } else { + putNull(ContextSpecificTag(TAG_AUDIO_STREAM_ID)) + } + put(ContextSpecificTag(TAG_METADATA_OPTIONS), metadataOptions) + endStructure() + } + } + + companion object { + private const val TAG_ID = 1 + private const val TAG_PEER_NODE_ID = 2 + private const val TAG_PEER_FABRIC_INDEX = 3 + private const val TAG_STREAM_TYPE = 4 + private const val TAG_VIDEO_STREAM_ID = 5 + private const val TAG_AUDIO_STREAM_ID = 6 + private const val TAG_METADATA_OPTIONS = 7 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): WebRTCTransportRequestorClusterWebRTCSessionStruct { + tlvReader.enterStructure(tlvTag) + val id = tlvReader.getUInt(ContextSpecificTag(TAG_ID)) + val peerNodeID = tlvReader.getULong(ContextSpecificTag(TAG_PEER_NODE_ID)) + val peerFabricIndex = tlvReader.getUInt(ContextSpecificTag(TAG_PEER_FABRIC_INDEX)) + val streamType = tlvReader.getUInt(ContextSpecificTag(TAG_STREAM_TYPE)) + val videoStreamID = + if (!tlvReader.isNull()) { + tlvReader.getUInt(ContextSpecificTag(TAG_VIDEO_STREAM_ID)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_VIDEO_STREAM_ID)) + null + } + val audioStreamID = + if (!tlvReader.isNull()) { + tlvReader.getUInt(ContextSpecificTag(TAG_AUDIO_STREAM_ID)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_AUDIO_STREAM_ID)) + null + } + val metadataOptions = tlvReader.getUInt(ContextSpecificTag(TAG_METADATA_OPTIONS)) + + tlvReader.exitContainer() + + return WebRTCTransportRequestorClusterWebRTCSessionStruct( + id, + peerNodeID, + peerFabricIndex, + streamType, + videoStreamID, + audioStreamID, + metadataOptions, + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/WebRTCTransportRequestorCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/WebRTCTransportRequestorCluster.kt new file mode 100644 index 0000000000..2d5f7d8ed5 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/WebRTCTransportRequestorCluster.kt @@ -0,0 +1,873 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package matter.controller.cluster.clusters + +import java.time.Duration +import java.util.logging.Level +import java.util.logging.Logger +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.transform +import matter.controller.InvokeRequest +import matter.controller.InvokeResponse +import matter.controller.MatterController +import matter.controller.ReadData +import matter.controller.ReadRequest +import matter.controller.SubscribeRequest +import matter.controller.SubscriptionState +import matter.controller.UIntSubscriptionState +import matter.controller.UShortSubscriptionState +import matter.controller.cluster.structs.* +import matter.controller.model.AttributePath +import matter.controller.model.CommandPath +import matter.tlv.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class WebRTCTransportRequestorCluster( + private val controller: MatterController, + private val endpointId: UShort, +) { + class CurrentSessionsAttribute( + val value: List + ) + + sealed class CurrentSessionsAttributeSubscriptionState { + data class Success(val value: List) : + CurrentSessionsAttributeSubscriptionState() + + data class Error(val exception: Exception) : CurrentSessionsAttributeSubscriptionState() + + object SubscriptionEstablished : CurrentSessionsAttributeSubscriptionState() + } + + class GeneratedCommandListAttribute(val value: List) + + sealed class GeneratedCommandListAttributeSubscriptionState { + data class Success(val value: List) : GeneratedCommandListAttributeSubscriptionState() + + data class Error(val exception: Exception) : GeneratedCommandListAttributeSubscriptionState() + + object SubscriptionEstablished : GeneratedCommandListAttributeSubscriptionState() + } + + class AcceptedCommandListAttribute(val value: List) + + sealed class AcceptedCommandListAttributeSubscriptionState { + data class Success(val value: List) : AcceptedCommandListAttributeSubscriptionState() + + data class Error(val exception: Exception) : AcceptedCommandListAttributeSubscriptionState() + + object SubscriptionEstablished : AcceptedCommandListAttributeSubscriptionState() + } + + class EventListAttribute(val value: List) + + sealed class EventListAttributeSubscriptionState { + data class Success(val value: List) : EventListAttributeSubscriptionState() + + data class Error(val exception: Exception) : EventListAttributeSubscriptionState() + + object SubscriptionEstablished : EventListAttributeSubscriptionState() + } + + class AttributeListAttribute(val value: List) + + sealed class AttributeListAttributeSubscriptionState { + data class Success(val value: List) : AttributeListAttributeSubscriptionState() + + data class Error(val exception: Exception) : AttributeListAttributeSubscriptionState() + + object SubscriptionEstablished : AttributeListAttributeSubscriptionState() + } + + suspend fun offer( + webRTCSessionID: UShort, + sdp: String, + ICEServers: List?, + ICETransportPolicy: String?, + timedInvokeTimeout: Duration? = null, + ) { + val commandId: UInt = 1u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_WEB_RTC_SESSION_ID_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_WEB_RTC_SESSION_ID_REQ), webRTCSessionID) + + val TAG_SDP_REQ: Int = 1 + tlvWriter.put(ContextSpecificTag(TAG_SDP_REQ), sdp) + + val TAG_ICE_SERVERS_REQ: Int = 2 + ICEServers?.let { + tlvWriter.startArray(ContextSpecificTag(TAG_ICE_SERVERS_REQ)) + for (item in ICEServers.iterator()) { + item.toTlv(AnonymousTag, tlvWriter) + } + tlvWriter.endArray() + } + + val TAG_ICE_TRANSPORT_POLICY_REQ: Int = 3 + ICETransportPolicy?.let { + tlvWriter.put(ContextSpecificTag(TAG_ICE_TRANSPORT_POLICY_REQ), ICETransportPolicy) + } + tlvWriter.endStructure() + + val request: InvokeRequest = + InvokeRequest( + CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), + tlvPayload = tlvWriter.getEncoded(), + timedRequest = timedInvokeTimeout, + ) + + val response: InvokeResponse = controller.invoke(request) + logger.log(Level.FINE, "Invoke command succeeded: ${response}") + } + + suspend fun answer(webRTCSessionID: UShort, sdp: String, timedInvokeTimeout: Duration? = null) { + val commandId: UInt = 2u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_WEB_RTC_SESSION_ID_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_WEB_RTC_SESSION_ID_REQ), webRTCSessionID) + + val TAG_SDP_REQ: Int = 1 + tlvWriter.put(ContextSpecificTag(TAG_SDP_REQ), sdp) + tlvWriter.endStructure() + + val request: InvokeRequest = + InvokeRequest( + CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), + tlvPayload = tlvWriter.getEncoded(), + timedRequest = timedInvokeTimeout, + ) + + val response: InvokeResponse = controller.invoke(request) + logger.log(Level.FINE, "Invoke command succeeded: ${response}") + } + + suspend fun ICECandidate( + webRTCSessionID: UShort, + ICECandidate: String, + timedInvokeTimeout: Duration? = null, + ) { + val commandId: UInt = 3u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_WEB_RTC_SESSION_ID_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_WEB_RTC_SESSION_ID_REQ), webRTCSessionID) + + val TAG_ICE_CANDIDATE_REQ: Int = 1 + tlvWriter.put(ContextSpecificTag(TAG_ICE_CANDIDATE_REQ), ICECandidate) + tlvWriter.endStructure() + + val request: InvokeRequest = + InvokeRequest( + CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), + tlvPayload = tlvWriter.getEncoded(), + timedRequest = timedInvokeTimeout, + ) + + val response: InvokeResponse = controller.invoke(request) + logger.log(Level.FINE, "Invoke command succeeded: ${response}") + } + + suspend fun end(webRTCSessionID: UShort, reason: UByte, timedInvokeTimeout: Duration? = null) { + val commandId: UInt = 4u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_WEB_RTC_SESSION_ID_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_WEB_RTC_SESSION_ID_REQ), webRTCSessionID) + + val TAG_REASON_REQ: Int = 1 + tlvWriter.put(ContextSpecificTag(TAG_REASON_REQ), reason) + tlvWriter.endStructure() + + val request: InvokeRequest = + InvokeRequest( + CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), + tlvPayload = tlvWriter.getEncoded(), + timedRequest = timedInvokeTimeout, + ) + + val response: InvokeResponse = controller.invoke(request) + logger.log(Level.FINE, "Invoke command succeeded: ${response}") + } + + suspend fun readCurrentSessionsAttribute(): CurrentSessionsAttribute { + val ATTRIBUTE_ID: UInt = 0u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Currentsessions attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(WebRTCTransportRequestorClusterWebRTCSessionStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + + return CurrentSessionsAttribute(decodedValue) + } + + suspend fun subscribeCurrentSessionsAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 0u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + CurrentSessionsAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Currentsessions attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add( + WebRTCTransportRequestorClusterWebRTCSessionStruct.fromTlv( + AnonymousTag, + tlvReader, + ) + ) + } + tlvReader.exitContainer() + } + + emit(CurrentSessionsAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(CurrentSessionsAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readGeneratedCommandListAttribute(): GeneratedCommandListAttribute { + val ATTRIBUTE_ID: UInt = 65528u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Generatedcommandlist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return GeneratedCommandListAttribute(decodedValue) + } + + suspend fun subscribeGeneratedCommandListAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65528u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + GeneratedCommandListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Generatedcommandlist attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(GeneratedCommandListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(GeneratedCommandListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readAcceptedCommandListAttribute(): AcceptedCommandListAttribute { + val ATTRIBUTE_ID: UInt = 65529u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Acceptedcommandlist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return AcceptedCommandListAttribute(decodedValue) + } + + suspend fun subscribeAcceptedCommandListAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65529u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + AcceptedCommandListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Acceptedcommandlist attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(AcceptedCommandListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(AcceptedCommandListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readEventListAttribute(): EventListAttribute { + val ATTRIBUTE_ID: UInt = 65530u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Eventlist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return EventListAttribute(decodedValue) + } + + suspend fun subscribeEventListAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65530u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + EventListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Eventlist attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(EventListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(EventListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readAttributeListAttribute(): AttributeListAttribute { + val ATTRIBUTE_ID: UInt = 65531u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Attributelist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return AttributeListAttribute(decodedValue) + } + + suspend fun subscribeAttributeListAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65531u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + AttributeListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Attributelist attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(AttributeListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(AttributeListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readFeatureMapAttribute(): UInt { + val ATTRIBUTE_ID: UInt = 65532u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Featuremap attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt = tlvReader.getUInt(AnonymousTag) + + return decodedValue + } + + suspend fun subscribeFeatureMapAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65532u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UIntSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Featuremap attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt = tlvReader.getUInt(AnonymousTag) + + emit(UIntSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(UIntSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readClusterRevisionAttribute(): UShort { + val ATTRIBUTE_ID: UInt = 65533u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Clusterrevision attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UShort = tlvReader.getUShort(AnonymousTag) + + return decodedValue + } + + suspend fun subscribeClusterRevisionAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65533u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UShortSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Clusterrevision attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UShort = tlvReader.getUShort(AnonymousTag) + + emit(UShortSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(UShortSubscriptionState.SubscriptionEstablished) + } + } + } + } + + companion object { + private val logger = Logger.getLogger(WebRTCTransportRequestorCluster::class.java.name) + const val CLUSTER_ID: UInt = 1364u + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/files.gni b/src/controller/java/generated/java/matter/controller/cluster/files.gni index 6a7e5b317e..73e0a1190a 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/files.gni +++ b/src/controller/java/generated/java/matter/controller/cluster/files.gni @@ -162,6 +162,8 @@ matter_structs_sources = [ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/WaterHeaterModeClusterModeTagStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/WebRTCTransportProviderClusterICEServerStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/WebRTCTransportProviderClusterWebRTCSessionStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/WebRTCTransportRequestorClusterICEServerStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/WebRTCTransportRequestorClusterWebRTCSessionStruct.kt", ] matter_eventstructs_sources = [ @@ -373,6 +375,7 @@ matter_clusters_sources = [ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/WaterHeaterManagementCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/WaterHeaterModeCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/WebRTCTransportProviderCluster.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/WebRTCTransportRequestorCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/WiFiNetworkDiagnosticsCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/WiFiNetworkManagementCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/WindowCoveringCluster.kt", diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/WebRTCTransportRequestorClusterICEServerStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/WebRTCTransportRequestorClusterICEServerStruct.kt new file mode 100644 index 0000000000..c7b5e5ef27 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/WebRTCTransportRequestorClusterICEServerStruct.kt @@ -0,0 +1,106 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.controller.cluster.structs + +import java.util.Optional +import matter.controller.cluster.* +import matter.tlv.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class WebRTCTransportRequestorClusterICEServerStruct( + val urls: List, + val username: Optional, + val credential: Optional, + val caid: Optional, +) { + override fun toString(): String = buildString { + append("WebRTCTransportRequestorClusterICEServerStruct {\n") + append("\turls : $urls\n") + append("\tusername : $username\n") + append("\tcredential : $credential\n") + append("\tcaid : $caid\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + startArray(ContextSpecificTag(TAG_URLS)) + for (item in urls.iterator()) { + put(AnonymousTag, item) + } + endArray() + if (username.isPresent) { + val optusername = username.get() + put(ContextSpecificTag(TAG_USERNAME), optusername) + } + if (credential.isPresent) { + val optcredential = credential.get() + put(ContextSpecificTag(TAG_CREDENTIAL), optcredential) + } + if (caid.isPresent) { + val optcaid = caid.get() + put(ContextSpecificTag(TAG_CAID), optcaid) + } + endStructure() + } + } + + companion object { + private const val TAG_URLS = 1 + private const val TAG_USERNAME = 2 + private const val TAG_CREDENTIAL = 3 + private const val TAG_CAID = 4 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): WebRTCTransportRequestorClusterICEServerStruct { + tlvReader.enterStructure(tlvTag) + val urls = + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_URLS)) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getString(AnonymousTag)) + } + tlvReader.exitContainer() + } + val username = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_USERNAME))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_USERNAME))) + } else { + Optional.empty() + } + val credential = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_CREDENTIAL))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_CREDENTIAL))) + } else { + Optional.empty() + } + val caid = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_CAID))) { + Optional.of(tlvReader.getUShort(ContextSpecificTag(TAG_CAID))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return WebRTCTransportRequestorClusterICEServerStruct(urls, username, credential, caid) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/WebRTCTransportRequestorClusterWebRTCSessionStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/WebRTCTransportRequestorClusterWebRTCSessionStruct.kt new file mode 100644 index 0000000000..9c572a4097 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/WebRTCTransportRequestorClusterWebRTCSessionStruct.kt @@ -0,0 +1,115 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.controller.cluster.structs + +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class WebRTCTransportRequestorClusterWebRTCSessionStruct( + val id: UShort, + val peerNodeID: ULong, + val peerFabricIndex: UByte, + val streamType: UByte, + val videoStreamID: UShort?, + val audioStreamID: UShort?, + val metadataOptions: UByte, +) { + override fun toString(): String = buildString { + append("WebRTCTransportRequestorClusterWebRTCSessionStruct {\n") + append("\tid : $id\n") + append("\tpeerNodeID : $peerNodeID\n") + append("\tpeerFabricIndex : $peerFabricIndex\n") + append("\tstreamType : $streamType\n") + append("\tvideoStreamID : $videoStreamID\n") + append("\taudioStreamID : $audioStreamID\n") + append("\tmetadataOptions : $metadataOptions\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_ID), id) + put(ContextSpecificTag(TAG_PEER_NODE_ID), peerNodeID) + put(ContextSpecificTag(TAG_PEER_FABRIC_INDEX), peerFabricIndex) + put(ContextSpecificTag(TAG_STREAM_TYPE), streamType) + if (videoStreamID != null) { + put(ContextSpecificTag(TAG_VIDEO_STREAM_ID), videoStreamID) + } else { + putNull(ContextSpecificTag(TAG_VIDEO_STREAM_ID)) + } + if (audioStreamID != null) { + put(ContextSpecificTag(TAG_AUDIO_STREAM_ID), audioStreamID) + } else { + putNull(ContextSpecificTag(TAG_AUDIO_STREAM_ID)) + } + put(ContextSpecificTag(TAG_METADATA_OPTIONS), metadataOptions) + endStructure() + } + } + + companion object { + private const val TAG_ID = 1 + private const val TAG_PEER_NODE_ID = 2 + private const val TAG_PEER_FABRIC_INDEX = 3 + private const val TAG_STREAM_TYPE = 4 + private const val TAG_VIDEO_STREAM_ID = 5 + private const val TAG_AUDIO_STREAM_ID = 6 + private const val TAG_METADATA_OPTIONS = 7 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): WebRTCTransportRequestorClusterWebRTCSessionStruct { + tlvReader.enterStructure(tlvTag) + val id = tlvReader.getUShort(ContextSpecificTag(TAG_ID)) + val peerNodeID = tlvReader.getULong(ContextSpecificTag(TAG_PEER_NODE_ID)) + val peerFabricIndex = tlvReader.getUByte(ContextSpecificTag(TAG_PEER_FABRIC_INDEX)) + val streamType = tlvReader.getUByte(ContextSpecificTag(TAG_STREAM_TYPE)) + val videoStreamID = + if (!tlvReader.isNull()) { + tlvReader.getUShort(ContextSpecificTag(TAG_VIDEO_STREAM_ID)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_VIDEO_STREAM_ID)) + null + } + val audioStreamID = + if (!tlvReader.isNull()) { + tlvReader.getUShort(ContextSpecificTag(TAG_AUDIO_STREAM_ID)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_AUDIO_STREAM_ID)) + null + } + val metadataOptions = tlvReader.getUByte(ContextSpecificTag(TAG_METADATA_OPTIONS)) + + tlvReader.exitContainer() + + return WebRTCTransportRequestorClusterWebRTCSessionStruct( + id, + peerNodeID, + peerFabricIndex, + streamType, + videoStreamID, + audioStreamID, + metadataOptions, + ) + } + } +} diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index 9e5c2620cf..19f3f8d3ed 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -42486,6 +42486,256 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } + case app::Clusters::WebRTCTransportRequestor::Id: { + using namespace app::Clusters::WebRTCTransportRequestor; + switch (aPath.mAttributeId) + { + case Attributes::CurrentSessions::Id: { + using TypeInfo = Attributes::CurrentSessions::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + jobject newElement_0_id; + std::string newElement_0_idClassName = "java/lang/Integer"; + std::string newElement_0_idCtorSignature = "(I)V"; + jint jninewElement_0_id = static_cast(entry_0.id); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_idClassName.c_str(), newElement_0_idCtorSignature.c_str(), jninewElement_0_id, newElement_0_id); + jobject newElement_0_peerNodeID; + std::string newElement_0_peerNodeIDClassName = "java/lang/Long"; + std::string newElement_0_peerNodeIDCtorSignature = "(J)V"; + jlong jninewElement_0_peerNodeID = static_cast(entry_0.peerNodeID); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_peerNodeIDClassName.c_str(), + newElement_0_peerNodeIDCtorSignature.c_str(), + jninewElement_0_peerNodeID, newElement_0_peerNodeID); + jobject newElement_0_peerFabricIndex; + std::string newElement_0_peerFabricIndexClassName = "java/lang/Integer"; + std::string newElement_0_peerFabricIndexCtorSignature = "(I)V"; + jint jninewElement_0_peerFabricIndex = static_cast(entry_0.peerFabricIndex); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_peerFabricIndexClassName.c_str(), newElement_0_peerFabricIndexCtorSignature.c_str(), + jninewElement_0_peerFabricIndex, newElement_0_peerFabricIndex); + jobject newElement_0_streamType; + std::string newElement_0_streamTypeClassName = "java/lang/Integer"; + std::string newElement_0_streamTypeCtorSignature = "(I)V"; + jint jninewElement_0_streamType = static_cast(entry_0.streamType); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_streamTypeClassName.c_str(), + newElement_0_streamTypeCtorSignature.c_str(), + jninewElement_0_streamType, newElement_0_streamType); + jobject newElement_0_videoStreamID; + if (entry_0.videoStreamID.IsNull()) + { + newElement_0_videoStreamID = nullptr; + } + else + { + std::string newElement_0_videoStreamIDClassName = "java/lang/Integer"; + std::string newElement_0_videoStreamIDCtorSignature = "(I)V"; + jint jninewElement_0_videoStreamID = static_cast(entry_0.videoStreamID.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_videoStreamIDClassName.c_str(), newElement_0_videoStreamIDCtorSignature.c_str(), + jninewElement_0_videoStreamID, newElement_0_videoStreamID); + } + jobject newElement_0_audioStreamID; + if (entry_0.audioStreamID.IsNull()) + { + newElement_0_audioStreamID = nullptr; + } + else + { + std::string newElement_0_audioStreamIDClassName = "java/lang/Integer"; + std::string newElement_0_audioStreamIDCtorSignature = "(I)V"; + jint jninewElement_0_audioStreamID = static_cast(entry_0.audioStreamID.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_audioStreamIDClassName.c_str(), newElement_0_audioStreamIDCtorSignature.c_str(), + jninewElement_0_audioStreamID, newElement_0_audioStreamID); + } + jobject newElement_0_metadataOptions; + std::string newElement_0_metadataOptionsClassName = "java/lang/Integer"; + std::string newElement_0_metadataOptionsCtorSignature = "(I)V"; + jint jninewElement_0_metadataOptions = static_cast(entry_0.metadataOptions.Raw()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_metadataOptionsClassName.c_str(), newElement_0_metadataOptionsCtorSignature.c_str(), + jninewElement_0_metadataOptions, newElement_0_metadataOptions); + + jclass webRTCSessionStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$WebRTCTransportRequestorClusterWebRTCSessionStruct", + webRTCSessionStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$WebRTCTransportRequestorClusterWebRTCSessionStruct"); + return nullptr; + } + + jmethodID webRTCSessionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, webRTCSessionStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/" + "Integer;Ljava/lang/Integer;)V", + &webRTCSessionStructStructCtor_1); + if (err != CHIP_NO_ERROR || webRTCSessionStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$WebRTCTransportRequestorClusterWebRTCSessionStruct constructor"); + return nullptr; + } + + newElement_0 = env->NewObject(webRTCSessionStructStructClass_1, webRTCSessionStructStructCtor_1, newElement_0_id, + newElement_0_peerNodeID, newElement_0_peerFabricIndex, newElement_0_streamType, + newElement_0_videoStreamID, newElement_0_audioStreamID, newElement_0_metadataOptions); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AcceptedCommandList::Id: { + using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::EventList::Id: { + using TypeInfo = Attributes::EventList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AttributeList::Id: { + using TypeInfo = Attributes::AttributeList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::FeatureMap::Id: { + using TypeInfo = Attributes::FeatureMap::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::ClusterRevision::Id: { + using TypeInfo = Attributes::ClusterRevision::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + break; + } + break; + } case app::Clusters::Chime::Id: { using namespace app::Clusters::Chime; switch (aPath.mAttributeId) diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index 9da4b9690e..45f2344180 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -8258,6 +8258,16 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } + case app::Clusters::WebRTCTransportRequestor::Id: { + using namespace app::Clusters::WebRTCTransportRequestor; + switch (aPath.mEventId) + { + default: + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + break; + } + break; + } case app::Clusters::Chime::Id: { using namespace app::Clusters::Chime; switch (aPath.mEventId) diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index b2a0bb09b3..e0aec01394 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -13135,6 +13135,90 @@ class ChipClusters: }, }, } + _WEB_RTC_TRANSPORT_REQUESTOR_CLUSTER_INFO = { + "clusterName": "WebRTCTransportRequestor", + "clusterId": 0x00000554, + "commands": { + 0x00000001: { + "commandId": 0x00000001, + "commandName": "Offer", + "args": { + "webRTCSessionID": "int", + "sdp": "str", + "ICEServers": "ICEServerStruct", + "ICETransportPolicy": "str", + }, + }, + 0x00000002: { + "commandId": 0x00000002, + "commandName": "Answer", + "args": { + "webRTCSessionID": "int", + "sdp": "str", + }, + }, + 0x00000003: { + "commandId": 0x00000003, + "commandName": "ICECandidate", + "args": { + "webRTCSessionID": "int", + "ICECandidate": "str", + }, + }, + 0x00000004: { + "commandId": 0x00000004, + "commandName": "End", + "args": { + "webRTCSessionID": "int", + "reason": "int", + }, + }, + }, + "attributes": { + 0x00000000: { + "attributeName": "CurrentSessions", + "attributeId": 0x00000000, + "type": "", + "reportable": True, + }, + 0x0000FFF8: { + "attributeName": "GeneratedCommandList", + "attributeId": 0x0000FFF8, + "type": "int", + "reportable": True, + }, + 0x0000FFF9: { + "attributeName": "AcceptedCommandList", + "attributeId": 0x0000FFF9, + "type": "int", + "reportable": True, + }, + 0x0000FFFA: { + "attributeName": "EventList", + "attributeId": 0x0000FFFA, + "type": "int", + "reportable": True, + }, + 0x0000FFFB: { + "attributeName": "AttributeList", + "attributeId": 0x0000FFFB, + "type": "int", + "reportable": True, + }, + 0x0000FFFC: { + "attributeName": "FeatureMap", + "attributeId": 0x0000FFFC, + "type": "int", + "reportable": True, + }, + 0x0000FFFD: { + "attributeName": "ClusterRevision", + "attributeId": 0x0000FFFD, + "type": "int", + "reportable": True, + }, + }, + } _CHIME_CLUSTER_INFO = { "clusterName": "Chime", "clusterId": 0x00000556, @@ -14454,6 +14538,7 @@ class ChipClusters: 0x0000050F: _CONTENT_CONTROL_CLUSTER_INFO, 0x00000510: _CONTENT_APP_OBSERVER_CLUSTER_INFO, 0x00000553: _WEB_RTC_TRANSPORT_PROVIDER_CLUSTER_INFO, + 0x00000554: _WEB_RTC_TRANSPORT_REQUESTOR_CLUSTER_INFO, 0x00000556: _CHIME_CLUSTER_INFO, 0x00000750: _ECOSYSTEM_INFORMATION_CLUSTER_INFO, 0x00000751: _COMMISSIONER_CONTROL_CLUSTER_INFO, @@ -14581,6 +14666,7 @@ class ChipClusters: "ContentControl": _CONTENT_CONTROL_CLUSTER_INFO, "ContentAppObserver": _CONTENT_APP_OBSERVER_CLUSTER_INFO, "WebRTCTransportProvider": _WEB_RTC_TRANSPORT_PROVIDER_CLUSTER_INFO, + "WebRTCTransportRequestor": _WEB_RTC_TRANSPORT_REQUESTOR_CLUSTER_INFO, "Chime": _CHIME_CLUSTER_INFO, "EcosystemInformation": _ECOSYSTEM_INFORMATION_CLUSTER_INFO, "CommissionerControl": _COMMISSIONER_CONTROL_CLUSTER_INFO, diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index b36c5b9cae..2daa5e799b 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -157,6 +157,7 @@ "ContentControl", "ContentAppObserver", "WebRTCTransportProvider", + "WebRTCTransportRequestor", "Chime", "EcosystemInformation", "CommissionerControl", @@ -46904,6 +46905,298 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'uint' = 0 +@dataclass +class WebRTCTransportRequestor(Cluster): + id: typing.ClassVar[int] = 0x00000554 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="currentSessions", Tag=0x00000000, Type=typing.List[WebRTCTransportRequestor.Structs.WebRTCSessionStruct]), + ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=uint), + ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), + ]) + + currentSessions: 'typing.List[WebRTCTransportRequestor.Structs.WebRTCSessionStruct]' = None + generatedCommandList: 'typing.List[uint]' = None + acceptedCommandList: 'typing.List[uint]' = None + eventList: 'typing.List[uint]' = None + attributeList: 'typing.List[uint]' = None + featureMap: 'uint' = None + clusterRevision: 'uint' = None + + class Enums: + class StreamTypeEnum(MatterIntEnum): + kInternal = 0x00 + kRecording = 0x01 + kAnalysis = 0x02 + kLiveView = 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 = 4, + + class WebRTCEndReasonEnum(MatterIntEnum): + kIceFailed = 0x00 + kIceTimeout = 0x01 + kUserHangup = 0x02 + kUserBusy = 0x03 + kReplaced = 0x04 + kNoUserMedia = 0x05 + kInviteTimeout = 0x06 + kAnsweredElsewhere = 0x07 + kOutOfResources = 0x08 + kMediaTimeout = 0x09 + kLowPower = 0x0A + kUnknownReason = 0x0B + # 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 = 12, + + class Bitmaps: + class WebRTCMetadataOptions(IntFlag): + kDataTLV = 0x1 + + class Structs: + @dataclass + class ICEServerStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="urls", Tag=1, Type=typing.List[str]), + ClusterObjectFieldDescriptor(Label="username", Tag=2, Type=typing.Optional[str]), + ClusterObjectFieldDescriptor(Label="credential", Tag=3, Type=typing.Optional[str]), + ClusterObjectFieldDescriptor(Label="caid", Tag=4, Type=typing.Optional[uint]), + ]) + + urls: 'typing.List[str]' = field(default_factory=lambda: []) + username: 'typing.Optional[str]' = None + credential: 'typing.Optional[str]' = None + caid: 'typing.Optional[uint]' = None + + @dataclass + class WebRTCSessionStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="id", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="peerNodeID", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="peerFabricIndex", Tag=3, Type=uint), + ClusterObjectFieldDescriptor(Label="streamType", Tag=4, Type=WebRTCTransportRequestor.Enums.StreamTypeEnum), + ClusterObjectFieldDescriptor(Label="videoStreamID", Tag=5, Type=typing.Union[Nullable, uint]), + ClusterObjectFieldDescriptor(Label="audioStreamID", Tag=6, Type=typing.Union[Nullable, uint]), + ClusterObjectFieldDescriptor(Label="metadataOptions", Tag=7, Type=uint), + ]) + + id: 'uint' = 0 + peerNodeID: 'uint' = 0 + peerFabricIndex: 'uint' = 0 + streamType: 'WebRTCTransportRequestor.Enums.StreamTypeEnum' = 0 + videoStreamID: 'typing.Union[Nullable, uint]' = NullValue + audioStreamID: 'typing.Union[Nullable, uint]' = NullValue + metadataOptions: 'uint' = 0 + + class Commands: + @dataclass + class Offer(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000554 + command_id: typing.ClassVar[int] = 0x00000001 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="webRTCSessionID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="sdp", Tag=1, Type=str), + ClusterObjectFieldDescriptor(Label="ICEServers", Tag=2, Type=typing.Optional[typing.List[WebRTCTransportRequestor.Structs.ICEServerStruct]]), + ClusterObjectFieldDescriptor(Label="ICETransportPolicy", Tag=3, Type=typing.Optional[str]), + ]) + + webRTCSessionID: 'uint' = 0 + sdp: 'str' = "" + ICEServers: 'typing.Optional[typing.List[WebRTCTransportRequestor.Structs.ICEServerStruct]]' = None + ICETransportPolicy: 'typing.Optional[str]' = None + + @dataclass + class Answer(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000554 + command_id: typing.ClassVar[int] = 0x00000002 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="webRTCSessionID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="sdp", Tag=1, Type=str), + ]) + + webRTCSessionID: 'uint' = 0 + sdp: 'str' = "" + + @dataclass + class ICECandidate(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000554 + command_id: typing.ClassVar[int] = 0x00000003 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="webRTCSessionID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="ICECandidate", Tag=1, Type=str), + ]) + + webRTCSessionID: 'uint' = 0 + ICECandidate: 'str' = "" + + @dataclass + class End(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000554 + command_id: typing.ClassVar[int] = 0x00000004 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="webRTCSessionID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="reason", Tag=1, Type=WebRTCTransportRequestor.Enums.WebRTCEndReasonEnum), + ]) + + webRTCSessionID: 'uint' = 0 + reason: 'WebRTCTransportRequestor.Enums.WebRTCEndReasonEnum' = 0 + + class Attributes: + @dataclass + class CurrentSessions(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000554 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[WebRTCTransportRequestor.Structs.WebRTCSessionStruct]) + + value: 'typing.List[WebRTCTransportRequestor.Structs.WebRTCSessionStruct]' = field(default_factory=lambda: []) + + @dataclass + class GeneratedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000554 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFF8 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class AcceptedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000554 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFF9 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class EventList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000554 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFA + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class AttributeList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000554 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFB + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class FeatureMap(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000554 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFC + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass + class ClusterRevision(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000554 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFD + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass class Chime(Cluster): id: typing.ClassVar[int] = 0x00000556 diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm index 51a423a4ad..a3d3649fb1 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm @@ -5945,6 +5945,36 @@ static BOOL AttributeIsSpecifiedInWebRTCTransportProviderCluster(AttributeId aAt } } } +static BOOL AttributeIsSpecifiedInWebRTCTransportRequestorCluster(AttributeId aAttributeId) +{ + using namespace Clusters::WebRTCTransportRequestor; + switch (aAttributeId) { + case Attributes::CurrentSessions::Id: { + return YES; + } + case Attributes::GeneratedCommandList::Id: { + return YES; + } + case Attributes::AcceptedCommandList::Id: { + return YES; + } + case Attributes::EventList::Id: { + return YES; + } + case Attributes::AttributeList::Id: { + return YES; + } + case Attributes::FeatureMap::Id: { + return YES; + } + case Attributes::ClusterRevision::Id: { + return YES; + } + default: { + return NO; + } + } +} static BOOL AttributeIsSpecifiedInChimeCluster(AttributeId aAttributeId) { using namespace Clusters::Chime; @@ -6717,6 +6747,9 @@ BOOL MTRAttributeIsSpecified(ClusterId aClusterId, AttributeId aAttributeId) case Clusters::WebRTCTransportProvider::Id: { return AttributeIsSpecifiedInWebRTCTransportProviderCluster(aAttributeId); } + case Clusters::WebRTCTransportRequestor::Id: { + return AttributeIsSpecifiedInWebRTCTransportRequestorCluster(aAttributeId); + } case Clusters::Chime::Id: { return AttributeIsSpecifiedInChimeCluster(aAttributeId); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index 907bda8ba8..686b92c333 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -16963,6 +16963,59 @@ static id _Nullable DecodeAttributeValueForWebRTCTransportProviderCluster(Attrib *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } +static id _Nullable DecodeAttributeValueForWebRTCTransportRequestorCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::WebRTCTransportRequestor; + switch (aAttributeId) { + case Attributes::CurrentSessions::Id: { + using TypeInfo = Attributes::CurrentSessions::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRWebRTCTransportRequestorClusterWebRTCSessionStruct * newElement_0; + newElement_0 = [MTRWebRTCTransportRequestorClusterWebRTCSessionStruct new]; + newElement_0.id = [NSNumber numberWithUnsignedShort:entry_0.id]; + newElement_0.peerNodeID = [NSNumber numberWithUnsignedLongLong:entry_0.peerNodeID]; + newElement_0.peerFabricIndex = [NSNumber numberWithUnsignedChar:entry_0.peerFabricIndex]; + newElement_0.streamType = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.streamType)]; + if (entry_0.videoStreamID.IsNull()) { + newElement_0.videoStreamID = nil; + } else { + newElement_0.videoStreamID = [NSNumber numberWithUnsignedShort:entry_0.videoStreamID.Value()]; + } + if (entry_0.audioStreamID.IsNull()) { + newElement_0.audioStreamID = nil; + } else { + newElement_0.audioStreamID = [NSNumber numberWithUnsignedShort:entry_0.audioStreamID.Value()]; + } + newElement_0.metadataOptions = [NSNumber numberWithUnsignedChar:entry_0.metadataOptions.Raw()]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} static id _Nullable DecodeAttributeValueForChimeCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { using namespace Clusters::Chime; @@ -19142,6 +19195,9 @@ id _Nullable MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::T case Clusters::WebRTCTransportProvider::Id: { return DecodeAttributeValueForWebRTCTransportProviderCluster(aPath.mAttributeId, aReader, aError); } + case Clusters::WebRTCTransportRequestor::Id: { + return DecodeAttributeValueForWebRTCTransportRequestorCluster(aPath.mAttributeId, aReader, aError); + } case Clusters::Chime::Id: { return DecodeAttributeValueForChimeCluster(aPath.mAttributeId, aReader, aError); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 264434027d..8f23fc159f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -14860,6 +14860,98 @@ MTR_PROVISIONALLY_AVAILABLE @end +/** + * Cluster WebRTC Transport Requestor + * + * The WebRTC transport requestor cluster provides a way for stream consumers (e.g. Matter Stream Viewer) to establish a WebRTC connection with a stream provider. + */ +MTR_PROVISIONALLY_AVAILABLE +@interface MTRBaseClusterWebRTCTransportRequestor : MTRGenericBaseCluster + +/** + * Command Offer + * + * This command provides the stream requestor with WebRTC session details. It is sent following the receipt of a SolicitOffer command or a re-Offer initiated by the Provider. + */ +- (void)offerWithParams:(MTRWebRTCTransportRequestorClusterOfferParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command Answer + * + * This command provides the stream requestor with the WebRTC session details (i.e. Session ID and SDP answer). It is the next command in the Offer/Answer flow to the ProvideOffer command. + */ +- (void)answerWithParams:(MTRWebRTCTransportRequestorClusterAnswerParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command ICECandidate + * + * This command provides an ICE candidate to the stream requestor in a WebRTC session. + */ +- (void)ICECandidateWithParams:(MTRWebRTCTransportRequestorClusterICECandidateParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command End + * + * This command notifies the stream requestor that the provider has ended the WebRTC session. + */ +- (void)endWithParams:(MTRWebRTCTransportRequestorClusterEndParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeCurrentSessionsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeCurrentSessionsWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeCurrentSessionsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +@interface MTRBaseClusterWebRTCTransportRequestor (Availability) + +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ +- (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue MTR_PROVISIONALLY_AVAILABLE; + +@end + /** * Cluster Chime * @@ -20304,6 +20396,32 @@ typedef NS_OPTIONS(uint8_t, MTRWebRTCTransportProviderWebRTCMetadataOptions) { MTRWebRTCTransportProviderWebRTCMetadataOptionsDataTLV MTR_PROVISIONALLY_AVAILABLE = 0x1, } MTR_PROVISIONALLY_AVAILABLE; +typedef NS_ENUM(uint8_t, MTRWebRTCTransportRequestorStreamType) { + MTRWebRTCTransportRequestorStreamTypeInternal MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRWebRTCTransportRequestorStreamTypeRecording MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTRWebRTCTransportRequestorStreamTypeAnalysis MTR_PROVISIONALLY_AVAILABLE = 0x02, + MTRWebRTCTransportRequestorStreamTypeLiveView MTR_PROVISIONALLY_AVAILABLE = 0x03, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRWebRTCTransportRequestorWebRTCEndReason) { + MTRWebRTCTransportRequestorWebRTCEndReasonIceFailed MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRWebRTCTransportRequestorWebRTCEndReasonIceTimeout MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTRWebRTCTransportRequestorWebRTCEndReasonUserHangup MTR_PROVISIONALLY_AVAILABLE = 0x02, + MTRWebRTCTransportRequestorWebRTCEndReasonUserBusy MTR_PROVISIONALLY_AVAILABLE = 0x03, + MTRWebRTCTransportRequestorWebRTCEndReasonReplaced MTR_PROVISIONALLY_AVAILABLE = 0x04, + MTRWebRTCTransportRequestorWebRTCEndReasonNoUserMedia MTR_PROVISIONALLY_AVAILABLE = 0x05, + MTRWebRTCTransportRequestorWebRTCEndReasonInviteTimeout MTR_PROVISIONALLY_AVAILABLE = 0x06, + MTRWebRTCTransportRequestorWebRTCEndReasonAnsweredElsewhere MTR_PROVISIONALLY_AVAILABLE = 0x07, + MTRWebRTCTransportRequestorWebRTCEndReasonOutOfResources MTR_PROVISIONALLY_AVAILABLE = 0x08, + MTRWebRTCTransportRequestorWebRTCEndReasonMediaTimeout MTR_PROVISIONALLY_AVAILABLE = 0x09, + MTRWebRTCTransportRequestorWebRTCEndReasonLowPower MTR_PROVISIONALLY_AVAILABLE = 0x0A, + MTRWebRTCTransportRequestorWebRTCEndReasonUnknownReason MTR_PROVISIONALLY_AVAILABLE = 0x0B, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_OPTIONS(uint8_t, MTRWebRTCTransportRequestorWebRTCMetadataOptions) { + MTRWebRTCTransportRequestorWebRTCMetadataOptionsDataTLV MTR_PROVISIONALLY_AVAILABLE = 0x1, +} MTR_PROVISIONALLY_AVAILABLE; + typedef NS_OPTIONS(uint32_t, MTRCommissionerControlSupportedDeviceCategoryBitmap) { MTRCommissionerControlSupportedDeviceCategoryBitmapFabricSynchronization MTR_PROVISIONALLY_AVAILABLE = 0x1, } MTR_PROVISIONALLY_AVAILABLE; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index 64af297512..80e36303d3 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -102498,6 +102498,359 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC @end +@implementation MTRBaseClusterWebRTCTransportRequestor + +- (void)offerWithParams:(MTRWebRTCTransportRequestorClusterOfferParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRWebRTCTransportRequestorClusterOfferParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = WebRTCTransportRequestor::Commands::Offer::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)answerWithParams:(MTRWebRTCTransportRequestorClusterAnswerParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRWebRTCTransportRequestorClusterAnswerParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = WebRTCTransportRequestor::Commands::Answer::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)ICECandidateWithParams:(MTRWebRTCTransportRequestorClusterICECandidateParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRWebRTCTransportRequestorClusterICECandidateParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = WebRTCTransportRequestor::Commands::ICECandidate::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)endWithParams:(MTRWebRTCTransportRequestorClusterEndParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRWebRTCTransportRequestorClusterEndParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = WebRTCTransportRequestor::Commands::End::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)readAttributeCurrentSessionsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WebRTCTransportRequestor::Attributes::CurrentSessions::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeCurrentSessionsWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = WebRTCTransportRequestor::Attributes::CurrentSessions::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeCurrentSessionsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WebRTCTransportRequestor::Attributes::CurrentSessions::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WebRTCTransportRequestor::Attributes::GeneratedCommandList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = WebRTCTransportRequestor::Attributes::GeneratedCommandList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WebRTCTransportRequestor::Attributes::GeneratedCommandList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WebRTCTransportRequestor::Attributes::AcceptedCommandList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = WebRTCTransportRequestor::Attributes::AcceptedCommandList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WebRTCTransportRequestor::Attributes::AcceptedCommandList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WebRTCTransportRequestor::Attributes::EventList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = WebRTCTransportRequestor::Attributes::EventList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WebRTCTransportRequestor::Attributes::EventList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WebRTCTransportRequestor::Attributes::AttributeList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = WebRTCTransportRequestor::Attributes::AttributeList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WebRTCTransportRequestor::Attributes::AttributeList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WebRTCTransportRequestor::Attributes::FeatureMap::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = WebRTCTransportRequestor::Attributes::FeatureMap::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WebRTCTransportRequestor::Attributes::FeatureMap::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WebRTCTransportRequestor::Attributes::ClusterRevision::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = WebRTCTransportRequestor::Attributes::ClusterRevision::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WebRTCTransportRequestor::Attributes::ClusterRevision::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +@end + @implementation MTRBaseClusterChime - (void)playChimeSoundWithCompletion:(MTRStatusCompletion)completion diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index 95b1135767..fdefd1f503 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -198,6 +198,7 @@ typedef NS_ENUM(uint32_t, MTRClusterIDType) { MTRClusterIDTypeContentControlID MTR_PROVISIONALLY_AVAILABLE = 0x0000050F, MTRClusterIDTypeContentAppObserverID MTR_PROVISIONALLY_AVAILABLE = 0x00000510, MTRClusterIDTypeWebRTCTransportProviderID MTR_PROVISIONALLY_AVAILABLE = 0x00000553, + MTRClusterIDTypeWebRTCTransportRequestorID MTR_PROVISIONALLY_AVAILABLE = 0x00000554, MTRClusterIDTypeChimeID MTR_PROVISIONALLY_AVAILABLE = 0x00000556, MTRClusterIDTypeEcosystemInformationID MTR_PROVISIONALLY_AVAILABLE = 0x00000750, MTRClusterIDTypeCommissionerControlID MTR_PROVISIONALLY_AVAILABLE = 0x00000751, @@ -4750,6 +4751,15 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterWebRTCTransportProviderAttributeFeatureMapID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeFeatureMapID, MTRAttributeIDTypeClusterWebRTCTransportProviderAttributeClusterRevisionID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster WebRTCTransportRequestor attributes + MTRAttributeIDTypeClusterWebRTCTransportRequestorAttributeCurrentSessionsID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + MTRAttributeIDTypeClusterWebRTCTransportRequestorAttributeGeneratedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, + MTRAttributeIDTypeClusterWebRTCTransportRequestorAttributeAcceptedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, + MTRAttributeIDTypeClusterWebRTCTransportRequestorAttributeEventListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeEventListID, + MTRAttributeIDTypeClusterWebRTCTransportRequestorAttributeAttributeListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAttributeListID, + MTRAttributeIDTypeClusterWebRTCTransportRequestorAttributeFeatureMapID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeFeatureMapID, + MTRAttributeIDTypeClusterWebRTCTransportRequestorAttributeClusterRevisionID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster Chime attributes MTRAttributeIDTypeClusterChimeAttributeInstalledChimeSoundsID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, MTRAttributeIDTypeClusterChimeAttributeActiveChimeIDID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, @@ -6963,6 +6973,12 @@ typedef NS_ENUM(uint32_t, MTRCommandIDType) { MTRCommandIDTypeClusterWebRTCTransportProviderCommandProvideICECandidateID MTR_PROVISIONALLY_AVAILABLE = 0x00000006, MTRCommandIDTypeClusterWebRTCTransportProviderCommandEndSessionID MTR_PROVISIONALLY_AVAILABLE = 0x00000007, + // Cluster WebRTCTransportRequestor commands + MTRCommandIDTypeClusterWebRTCTransportRequestorCommandOfferID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + MTRCommandIDTypeClusterWebRTCTransportRequestorCommandAnswerID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, + MTRCommandIDTypeClusterWebRTCTransportRequestorCommandICECandidateID MTR_PROVISIONALLY_AVAILABLE = 0x00000003, + MTRCommandIDTypeClusterWebRTCTransportRequestorCommandEndID MTR_PROVISIONALLY_AVAILABLE = 0x00000004, + // Cluster Chime commands MTRCommandIDTypeClusterChimeCommandPlayChimeSoundID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm index b9be1f665d..f69444d9a1 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm @@ -372,6 +372,9 @@ case MTRClusterIDTypeWebRTCTransportProviderID: result = @"WebRTCTransportProvider"; break; + case MTRClusterIDTypeWebRTCTransportRequestorID: + result = @"WebRTCTransportRequestor"; + break; case MTRClusterIDTypeChimeID: result = @"Chime"; break; @@ -8185,6 +8188,45 @@ } break; + case MTRClusterIDTypeWebRTCTransportRequestorID: + + switch (attributeID) { + + // Cluster WebRTCTransportRequestor attributes + case MTRAttributeIDTypeClusterWebRTCTransportRequestorAttributeCurrentSessionsID: + result = @"CurrentSessions"; + break; + + case MTRAttributeIDTypeClusterWebRTCTransportRequestorAttributeGeneratedCommandListID: + result = @"GeneratedCommandList"; + break; + + case MTRAttributeIDTypeClusterWebRTCTransportRequestorAttributeAcceptedCommandListID: + result = @"AcceptedCommandList"; + break; + + case MTRAttributeIDTypeClusterWebRTCTransportRequestorAttributeEventListID: + result = @"EventList"; + break; + + case MTRAttributeIDTypeClusterWebRTCTransportRequestorAttributeAttributeListID: + result = @"AttributeList"; + break; + + case MTRAttributeIDTypeClusterWebRTCTransportRequestorAttributeFeatureMapID: + result = @"FeatureMap"; + break; + + case MTRAttributeIDTypeClusterWebRTCTransportRequestorAttributeClusterRevisionID: + result = @"ClusterRevision"; + break; + + default: + result = [NSString stringWithFormat:@"", attributeID]; + break; + } + break; + case MTRClusterIDTypeChimeID: switch (attributeID) { @@ -10990,6 +11032,32 @@ } break; + case MTRClusterIDTypeWebRTCTransportRequestorID: + + switch (commandID) { + + case MTRCommandIDTypeClusterWebRTCTransportRequestorCommandOfferID: + result = @"Offer"; + break; + + case MTRCommandIDTypeClusterWebRTCTransportRequestorCommandAnswerID: + result = @"Answer"; + break; + + case MTRCommandIDTypeClusterWebRTCTransportRequestorCommandICECandidateID: + result = @"ICECandidate"; + break; + + case MTRCommandIDTypeClusterWebRTCTransportRequestorCommandEndID: + result = @"End"; + break; + + default: + result = [NSString stringWithFormat:@"", commandID]; + break; + } + break; + case MTRClusterIDTypeChimeID: switch (commandID) { @@ -12620,6 +12688,16 @@ } break; + case MTRClusterIDTypeWebRTCTransportRequestorID: + + switch (commandID) { + + default: + result = [NSString stringWithFormat:@"", commandID]; + break; + } + break; + case MTRClusterIDTypeChimeID: switch (commandID) { @@ -14391,6 +14469,16 @@ } break; + case MTRClusterIDTypeWebRTCTransportRequestorID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + case MTRClusterIDTypeChimeID: switch (eventID) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index 401e76bda1..4988732fe8 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -6870,6 +6870,49 @@ MTR_PROVISIONALLY_AVAILABLE @end +/** + * Cluster WebRTC Transport Requestor + * The WebRTC transport requestor cluster provides a way for stream consumers (e.g. Matter Stream Viewer) to establish a WebRTC connection with a stream provider. + */ +MTR_PROVISIONALLY_AVAILABLE +@interface MTRClusterWebRTCTransportRequestor : MTRGenericCluster + +- (void)offerWithParams:(MTRWebRTCTransportRequestorClusterOfferParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)answerWithParams:(MTRWebRTCTransportRequestorClusterAnswerParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)ICECandidateWithParams:(MTRWebRTCTransportRequestorClusterICECandidateParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)endWithParams:(MTRWebRTCTransportRequestorClusterEndParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeCurrentSessionsWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +@interface MTRClusterWebRTCTransportRequestor (Availability) + +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ +- (instancetype _Nullable)initWithDevice:(MTRDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue MTR_PROVISIONALLY_AVAILABLE; + +@end + /** * Cluster Chime * This cluster provides facilities to configure and play Chime sounds, such as those used in a doorbell. diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index cdae93833c..2c8bf9015f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -19728,6 +19728,153 @@ - (void)endSessionWithParams:(MTRWebRTCTransportProviderClusterEndSessionParams @end +@implementation MTRClusterWebRTCTransportRequestor + +- (void)offerWithParams:(MTRWebRTCTransportRequestorClusterOfferParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRWebRTCTransportRequestorClusterOfferParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = WebRTCTransportRequestor::Commands::Offer::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)answerWithParams:(MTRWebRTCTransportRequestorClusterAnswerParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRWebRTCTransportRequestorClusterAnswerParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = WebRTCTransportRequestor::Commands::Answer::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)ICECandidateWithParams:(MTRWebRTCTransportRequestorClusterICECandidateParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRWebRTCTransportRequestorClusterICECandidateParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = WebRTCTransportRequestor::Commands::ICECandidate::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)endWithParams:(MTRWebRTCTransportRequestorClusterEndParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRWebRTCTransportRequestorClusterEndParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = WebRTCTransportRequestor::Commands::End::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (NSDictionary * _Nullable)readAttributeCurrentSessionsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWebRTCTransportRequestorID) attributeID:@(MTRAttributeIDTypeClusterWebRTCTransportRequestorAttributeCurrentSessionsID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWebRTCTransportRequestorID) attributeID:@(MTRAttributeIDTypeClusterWebRTCTransportRequestorAttributeGeneratedCommandListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWebRTCTransportRequestorID) attributeID:@(MTRAttributeIDTypeClusterWebRTCTransportRequestorAttributeAcceptedCommandListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWebRTCTransportRequestorID) attributeID:@(MTRAttributeIDTypeClusterWebRTCTransportRequestorAttributeEventListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWebRTCTransportRequestorID) attributeID:@(MTRAttributeIDTypeClusterWebRTCTransportRequestorAttributeAttributeListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWebRTCTransportRequestorID) attributeID:@(MTRAttributeIDTypeClusterWebRTCTransportRequestorAttributeFeatureMapID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWebRTCTransportRequestorID) attributeID:@(MTRAttributeIDTypeClusterWebRTCTransportRequestorAttributeClusterRevisionID) params:params]; +} + +@end + @implementation MTRClusterChime - (void)playChimeSoundWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completion:(MTRStatusCompletion)completion diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h index 2aeb25d7a6..63cbb17356 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -11063,6 +11063,138 @@ MTR_PROVISIONALLY_AVAILABLE @property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRWebRTCTransportRequestorClusterOfferParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull webRTCSessionID MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSString * _Nonnull sdp MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSArray * _Nullable iceServers MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSString * _Nullable iceTransportPolicy MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRWebRTCTransportRequestorClusterAnswerParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull webRTCSessionID MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSString * _Nonnull sdp MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRWebRTCTransportRequestorClusterICECandidateParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull webRTCSessionID MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSString * _Nonnull iceCandidate MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRWebRTCTransportRequestorClusterEndParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull webRTCSessionID MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull reason MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + MTR_PROVISIONALLY_AVAILABLE @interface MTRChimeClusterPlayChimeSoundParams : NSObject /** diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index a922f58315..aaddab1b68 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -32189,6 +32189,418 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end +@implementation MTRWebRTCTransportRequestorClusterOfferParams +- (instancetype)init +{ + if (self = [super init]) { + + _webRTCSessionID = @(0); + + _sdp = @""; + + _iceServers = nil; + + _iceTransportPolicy = nil; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRWebRTCTransportRequestorClusterOfferParams alloc] init]; + + other.webRTCSessionID = self.webRTCSessionID; + other.sdp = self.sdp; + other.iceServers = self.iceServers; + other.iceTransportPolicy = self.iceTransportPolicy; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: webRTCSessionID:%@; sdp:%@; iceServers:%@; iceTransportPolicy:%@; >", NSStringFromClass([self class]), _webRTCSessionID, _sdp, _iceServers, _iceTransportPolicy]; + return descriptionString; +} + +@end + +@implementation MTRWebRTCTransportRequestorClusterOfferParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::WebRTCTransportRequestor::Commands::Offer::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.webRTCSessionID = self.webRTCSessionID.unsignedShortValue; + } + { + encodableStruct.sdp = AsCharSpan(self.sdp); + } + { + if (self.iceServers != nil) { + auto & definedValue_0 = encodableStruct.ICEServers.Emplace(); + { + using ListType_1 = std::remove_reference_t; + using ListMemberType_1 = ListMemberTypeGetter::Type; + if (self.iceServers.count != 0) { + auto * listHolder_1 = new ListHolder(self.iceServers.count); + if (listHolder_1 == nullptr || listHolder_1->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_1); + for (size_t i_1 = 0; i_1 < self.iceServers.count; ++i_1) { + if (![self.iceServers[i_1] isKindOfClass:[MTRWebRTCTransportRequestorClusterICEServerStruct class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_1 = (MTRWebRTCTransportRequestorClusterICEServerStruct *) self.iceServers[i_1]; + { + using ListType_3 = std::remove_reference_tmList[i_1].urls)>; + using ListMemberType_3 = ListMemberTypeGetter::Type; + if (element_1.urls.count != 0) { + auto * listHolder_3 = new ListHolder(element_1.urls.count); + if (listHolder_3 == nullptr || listHolder_3->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_3); + for (size_t i_3 = 0; i_3 < element_1.urls.count; ++i_3) { + if (![element_1.urls[i_3] isKindOfClass:[NSString class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_3 = (NSString *) element_1.urls[i_3]; + listHolder_3->mList[i_3] = AsCharSpan(element_3); + } + listHolder_1->mList[i_1].urls = ListType_3(listHolder_3->mList, element_1.urls.count); + } else { + listHolder_1->mList[i_1].urls = ListType_3(); + } + } + if (element_1.username != nil) { + auto & definedValue_3 = listHolder_1->mList[i_1].username.Emplace(); + definedValue_3 = AsCharSpan(element_1.username); + } + if (element_1.credential != nil) { + auto & definedValue_3 = listHolder_1->mList[i_1].credential.Emplace(); + definedValue_3 = AsCharSpan(element_1.credential); + } + if (element_1.caid != nil) { + auto & definedValue_3 = listHolder_1->mList[i_1].caid.Emplace(); + definedValue_3 = element_1.caid.unsignedShortValue; + } + } + definedValue_0 = ListType_1(listHolder_1->mList, self.iceServers.count); + } else { + definedValue_0 = ListType_1(); + } + } + } + } + { + if (self.iceTransportPolicy != nil) { + auto & definedValue_0 = encodableStruct.ICETransportPolicy.Emplace(); + definedValue_0 = AsCharSpan(self.iceTransportPolicy); + } + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRWebRTCTransportRequestorClusterAnswerParams +- (instancetype)init +{ + if (self = [super init]) { + + _webRTCSessionID = @(0); + + _sdp = @""; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRWebRTCTransportRequestorClusterAnswerParams alloc] init]; + + other.webRTCSessionID = self.webRTCSessionID; + other.sdp = self.sdp; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: webRTCSessionID:%@; sdp:%@; >", NSStringFromClass([self class]), _webRTCSessionID, _sdp]; + return descriptionString; +} + +@end + +@implementation MTRWebRTCTransportRequestorClusterAnswerParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::WebRTCTransportRequestor::Commands::Answer::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.webRTCSessionID = self.webRTCSessionID.unsignedShortValue; + } + { + encodableStruct.sdp = AsCharSpan(self.sdp); + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRWebRTCTransportRequestorClusterICECandidateParams +- (instancetype)init +{ + if (self = [super init]) { + + _webRTCSessionID = @(0); + + _iceCandidate = @""; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRWebRTCTransportRequestorClusterICECandidateParams alloc] init]; + + other.webRTCSessionID = self.webRTCSessionID; + other.iceCandidate = self.iceCandidate; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: webRTCSessionID:%@; iceCandidate:%@; >", NSStringFromClass([self class]), _webRTCSessionID, _iceCandidate]; + return descriptionString; +} + +@end + +@implementation MTRWebRTCTransportRequestorClusterICECandidateParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::WebRTCTransportRequestor::Commands::ICECandidate::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.webRTCSessionID = self.webRTCSessionID.unsignedShortValue; + } + { + encodableStruct.ICECandidate = AsCharSpan(self.iceCandidate); + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRWebRTCTransportRequestorClusterEndParams +- (instancetype)init +{ + if (self = [super init]) { + + _webRTCSessionID = @(0); + + _reason = @(0); + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRWebRTCTransportRequestorClusterEndParams alloc] init]; + + other.webRTCSessionID = self.webRTCSessionID; + other.reason = self.reason; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: webRTCSessionID:%@; reason:%@; >", NSStringFromClass([self class]), _webRTCSessionID, _reason]; + return descriptionString; +} + +@end + +@implementation MTRWebRTCTransportRequestorClusterEndParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::WebRTCTransportRequestor::Commands::End::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.webRTCSessionID = self.webRTCSessionID.unsignedShortValue; + } + { + encodableStruct.reason = static_cast>(self.reason.unsignedCharValue); + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + @implementation MTRChimeClusterPlayChimeSoundParams - (instancetype)init { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h index 144ee696af..b6345356d4 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h @@ -2074,6 +2074,30 @@ NS_ASSUME_NONNULL_BEGIN @end +@interface MTRWebRTCTransportRequestorClusterOfferParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRWebRTCTransportRequestorClusterAnswerParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRWebRTCTransportRequestorClusterICECandidateParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRWebRTCTransportRequestorClusterEndParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + @interface MTRChimeClusterPlayChimeSoundParams (InternalMethods) - (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm index 91f69fd4e1..c330d2bb0d 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm @@ -1133,6 +1133,15 @@ static BOOL CommandNeedsTimedInvokeInWebRTCTransportProviderCluster(AttributeId } } } +static BOOL CommandNeedsTimedInvokeInWebRTCTransportRequestorCluster(AttributeId aAttributeId) +{ + using namespace Clusters::WebRTCTransportRequestor; + switch (aAttributeId) { + default: { + return NO; + } + } +} static BOOL CommandNeedsTimedInvokeInChimeCluster(AttributeId aAttributeId) { using namespace Clusters::Chime; @@ -1533,6 +1542,9 @@ BOOL MTRCommandNeedsTimedInvoke(NSNumber * _Nonnull aClusterID, NSNumber * _Nonn case Clusters::WebRTCTransportProvider::Id: { return CommandNeedsTimedInvokeInWebRTCTransportProviderCluster(commandID); } + case Clusters::WebRTCTransportRequestor::Id: { + return CommandNeedsTimedInvokeInWebRTCTransportRequestorCluster(commandID); + } case Clusters::Chime::Id: { return CommandNeedsTimedInvokeInChimeCluster(commandID); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm index 5a10da85b1..0ef12bcbba 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -4555,6 +4555,18 @@ static id _Nullable DecodeEventPayloadForWebRTCTransportProviderCluster(EventId *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; return nil; } +static id _Nullable DecodeEventPayloadForWebRTCTransportRequestorCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::WebRTCTransportRequestor; + switch (aEventId) { + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + return nil; +} static id _Nullable DecodeEventPayloadForChimeCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { using namespace Clusters::Chime; @@ -5160,6 +5172,9 @@ id _Nullable MTRDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVRead case Clusters::WebRTCTransportProvider::Id: { return DecodeEventPayloadForWebRTCTransportProviderCluster(aPath.mEventId, aReader, aError); } + case Clusters::WebRTCTransportRequestor::Id: { + return DecodeEventPayloadForWebRTCTransportRequestorCluster(aPath.mEventId, aReader, aError); + } case Clusters::Chime::Id: { return DecodeEventPayloadForChimeCluster(aPath.mEventId, aReader, aError); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index bb93511dbf..fa103214b8 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -2136,6 +2136,25 @@ MTR_PROVISIONALLY_AVAILABLE @property (nonatomic, copy) NSNumber * _Nonnull metadataOptions MTR_PROVISIONALLY_AVAILABLE; @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRWebRTCTransportRequestorClusterICEServerStruct : NSObject +@property (nonatomic, copy) NSArray * _Nonnull urls MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nullable username MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nullable credential MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable caid MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRWebRTCTransportRequestorClusterWebRTCSessionStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull id MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull peerNodeID MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull peerFabricIndex MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull streamType MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable videoStreamID MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable audioStreamID MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull metadataOptions MTR_PROVISIONALLY_AVAILABLE; +@end + MTR_PROVISIONALLY_AVAILABLE @interface MTRChimeClusterChimeSoundStruct : NSObject @property (nonatomic, copy) NSNumber * _Nonnull chimeID MTR_PROVISIONALLY_AVAILABLE; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index 6ba439eb02..e8153706aa 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -8849,6 +8849,87 @@ - (NSString *)description @end +@implementation MTRWebRTCTransportRequestorClusterICEServerStruct +- (instancetype)init +{ + if (self = [super init]) { + + _urls = [NSArray array]; + + _username = nil; + + _credential = nil; + + _caid = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRWebRTCTransportRequestorClusterICEServerStruct alloc] init]; + + other.urls = self.urls; + other.username = self.username; + other.credential = self.credential; + other.caid = self.caid; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: urls:%@; username:%@; credential:%@; caid:%@; >", NSStringFromClass([self class]), _urls, _username, _credential, _caid]; + return descriptionString; +} + +@end + +@implementation MTRWebRTCTransportRequestorClusterWebRTCSessionStruct +- (instancetype)init +{ + if (self = [super init]) { + + _id = @(0); + + _peerNodeID = @(0); + + _peerFabricIndex = @(0); + + _streamType = @(0); + + _videoStreamID = nil; + + _audioStreamID = nil; + + _metadataOptions = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRWebRTCTransportRequestorClusterWebRTCSessionStruct alloc] init]; + + other.id = self.id; + other.peerNodeID = self.peerNodeID; + other.peerFabricIndex = self.peerFabricIndex; + other.streamType = self.streamType; + other.videoStreamID = self.videoStreamID; + other.audioStreamID = self.audioStreamID; + other.metadataOptions = self.metadataOptions; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: id:%@; peerNodeID:%@; peerFabricIndex:%@; streamType:%@; videoStreamID:%@; audioStreamID:%@; metadataOptions:%@; >", NSStringFromClass([self class]), _id, _peerNodeID, _peerFabricIndex, _streamType, _videoStreamID, _audioStreamID, _metadataOptions]; + return descriptionString; +} + +@end + @implementation MTRChimeClusterChimeSoundStruct - (instancetype)init { 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 f6a64990ad..3141e1562a 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 @@ -37405,6 +37405,106 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) } // namespace Attributes } // namespace WebRTCTransportProvider +namespace WebRTCTransportRequestor { +namespace Attributes { + +namespace FeatureMap { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::WebRTCTransportRequestor::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::WebRTCTransportRequestor::Id, Id), + EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::WebRTCTransportRequestor::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); +} + +} // namespace FeatureMap + +namespace ClusterRevision { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::WebRTCTransportRequestor::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::WebRTCTransportRequestor::Id, Id), + EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::WebRTCTransportRequestor::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace WebRTCTransportRequestor + namespace Chime { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index 327355fb03..30641f2c4d 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 @@ -5659,6 +5659,24 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, Mar } // namespace Attributes } // namespace WebRTCTransportProvider +namespace WebRTCTransportRequestor { +namespace Attributes { + +namespace FeatureMap { +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value); // bitmap32 +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty); +} // namespace FeatureMap + +namespace ClusterRevision { +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace WebRTCTransportRequestor + namespace Chime { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h index 791d9c0ca8..61bd0a4962 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -623,6 +623,11 @@ void emberAfContentAppObserverClusterInitCallback(chip::EndpointId endpoint); */ void emberAfWebRTCTransportProviderClusterInitCallback(chip::EndpointId endpoint); +/** + * @param endpoint Endpoint that is being initialized + */ +void emberAfWebRTCTransportRequestorClusterInitCallback(chip::EndpointId endpoint); + /** * @param endpoint Endpoint that is being initialized */ @@ -5215,6 +5220,44 @@ chip::Protocols::InteractionModel::Status MatterWebRTCTransportProviderClusterSe */ void emberAfWebRTCTransportProviderClusterServerTickCallback(chip::EndpointId endpoint); +// +// WebRTC Transport Requestor Cluster +// + +/** + * @param endpoint Endpoint that is being initialized + */ +void emberAfWebRTCTransportRequestorClusterServerInitCallback(chip::EndpointId endpoint); + +/** + * @param endpoint Endpoint that is being shutdown + */ +void MatterWebRTCTransportRequestorClusterServerShutdownCallback(chip::EndpointId endpoint); + +/** + * @param endpoint Endpoint that is being initialized + */ +void emberAfWebRTCTransportRequestorClusterClientInitCallback(chip::EndpointId endpoint); + +/** + * @param attributePath Concrete attribute path that changed + */ +void MatterWebRTCTransportRequestorClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); + +/** + * @param attributePath Concrete attribute path to be changed + * @param attributeType Attribute type + * @param size Attribute size + * @param value Attribute value + */ +chip::Protocols::InteractionModel::Status MatterWebRTCTransportRequestorClusterServerPreAttributeChangedCallback( + const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); + +/** + * @param endpoint Endpoint that is being served + */ +void emberAfWebRTCTransportRequestorClusterServerTickCallback(chip::EndpointId endpoint); + // // Chime Cluster // @@ -6674,6 +6717,30 @@ bool emberAfWebRTCTransportProviderClusterProvideICECandidateCallback( bool emberAfWebRTCTransportProviderClusterEndSessionCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::WebRTCTransportProvider::Commands::EndSession::DecodableType & commandData); +/** + * @brief WebRTC Transport Requestor Cluster Offer Command callback (from client) + */ +bool emberAfWebRTCTransportRequestorClusterOfferCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::WebRTCTransportRequestor::Commands::Offer::DecodableType & commandData); +/** + * @brief WebRTC Transport Requestor Cluster Answer Command callback (from client) + */ +bool emberAfWebRTCTransportRequestorClusterAnswerCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::WebRTCTransportRequestor::Commands::Answer::DecodableType & commandData); +/** + * @brief WebRTC Transport Requestor Cluster ICECandidate Command callback (from client) + */ +bool emberAfWebRTCTransportRequestorClusterICECandidateCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::WebRTCTransportRequestor::Commands::ICECandidate::DecodableType & commandData); +/** + * @brief WebRTC Transport Requestor Cluster End Command callback (from client) + */ +bool emberAfWebRTCTransportRequestorClusterEndCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::WebRTCTransportRequestor::Commands::End::DecodableType & commandData); /** * @brief Chime Cluster PlayChimeSound Command callback (from client) */ diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h index 8a53e03c83..8829a72561 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 @@ -5457,6 +5457,15 @@ using WebRTCEndReasonEnum = Clusters::detail::WebRTCEndReasonEnum; using WebRTCMetadataOptions = Clusters::detail::WebRTCMetadataOptions; } // namespace WebRTCTransportProvider +namespace WebRTCTransportRequestor { + +using StreamTypeEnum = Clusters::detail::StreamTypeEnum; + +using WebRTCEndReasonEnum = Clusters::detail::WebRTCEndReasonEnum; + +using WebRTCMetadataOptions = Clusters::detail::WebRTCMetadataOptions; +} // namespace WebRTCTransportRequestor + namespace Chime {} // namespace Chime namespace EcosystemInformation {} // namespace EcosystemInformation diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index 7c024f24f4..05164fb2f7 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -28967,6 +28967,206 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events } // namespace WebRTCTransportProvider +namespace WebRTCTransportRequestor { +namespace Structs {} // namespace Structs + +namespace Commands { +namespace Offer { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kWebRTCSessionID), webRTCSessionID); + encoder.Encode(to_underlying(Fields::kSdp), sdp); + encoder.Encode(to_underlying(Fields::kICEServers), ICEServers); + encoder.Encode(to_underlying(Fields::kICETransportPolicy), ICETransportPolicy); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kWebRTCSessionID)) + { + err = DataModel::Decode(reader, webRTCSessionID); + } + else if (__context_tag == to_underlying(Fields::kSdp)) + { + err = DataModel::Decode(reader, sdp); + } + else if (__context_tag == to_underlying(Fields::kICEServers)) + { + err = DataModel::Decode(reader, ICEServers); + } + else if (__context_tag == to_underlying(Fields::kICETransportPolicy)) + { + err = DataModel::Decode(reader, ICETransportPolicy); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace Offer. +namespace Answer { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kWebRTCSessionID), webRTCSessionID); + encoder.Encode(to_underlying(Fields::kSdp), sdp); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kWebRTCSessionID)) + { + err = DataModel::Decode(reader, webRTCSessionID); + } + else if (__context_tag == to_underlying(Fields::kSdp)) + { + err = DataModel::Decode(reader, sdp); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace Answer. +namespace ICECandidate { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kWebRTCSessionID), webRTCSessionID); + encoder.Encode(to_underlying(Fields::kICECandidate), ICECandidate); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kWebRTCSessionID)) + { + err = DataModel::Decode(reader, webRTCSessionID); + } + else if (__context_tag == to_underlying(Fields::kICECandidate)) + { + err = DataModel::Decode(reader, ICECandidate); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace ICECandidate. +namespace End { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kWebRTCSessionID), webRTCSessionID); + encoder.Encode(to_underlying(Fields::kReason), reason); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kWebRTCSessionID)) + { + err = DataModel::Decode(reader, webRTCSessionID); + } + else if (__context_tag == to_underlying(Fields::kReason)) + { + err = DataModel::Decode(reader, reason); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace End. +} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::CurrentSessions::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, currentSessions); + case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, generatedCommandList); + case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, acceptedCommandList); + case Attributes::EventList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, eventList); + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, attributeList); + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, featureMap); + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, clusterRevision); + default: + return CHIP_NO_ERROR; + } +} +} // namespace Attributes + +namespace Events {} // namespace Events + +} // namespace WebRTCTransportRequestor namespace Chime { namespace Structs { @@ -32997,6 +33197,13 @@ bool CommandIsFabricScoped(ClusterId aCluster, CommandId aCommand) return false; } } + case Clusters::WebRTCTransportRequestor::Id: { + switch (aCommand) + { + default: + return false; + } + } case Clusters::Chime::Id: { switch (aCommand) { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 0df61a5885..19baf37416 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 @@ -41683,6 +41683,259 @@ struct TypeInfo }; } // namespace Attributes } // namespace WebRTCTransportProvider +namespace WebRTCTransportRequestor { +namespace Structs { +namespace ICEServerStruct = Clusters::detail::Structs::ICEServerStruct; +namespace WebRTCSessionStruct = Clusters::detail::Structs::WebRTCSessionStruct; +} // namespace Structs + +namespace Commands { +// Forward-declarations so we can reference these later. + +namespace Offer { +struct Type; +struct DecodableType; +} // namespace Offer + +namespace Answer { +struct Type; +struct DecodableType; +} // namespace Answer + +namespace ICECandidate { +struct Type; +struct DecodableType; +} // namespace ICECandidate + +namespace End { +struct Type; +struct DecodableType; +} // namespace End + +} // namespace Commands + +namespace Commands { +namespace Offer { +enum class Fields : uint8_t +{ + kWebRTCSessionID = 0, + kSdp = 1, + kICEServers = 2, + kICETransportPolicy = 3, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::Offer::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportRequestor::Id; } + + uint16_t webRTCSessionID = static_cast(0); + chip::CharSpan sdp; + Optional> ICEServers; + Optional ICETransportPolicy; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::Offer::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportRequestor::Id; } + + uint16_t webRTCSessionID = static_cast(0); + chip::CharSpan sdp; + Optional> ICEServers; + Optional ICETransportPolicy; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace Offer +namespace Answer { +enum class Fields : uint8_t +{ + kWebRTCSessionID = 0, + kSdp = 1, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::Answer::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportRequestor::Id; } + + uint16_t webRTCSessionID = static_cast(0); + chip::CharSpan sdp; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::Answer::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportRequestor::Id; } + + uint16_t webRTCSessionID = static_cast(0); + chip::CharSpan sdp; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace Answer +namespace ICECandidate { +enum class Fields : uint8_t +{ + kWebRTCSessionID = 0, + kICECandidate = 1, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::ICECandidate::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportRequestor::Id; } + + uint16_t webRTCSessionID = static_cast(0); + chip::CharSpan ICECandidate; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::ICECandidate::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportRequestor::Id; } + + uint16_t webRTCSessionID = static_cast(0); + chip::CharSpan ICECandidate; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace ICECandidate +namespace End { +enum class Fields : uint8_t +{ + kWebRTCSessionID = 0, + kReason = 1, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::End::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportRequestor::Id; } + + uint16_t webRTCSessionID = static_cast(0); + WebRTCEndReasonEnum reason = static_cast(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::End::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportRequestor::Id; } + + uint16_t webRTCSessionID = static_cast(0); + WebRTCEndReasonEnum reason = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace End +} // namespace Commands + +namespace Attributes { + +namespace CurrentSessions { +struct TypeInfo +{ + using Type = + chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList< + chip::app::Clusters::WebRTCTransportRequestor::Structs::WebRTCSessionStruct::DecodableType>; + using DecodableArgType = const chip::app::DataModel::DecodableList< + chip::app::Clusters::WebRTCTransportRequestor::Structs::WebRTCSessionStruct::DecodableType> &; + + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportRequestor::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::CurrentSessions::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace CurrentSessions +namespace GeneratedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportRequestor::Id; } +}; +} // namespace GeneratedCommandList +namespace AcceptedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportRequestor::Id; } +}; +} // namespace AcceptedCommandList +namespace EventList { +struct TypeInfo : public Clusters::Globals::Attributes::EventList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportRequestor::Id; } +}; +} // namespace EventList +namespace AttributeList { +struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportRequestor::Id; } +}; +} // namespace AttributeList +namespace FeatureMap { +struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportRequestor::Id; } +}; +} // namespace FeatureMap +namespace ClusterRevision { +struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportRequestor::Id; } +}; +} // namespace ClusterRevision + +struct TypeInfo +{ + struct DecodableType + { + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportRequestor::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); + + Attributes::CurrentSessions::TypeInfo::DecodableType currentSessions; + Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; + Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; + Attributes::EventList::TypeInfo::DecodableType eventList; + Attributes::AttributeList::TypeInfo::DecodableType attributeList; + Attributes::FeatureMap::TypeInfo::DecodableType featureMap = static_cast(0); + Attributes::ClusterRevision::TypeInfo::DecodableType clusterRevision = static_cast(0); + }; +}; +} // namespace Attributes +} // namespace WebRTCTransportRequestor namespace Chime { namespace Structs { namespace ChimeSoundStruct { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h index 80159cd477..88942771fa 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h @@ -7351,6 +7351,40 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace WebRTCTransportProvider +namespace WebRTCTransportRequestor { +namespace Attributes { + +namespace CurrentSessions { +static constexpr AttributeId Id = 0x00000000; +} // namespace CurrentSessions + +namespace GeneratedCommandList { +static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id; +} // namespace GeneratedCommandList + +namespace AcceptedCommandList { +static constexpr AttributeId Id = Globals::Attributes::AcceptedCommandList::Id; +} // namespace AcceptedCommandList + +namespace EventList { +static constexpr AttributeId Id = Globals::Attributes::EventList::Id; +} // namespace EventList + +namespace AttributeList { +static constexpr AttributeId Id = Globals::Attributes::AttributeList::Id; +} // namespace AttributeList + +namespace FeatureMap { +static constexpr AttributeId Id = Globals::Attributes::FeatureMap::Id; +} // namespace FeatureMap + +namespace ClusterRevision { +static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace WebRTCTransportRequestor + namespace Chime { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h index 9c0523e865..f7139e2756 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h @@ -379,6 +379,9 @@ static constexpr ClusterId Id = 0x00000510; namespace WebRTCTransportProvider { static constexpr ClusterId Id = 0x00000553; } // namespace WebRTCTransportProvider +namespace WebRTCTransportRequestor { +static constexpr ClusterId Id = 0x00000554; +} // namespace WebRTCTransportRequestor namespace Chime { static constexpr ClusterId Id = 0x00000556; } // namespace Chime diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h index 49e738a1ac..da67d0d999 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h @@ -1837,6 +1837,28 @@ static constexpr CommandId Id = 0x00000007; } // namespace Commands } // namespace WebRTCTransportProvider +namespace WebRTCTransportRequestor { +namespace Commands { + +namespace Offer { +static constexpr CommandId Id = 0x00000001; +} // namespace Offer + +namespace Answer { +static constexpr CommandId Id = 0x00000002; +} // namespace Answer + +namespace ICECandidate { +static constexpr CommandId Id = 0x00000003; +} // namespace ICECandidate + +namespace End { +static constexpr CommandId Id = 0x00000004; +} // namespace End + +} // namespace Commands +} // namespace WebRTCTransportRequestor + namespace Chime { namespace Commands { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 388af146a0..1bbecf1c4b 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -153,6 +153,7 @@ | ContentControl | 0x050F | | ContentAppObserver | 0x0510 | | WebRTCTransportProvider | 0x0553 | +| WebRTCTransportRequestor | 0x0554 | | Chime | 0x0556 | | EcosystemInformation | 0x0750 | | CommissionerControl | 0x0751 | @@ -13881,6 +13882,186 @@ class WebRTCTransportProviderEndSession : public ClusterCommand chip::app::Clusters::WebRTCTransportProvider::Commands::EndSession::Type mRequest; }; +/*----------------------------------------------------------------------------*\ +| Cluster WebRTCTransportRequestor | 0x0554 | +|------------------------------------------------------------------------------| +| Commands: | | +| * Offer | 0x01 | +| * Answer | 0x02 | +| * ICECandidate | 0x03 | +| * End | 0x04 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * CurrentSessions | 0x0000 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + +/* + * Command Offer + */ +class WebRTCTransportRequestorOffer : public ClusterCommand +{ +public: + WebRTCTransportRequestorOffer(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("offer", credsIssuerConfig), mComplex_ICEServers(&mRequest.ICEServers) + { + AddArgument("WebRTCSessionID", 0, UINT16_MAX, &mRequest.webRTCSessionID); + AddArgument("Sdp", &mRequest.sdp); + AddArgument("ICEServers", &mComplex_ICEServers, "", Argument::kOptional); + AddArgument("ICETransportPolicy", &mRequest.ICETransportPolicy); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportRequestor::Commands::Offer::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportRequestor::Commands::Offer::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::WebRTCTransportRequestor::Commands::Offer::Type mRequest; + TypedComplexArgument>> + mComplex_ICEServers; +}; + +/* + * Command Answer + */ +class WebRTCTransportRequestorAnswer : public ClusterCommand +{ +public: + WebRTCTransportRequestorAnswer(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("answer", credsIssuerConfig) + { + AddArgument("WebRTCSessionID", 0, UINT16_MAX, &mRequest.webRTCSessionID); + AddArgument("Sdp", &mRequest.sdp); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportRequestor::Commands::Answer::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportRequestor::Commands::Answer::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::WebRTCTransportRequestor::Commands::Answer::Type mRequest; +}; + +/* + * Command ICECandidate + */ +class WebRTCTransportRequestorICECandidate : public ClusterCommand +{ +public: + WebRTCTransportRequestorICECandidate(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("icecandidate", credsIssuerConfig) + { + AddArgument("WebRTCSessionID", 0, UINT16_MAX, &mRequest.webRTCSessionID); + AddArgument("ICECandidate", &mRequest.ICECandidate); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportRequestor::Commands::ICECandidate::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportRequestor::Commands::ICECandidate::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::WebRTCTransportRequestor::Commands::ICECandidate::Type mRequest; +}; + +/* + * Command End + */ +class WebRTCTransportRequestorEnd : public ClusterCommand +{ +public: + WebRTCTransportRequestorEnd(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("end", credsIssuerConfig) + { + AddArgument("WebRTCSessionID", 0, UINT16_MAX, &mRequest.webRTCSessionID); + AddArgument("Reason", 0, UINT8_MAX, &mRequest.reason); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportRequestor::Commands::End::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportRequestor::Commands::End::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::WebRTCTransportRequestor::Commands::End::Type mRequest; +}; + /*----------------------------------------------------------------------------*\ | Cluster Chime | 0x0556 | |------------------------------------------------------------------------------| @@ -26523,6 +26704,66 @@ void registerClusterWebRTCTransportProvider(Commands & commands, CredentialIssue commands.RegisterCluster(clusterName, clusterCommands); } +void registerClusterWebRTCTransportRequestor(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) +{ + using namespace chip::app::Clusters::WebRTCTransportRequestor; + + const char * clusterName = "WebRTCTransportRequestor"; + + commands_list clusterCommands = { + // + // Commands + // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + // + // Attributes + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "current-sessions", Attributes::CurrentSessions::Id, credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + make_unique>(Id, credsIssuerConfig), // + make_unique>>( + Id, "current-sessions", Attributes::CurrentSessions::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>>( + Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "event-list", Attributes::EventList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "attribute-list", Attributes::AttributeList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "feature-map", 0, UINT32_MAX, Attributes::FeatureMap::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "cluster-revision", 0, UINT16_MAX, Attributes::ClusterRevision::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "current-sessions", Attributes::CurrentSessions::Id, credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + // + // Events + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + }; + + commands.RegisterCluster(clusterName, clusterCommands); +} void registerClusterChime(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) { using namespace chip::app::Clusters::Chime; @@ -27452,6 +27693,7 @@ void registerClusters(Commands & commands, CredentialIssuerCommands * credsIssue registerClusterContentControl(commands, credsIssuerConfig); registerClusterContentAppObserver(commands, credsIssuerConfig); registerClusterWebRTCTransportProvider(commands, credsIssuerConfig); + registerClusterWebRTCTransportRequestor(commands, credsIssuerConfig); registerClusterChime(commands, credsIssuerConfig); registerClusterEcosystemInformation(commands, credsIssuerConfig); registerClusterCommissionerControl(commands, credsIssuerConfig); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index 917ba818bc..c6682c0350 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -18118,6 +18118,49 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } + case WebRTCTransportRequestor::Id: { + switch (path.mAttributeId) + { + case WebRTCTransportRequestor::Attributes::CurrentSessions::Id: { + chip::app::DataModel::DecodableList< + chip::app::Clusters::WebRTCTransportRequestor::Structs::WebRTCSessionStruct::DecodableType> + value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("CurrentSessions", 1, value); + } + case WebRTCTransportRequestor::Attributes::GeneratedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, WebRTCTransportRequestor::Id); + } + case WebRTCTransportRequestor::Attributes::AcceptedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, WebRTCTransportRequestor::Id); + } + case WebRTCTransportRequestor::Attributes::EventList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("EventList", 1, value); + } + case WebRTCTransportRequestor::Attributes::AttributeList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, WebRTCTransportRequestor::Id); + } + case WebRTCTransportRequestor::Attributes::FeatureMap::Id: { + uint32_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("FeatureMap", 1, value); + } + case WebRTCTransportRequestor::Attributes::ClusterRevision::Id: { + uint16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ClusterRevision", 1, value); + } + } + break; + } case Chime::Id: { switch (path.mAttributeId) { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp index cbf31dc81d..1ff61d2e84 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp @@ -261,6 +261,8 @@ char const * ClusterIdToText(chip::ClusterId id) return "ContentAppObserver"; case chip::app::Clusters::WebRTCTransportProvider::Id: return "WebRTCTransportProvider"; + case chip::app::Clusters::WebRTCTransportRequestor::Id: + return "WebRTCTransportRequestor"; case chip::app::Clusters::Chime::Id: return "Chime"; case chip::app::Clusters::EcosystemInformation::Id: @@ -4402,6 +4404,27 @@ char const * AttributeIdToText(chip::ClusterId cluster, chip::AttributeId id) return "Unknown"; } } + case chip::app::Clusters::WebRTCTransportRequestor::Id: { + switch (id) + { + case chip::app::Clusters::WebRTCTransportRequestor::Attributes::CurrentSessions::Id: + return "CurrentSessions"; + case chip::app::Clusters::WebRTCTransportRequestor::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::WebRTCTransportRequestor::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::WebRTCTransportRequestor::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::WebRTCTransportRequestor::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::WebRTCTransportRequestor::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::WebRTCTransportRequestor::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } case chip::app::Clusters::Chime::Id: { switch (id) { @@ -5770,6 +5793,21 @@ char const * AcceptedCommandIdToText(chip::ClusterId cluster, chip::CommandId id return "Unknown"; } } + case chip::app::Clusters::WebRTCTransportRequestor::Id: { + switch (id) + { + case chip::app::Clusters::WebRTCTransportRequestor::Commands::Offer::Id: + return "Offer"; + case chip::app::Clusters::WebRTCTransportRequestor::Commands::Answer::Id: + return "Answer"; + case chip::app::Clusters::WebRTCTransportRequestor::Commands::ICECandidate::Id: + return "ICECandidate"; + case chip::app::Clusters::WebRTCTransportRequestor::Commands::End::Id: + return "End"; + default: + return "Unknown"; + } + } case chip::app::Clusters::Chime::Id: { switch (id) { diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index a2c25c2f47..29dc7b342a 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -155,6 +155,7 @@ | ContentControl | 0x050F | | ContentAppObserver | 0x0510 | | WebRTCTransportProvider | 0x0553 | +| WebRTCTransportRequestor | 0x0554 | | Chime | 0x0556 | | EcosystemInformation | 0x0750 | | CommissionerControl | 0x0751 | @@ -161231,6 +161232,915 @@ class SubscribeAttributeWebRTCTransportProviderClusterRevision : public Subscrib } }; +#endif // MTR_ENABLE_PROVISIONAL +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/*----------------------------------------------------------------------------*\ +| Cluster WebRTCTransportRequestor | 0x0554 | +|------------------------------------------------------------------------------| +| Commands: | | +| * Offer | 0x01 | +| * Answer | 0x02 | +| * ICECandidate | 0x03 | +| * End | 0x04 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * CurrentSessions | 0x0000 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + +#if MTR_ENABLE_PROVISIONAL +/* + * Command Offer + */ +class WebRTCTransportRequestorOffer : public ClusterCommand { +public: + WebRTCTransportRequestorOffer() + : ClusterCommand("offer") + , mComplex_ICEServers(&mRequest.ICEServers) + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("WebRTCSessionID", 0, UINT16_MAX, &mRequest.webRTCSessionID); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("Sdp", &mRequest.sdp); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("ICEServers", &mComplex_ICEServers); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("ICETransportPolicy", &mRequest.ICETransportPolicy); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportRequestor::Commands::Offer::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportRequestor alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWebRTCTransportRequestorClusterOfferParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.webRTCSessionID = [NSNumber numberWithUnsignedShort:mRequest.webRTCSessionID]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.sdp = [[NSString alloc] initWithBytes:mRequest.sdp.data() length:mRequest.sdp.size() encoding:NSUTF8StringEncoding]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + if (mRequest.ICEServers.HasValue()) { + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + for (auto & entry_1 : mRequest.ICEServers.Value()) { + MTRWebRTCTransportRequestorClusterICEServerStruct * newElement_1; + newElement_1 = [MTRWebRTCTransportRequestorClusterICEServerStruct new]; + { // Scope for our temporary variables + auto * array_3 = [NSMutableArray new]; + for (auto & entry_3 : entry_1.urls) { + NSString * newElement_3; + newElement_3 = [[NSString alloc] initWithBytes:entry_3.data() length:entry_3.size() encoding:NSUTF8StringEncoding]; + [array_3 addObject:newElement_3]; + } + newElement_1.urls = array_3; + } + if (entry_1.username.HasValue()) { + newElement_1.username = [[NSString alloc] initWithBytes:entry_1.username.Value().data() length:entry_1.username.Value().size() encoding:NSUTF8StringEncoding]; + } else { + newElement_1.username = nil; + } + if (entry_1.credential.HasValue()) { + newElement_1.credential = [[NSString alloc] initWithBytes:entry_1.credential.Value().data() length:entry_1.credential.Value().size() encoding:NSUTF8StringEncoding]; + } else { + newElement_1.credential = nil; + } + if (entry_1.caid.HasValue()) { + newElement_1.caid = [NSNumber numberWithUnsignedShort:entry_1.caid.Value()]; + } else { + newElement_1.caid = nil; + } + [array_1 addObject:newElement_1]; + } + params.iceServers = array_1; + } + } else { + params.iceServers = nil; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + if (mRequest.ICETransportPolicy.HasValue()) { + params.iceTransportPolicy = [[NSString alloc] initWithBytes:mRequest.ICETransportPolicy.Value().data() length:mRequest.ICETransportPolicy.Value().size() encoding:NSUTF8StringEncoding]; + } else { + params.iceTransportPolicy = nil; + } +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster offerWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::WebRTCTransportRequestor::Commands::Offer::Type mRequest; + TypedComplexArgument>> mComplex_ICEServers; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command Answer + */ +class WebRTCTransportRequestorAnswer : public ClusterCommand { +public: + WebRTCTransportRequestorAnswer() + : ClusterCommand("answer") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("WebRTCSessionID", 0, UINT16_MAX, &mRequest.webRTCSessionID); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("Sdp", &mRequest.sdp); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportRequestor::Commands::Answer::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportRequestor alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWebRTCTransportRequestorClusterAnswerParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.webRTCSessionID = [NSNumber numberWithUnsignedShort:mRequest.webRTCSessionID]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.sdp = [[NSString alloc] initWithBytes:mRequest.sdp.data() length:mRequest.sdp.size() encoding:NSUTF8StringEncoding]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster answerWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::WebRTCTransportRequestor::Commands::Answer::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command ICECandidate + */ +class WebRTCTransportRequestorICECandidate : public ClusterCommand { +public: + WebRTCTransportRequestorICECandidate() + : ClusterCommand("icecandidate") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("WebRTCSessionID", 0, UINT16_MAX, &mRequest.webRTCSessionID); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("ICECandidate", &mRequest.ICECandidate); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportRequestor::Commands::ICECandidate::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportRequestor alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWebRTCTransportRequestorClusterICECandidateParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.webRTCSessionID = [NSNumber numberWithUnsignedShort:mRequest.webRTCSessionID]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.iceCandidate = [[NSString alloc] initWithBytes:mRequest.ICECandidate.data() length:mRequest.ICECandidate.size() encoding:NSUTF8StringEncoding]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster ICECandidateWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::WebRTCTransportRequestor::Commands::ICECandidate::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command End + */ +class WebRTCTransportRequestorEnd : public ClusterCommand { +public: + WebRTCTransportRequestorEnd() + : ClusterCommand("end") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("WebRTCSessionID", 0, UINT16_MAX, &mRequest.webRTCSessionID); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("Reason", 0, UINT8_MAX, &mRequest.reason); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportRequestor::Commands::End::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportRequestor alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWebRTCTransportRequestorClusterEndParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.webRTCSessionID = [NSNumber numberWithUnsignedShort:mRequest.webRTCSessionID]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.reason = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.reason)]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster endWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::WebRTCTransportRequestor::Commands::End::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL + +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute CurrentSessions + */ +class ReadWebRTCTransportRequestorCurrentSessions : public ReadAttribute { +public: + ReadWebRTCTransportRequestorCurrentSessions() + : ReadAttribute("current-sessions") + { + } + + ~ReadWebRTCTransportRequestorCurrentSessions() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::WebRTCTransportRequestor::Attributes::CurrentSessions::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportRequestor alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeCurrentSessionsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"WebRTCTransportRequestor.CurrentSessions response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("WebRTCTransportRequestor CurrentSessions read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeWebRTCTransportRequestorCurrentSessions : public SubscribeAttribute { +public: + SubscribeAttributeWebRTCTransportRequestorCurrentSessions() + : SubscribeAttribute("current-sessions") + { + } + + ~SubscribeAttributeWebRTCTransportRequestorCurrentSessions() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::WebRTCTransportRequestor::Attributes::CurrentSessions::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportRequestor alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeCurrentSessionsWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"WebRTCTransportRequestor.CurrentSessions response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute GeneratedCommandList + */ +class ReadWebRTCTransportRequestorGeneratedCommandList : public ReadAttribute { +public: + ReadWebRTCTransportRequestorGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadWebRTCTransportRequestorGeneratedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::WebRTCTransportRequestor::Attributes::GeneratedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportRequestor alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"WebRTCTransportRequestor.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("WebRTCTransportRequestor GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeWebRTCTransportRequestorGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeWebRTCTransportRequestorGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributeWebRTCTransportRequestorGeneratedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::WebRTCTransportRequestor::Attributes::GeneratedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportRequestor alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeGeneratedCommandListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"WebRTCTransportRequestor.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute AcceptedCommandList + */ +class ReadWebRTCTransportRequestorAcceptedCommandList : public ReadAttribute { +public: + ReadWebRTCTransportRequestorAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadWebRTCTransportRequestorAcceptedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::WebRTCTransportRequestor::Attributes::AcceptedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportRequestor alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"WebRTCTransportRequestor.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("WebRTCTransportRequestor AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeWebRTCTransportRequestorAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeWebRTCTransportRequestorAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributeWebRTCTransportRequestorAcceptedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::WebRTCTransportRequestor::Attributes::AcceptedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportRequestor alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAcceptedCommandListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"WebRTCTransportRequestor.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute EventList + */ +class ReadWebRTCTransportRequestorEventList : public ReadAttribute { +public: + ReadWebRTCTransportRequestorEventList() + : ReadAttribute("event-list") + { + } + + ~ReadWebRTCTransportRequestorEventList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::WebRTCTransportRequestor::Attributes::EventList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportRequestor alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"WebRTCTransportRequestor.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("WebRTCTransportRequestor EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeWebRTCTransportRequestorEventList : public SubscribeAttribute { +public: + SubscribeAttributeWebRTCTransportRequestorEventList() + : SubscribeAttribute("event-list") + { + } + + ~SubscribeAttributeWebRTCTransportRequestorEventList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::WebRTCTransportRequestor::Attributes::EventList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportRequestor alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeEventListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"WebRTCTransportRequestor.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute AttributeList + */ +class ReadWebRTCTransportRequestorAttributeList : public ReadAttribute { +public: + ReadWebRTCTransportRequestorAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadWebRTCTransportRequestorAttributeList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::WebRTCTransportRequestor::Attributes::AttributeList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportRequestor alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"WebRTCTransportRequestor.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("WebRTCTransportRequestor AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeWebRTCTransportRequestorAttributeList : public SubscribeAttribute { +public: + SubscribeAttributeWebRTCTransportRequestorAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributeWebRTCTransportRequestorAttributeList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::WebRTCTransportRequestor::Attributes::AttributeList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportRequestor alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAttributeListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"WebRTCTransportRequestor.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute FeatureMap + */ +class ReadWebRTCTransportRequestorFeatureMap : public ReadAttribute { +public: + ReadWebRTCTransportRequestorFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadWebRTCTransportRequestorFeatureMap() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::WebRTCTransportRequestor::Attributes::FeatureMap::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportRequestor alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"WebRTCTransportRequestor.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("WebRTCTransportRequestor FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeWebRTCTransportRequestorFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeWebRTCTransportRequestorFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeWebRTCTransportRequestorFeatureMap() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::WebRTCTransportRequestor::Attributes::FeatureMap::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportRequestor alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeFeatureMapWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"WebRTCTransportRequestor.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute ClusterRevision + */ +class ReadWebRTCTransportRequestorClusterRevision : public ReadAttribute { +public: + ReadWebRTCTransportRequestorClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadWebRTCTransportRequestorClusterRevision() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::WebRTCTransportRequestor::Attributes::ClusterRevision::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportRequestor alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"WebRTCTransportRequestor.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("WebRTCTransportRequestor ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeWebRTCTransportRequestorClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributeWebRTCTransportRequestorClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributeWebRTCTransportRequestorClusterRevision() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::WebRTCTransportRequestor::Attributes::ClusterRevision::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportRequestor alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeClusterRevisionWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"WebRTCTransportRequestor.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + #endif // MTR_ENABLE_PROVISIONAL #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL @@ -185201,6 +186111,63 @@ void registerClusterWebRTCTransportProvider(Commands & commands) commands.RegisterCluster(clusterName, clusterCommands); #endif // MTR_ENABLE_PROVISIONAL } +void registerClusterWebRTCTransportRequestor(Commands & commands) +{ +#if MTR_ENABLE_PROVISIONAL + using namespace chip::app::Clusters::WebRTCTransportRequestor; + + const char * clusterName = "WebRTCTransportRequestor"; + + commands_list clusterCommands = { + make_unique(Id), // +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL + make_unique(Id), // + make_unique(Id), // + make_unique(Id), // +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL + }; + + commands.RegisterCluster(clusterName, clusterCommands); +#endif // MTR_ENABLE_PROVISIONAL +} void registerClusterChime(Commands & commands) { #if MTR_ENABLE_PROVISIONAL @@ -185900,6 +186867,7 @@ void registerClusters(Commands & commands) registerClusterContentControl(commands); registerClusterContentAppObserver(commands); registerClusterWebRTCTransportProvider(commands); + registerClusterWebRTCTransportRequestor(commands); registerClusterChime(commands); registerClusterEcosystemInformation(commands); registerClusterCommissionerControl(commands); From b559f1765838a6f991bf5bc12dec4429e22cf35f Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Mon, 7 Oct 2024 15:59:41 -0400 Subject: [PATCH 019/127] Move some Matter.framework server APIs used only with concrete controllers to the concrete controller class. (#35943) These APIs are never used for XPC controllers, and the base class implementation does not really make sense. --- .../Framework/CHIP/MTRDeviceController.mm | 37 ------------------- .../CHIP/MTRDeviceController_Concrete.h | 18 +++++++++ .../CHIP/MTRDeviceController_Internal.h | 18 --------- 3 files changed, 18 insertions(+), 55 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm index a1872c3020..32f42944e7 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm @@ -691,43 +691,6 @@ - (void)downloadLogFromNodeWithID:(NSNumber *)nodeID }); } -- (NSArray *)accessGrantsForClusterPath:(MTRClusterPath *)clusterPath -{ - assertChipStackLockedByCurrentThread(); - - for (MTRServerEndpoint * endpoint in _serverEndpoints) { - if ([clusterPath.endpoint isEqual:endpoint.endpointID]) { - return [endpoint matterAccessGrantsForCluster:clusterPath.cluster]; - } - } - - // Nothing matched, no grants. - return @[]; -} - -- (nullable NSNumber *)neededReadPrivilegeForClusterID:(NSNumber *)clusterID attributeID:(NSNumber *)attributeID -{ - assertChipStackLockedByCurrentThread(); - - for (MTRServerEndpoint * endpoint in _serverEndpoints) { - for (MTRServerCluster * cluster in endpoint.serverClusters) { - if (![cluster.clusterID isEqual:clusterID]) { - continue; - } - - for (MTRServerAttribute * attr in cluster.attributes) { - if (![attr.attributeID isEqual:attributeID]) { - continue; - } - - return @(attr.requiredReadPrivilege); - } - } - } - - return nil; -} - #ifdef DEBUG + (void)forceLocalhostAdvertisingOnly { diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.h b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.h index e0820d57e0..5df5f501b1 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.h +++ b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.h @@ -17,6 +17,7 @@ #import +#import #import #import #import @@ -131,6 +132,23 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)operationalInstanceAdded:(NSNumber *)nodeID; +/** + * Get the access grants that apply for the given cluster path. + */ +- (NSArray *)accessGrantsForClusterPath:(MTRClusterPath *)clusterPath; + +/** + * Get the privilege level needed to read the given attribute. There's no + * endpoint provided because the expectation is that this information is the + * same for all cluster instances. + * + * Returns nil if we have no such attribute defined on any endpoint, otherwise + * one of MTRAccessControlEntry* constants wrapped in NSNumber. + * + * Only called on the Matter queue. + */ +- (nullable NSNumber *)neededReadPrivilegeForClusterID:(NSNumber *)clusterID attributeID:(NSNumber *)attributeID; + @end NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h b/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h index 958e7914b1..00609d9177 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h @@ -20,7 +20,6 @@ */ #import -#import #import // for MTRClusterPath #import "MTRDeviceConnectionBridge.h" // For MTRInternalDeviceConnectionCallback @@ -210,23 +209,6 @@ NS_ASSUME_NONNULL_BEGIN queue:(dispatch_queue_t)queue completion:(void (^)(NSURL * _Nullable url, NSError * _Nullable error))completion; -/** - * Get the access grants that apply for the given cluster path. - */ -- (NSArray *)accessGrantsForClusterPath:(MTRClusterPath *)clusterPath; - -/** - * Get the privilege level needed to read the given attribute. There's no - * endpoint provided because the expectation is that this information is the - * same for all cluster instances. - * - * Returns nil if we have no such attribute defined on any endpoint, otherwise - * one of MTRAccessControlEntry* constants wrapped in NSNumber. - * - * Only called on the Matter queue. - */ -- (nullable NSNumber *)neededReadPrivilegeForClusterID:(NSNumber *)clusterID attributeID:(NSNumber *)attributeID; - #pragma mark - Device-specific data and SDK access // DeviceController will act as a central repository for this opaque dictionary that MTRDevice manages - (MTRDevice *)deviceForNodeID:(NSNumber *)nodeID; From 55e2a3f89526c69c06b5ec09220a61d68bbf4d59 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Mon, 7 Oct 2024 16:21:47 -0400 Subject: [PATCH 020/127] Remove PASE verifier computation overrides from MTRDeviceController_Concrete. (#35945) The base class implements these selectors already, and its implementation is perfectly fine. --- .../CHIP/MTRDeviceController_Concrete.mm | 29 ------------------- .../CHIP/MTRDeviceController_Internal.h | 2 -- 2 files changed, 31 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm index cb86c5d2db..92d04cd5f3 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm @@ -1231,30 +1231,6 @@ - (BOOL)setOperationalCertificateIssuer:(nullable id)delegate queue:(dispatch_queue_t)queue { auto * delegateShim = [[MTRDevicePairingDelegateShim alloc] initWithDelegate:delegate]; diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h b/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h index 00609d9177..84a8b536ec 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h @@ -247,8 +247,6 @@ static NSString * const kDeviceControllerErrorKeyAllocation = @"Generating new o static NSString * const kDeviceControllerErrorCSRValidation = @"Extracting public key from CSR failed"; static NSString * const kDeviceControllerErrorGetCommissionee = @"Failure obtaining device being commissioned"; static NSString * const kDeviceControllerErrorGetAttestationChallenge = @"Failure getting attestation challenge"; -static NSString * const kDeviceControllerErrorSpake2pVerifierGenerationFailed = @"PASE verifier generation failed"; -static NSString * const kDeviceControllerErrorSpake2pVerifierSerializationFailed = @"PASE verifier serialization failed"; static NSString * const kDeviceControllerErrorCDCertStoreInit = @"Init failure while initializing Certificate Declaration Signing Keys store"; NS_ASSUME_NONNULL_END From 3adf99ef53ada8ab70c9ee3cb167537973c3c5c5 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Mon, 7 Oct 2024 17:20:36 -0400 Subject: [PATCH 021/127] Add a size-display script for binaries. (#35942) * Add a size-display script for binaries. I am currently looking to investigate sizes of our code given the CodegenDataModel work, so adding a script that can display a nice treemap of things received from NM. It is generally hacked-up to display ok data for matter binaries. (i.e. it splits emberAf and Matter as separate entities). It is currently a best-effort. * Restyled by autopep8 * Restyled by isort * Support some zoom and better parenting * Restyled by autopep8 * Update parenting and fix up auto-format * Fix up call suffixes if they contain namespaces * Remove debug print, fix up vtable and thunk * Allow stripping of entire sections - the C section is large and generally not that useful * Strip C by default * Undo default strip: we likely should show the full size because C libs are non-trivial in size --------- Co-authored-by: Restyled.io --- scripts/tools/file_size_from_nm.py | 432 +++++++++++++++++++++++++++++ 1 file changed, 432 insertions(+) create mode 100755 scripts/tools/file_size_from_nm.py diff --git a/scripts/tools/file_size_from_nm.py b/scripts/tools/file_size_from_nm.py new file mode 100755 index 0000000000..a5d53b26dc --- /dev/null +++ b/scripts/tools/file_size_from_nm.py @@ -0,0 +1,432 @@ +#!/usr/bin/env -S python3 -B +# +# 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. +# + +# Displays a treemap code size as read by `nm` over a binary +# +# Example call: +# +# scripts/tools/file_size_from_nm.py \ +# --max-depth 5 \ +# out/nrf-nrf52840dk-light-data-model-enabled/nrfconnect/zephyr/zephyr.elf +# + +# Requires: +# click +# cxxfilt +# coloredlogs +# pandas +# plotly + +import logging +import subprocess +from dataclasses import dataclass +from enum import Enum, auto +from pathlib import Path +from typing import Optional + +import click +import coloredlogs +import cxxfilt +import plotly.express as px +import plotly.graph_objects as go + +# Supported log levels, mapping string values required for argument +# parsing into logging constants +__LOG_LEVELS__ = { + "debug": logging.DEBUG, + "info": logging.INFO, + "warn": logging.WARN, + "fatal": logging.FATAL, +} + + +class ChartStyle(Enum): + TREE_MAP = auto() + SUNBURST = auto() + + +__CHART_STYLES__ = { + "treemap": ChartStyle.TREE_MAP, + "sunburst": ChartStyle.SUNBURST, +} + + +@dataclass +class Symbol: + name: str + symbol_type: str + offset: int + size: int + + +def tree_display_name(name: str) -> list[str]: + """ + Convert the given name from NM into a tree path. + + It splits the name by C++ namespaces, however it also specifically handles + 'emberAf' prefixes to make them common and uses 'vtable for' information + """ + + name = cxxfilt.demangle(name) + + if name.startswith("non-virtual thunk to "): + name = name[21:] + if name.startswith("vtable for "): + name = name[11:] + + # These are C-style methods really, we have no top-level namespaces named + # like this but still want to see these differently + for special_prefix in {"emberAf", "Matter"}: + if name.startswith(special_prefix): + return [special_prefix, name] + + # If the first element contains a space, it is either within `<>` for templates or it means it is a + # separator of the type. Try to find the type separator + # + # Logic: + # - try to find the first space OUTSIDE <> and before '(' + space_pos = 0 + indent = 0 + type_prefix = "" + while space_pos < len(name): + c = name[space_pos] + if c == "<": + indent += 1 + elif c == ">": + indent -= 1 + elif c == " " and indent == 0: + # FOUND A SPACE, move it to the last + type_prefix = name[:space_pos] + " " + space_pos += 1 + name = name[space_pos:] + break + elif c == "(" and indent == 0: + # a bracket not within templates means we are done! + break + space_pos += 1 + + # completely skip any arguments ... i.e. anything after ( + brace_pos = 0 + indent = 0 + type_suffix = "" + while brace_pos < len(name): + c = name[brace_pos] + if c == "<": + indent += 1 + elif c == ">": + indent -= 1 + elif c == "(" and indent == 0: + # FOUND A SPACE, move it to the last + type_suffix = name[brace_pos:] + name = name[:brace_pos] + break + brace_pos += 1 + + # name may be split by namespace and looks like foo::bar::baz + # HOWEVER for templates we want to split foo::Bar::Baz into + # [foo, Bar::Baz] + # + # General way things look like: + # TYPE FUNC # notice the space + # CONSTRUCTOR() + result = [] + while "::" in name: + ns_idx = name.find("::") + less_idx = name.find("<") + if less_idx >= 0 and ns_idx > less_idx: + # at this point, we have to find the matched `>` for this, assuming there ARE + # nested `>` entries, including multiple of them + pos = less_idx + 1 + indent = 1 + while indent > 0: + if name[pos] == ">": + indent -= 1 + elif name[pos] == "<": + indent += 1 + pos += 1 + if pos == len(name): + break + result.append(name[:pos]) + name = name[pos:] + if name.startswith("::"): + name = name[2:] + else: + result.append(name[:ns_idx]) + ns_idx += 2 + name = name[ns_idx:] + result.append(type_prefix + name + type_suffix) + + if len(result) == 1: + if result[0].startswith("ot"): # Show openthread methods a bit grouped + result = ["ot"] + result + return ["C"] + result + + return result + + +# TO run the test, install pytest and do +# pytest file_size_from_nm.py +def test_tree_display_name(): + assert tree_display_name("fooBar") == ["C", "fooBar"] + assert tree_display_name("emberAfTest") == ["emberAf", "emberAfTest"] + assert tree_display_name("MatterSomeCall") == ["Matter", "MatterSomeCall"] + assert tree_display_name("chip::Some::Constructor()") == [ + "chip", + "Some", + "Constructor()", + ] + + assert tree_display_name("chip::Some::Constructor(int arg1, int arg2)") == [ + "chip", + "Some", + "Constructor(int arg1, int arg2)", + ] + + assert tree_display_name( + "chip::Some::Constructor(int arg1, int arg2)" + ) == [ + "chip", + "Some", + "Constructor(int arg1, int arg2)", + ] + + assert tree_display_name("void my::function::call()") == [ + "my", + "function", + "void call()", + ] + assert tree_display_name("chip::ChipError my::function::call()") == [ + "my", + "function", + "chip::ChipError call()", + ] + assert tree_display_name("chip::test::baz my::function::call()") == [ + "my", + "function", + "chip::test::baz call()", + ] + assert tree_display_name( + "chip::test::baz my::function::call()" + ) == [ + "my", + "function", + "chip::test::baz call()", + ] + assert tree_display_name( + "chip::app::CommandIsFabricScoped(unsigned int, unsigned int)" + ) == ["chip", "app", "CommandIsFabricScoped(unsigned int, unsigned int)"] + assert tree_display_name("chip::app::AdvertiseAsOperational()") == [ + "chip", + "app", + "AdvertiseAsOperational()", + ] + + assert tree_display_name( + "void foo::bar::method(my::arg name, other::arg::type)" + ) == ["foo", "bar", "void method(my::arg name, other::arg::type)"] + + +def build_treemap( + name: str, + symbols: list[Symbol], + style: ChartStyle, + max_depth: int, + zoom: Optional[str], + strip: Optional[str], +): + # A treemap is based on parents (with title) + + # Naming rules: + # namespaces/prefixes are "::(::)" + # Actual names will be parented by their suffixes + + root = f"FILE: {name}" + if zoom: + root = root + f" (FILTER: {zoom})" + data: dict[str, list] = dict(name=[root], parent=[""], size=[0], hover=[""]) + + known_parents: set[str] = set() + total_sizes: dict = {} + + for symbol in symbols: + tree_name = tree_display_name(symbol.name) + + if zoom is not None: + partial = "" + # try to filter out the tree name. If it contains the zoom item, keep it, otherwise discard + while tree_name and partial != zoom: + partial += "::" + tree_name[0] + tree_name = tree_name[1:] + if not tree_name: + continue + + if strip is not None: + partial = "" + for part_name in tree_name: + partial = "::" + part_name + if partial == strip: + break + if partial == strip: + continue + + partial = "" + for name in tree_name[:-1]: + next_value = partial + "::" + name + if next_value not in known_parents: + known_parents.add(next_value) + data["name"].append(next_value) + data["parent"].append(partial if partial else root) + data["size"].append(0) + data["hover"].append(next_value) + total_sizes[next_value] = total_sizes.get(next_value, 0) + symbol.size + partial = next_value + + # the name MUST be added + data["name"].append(cxxfilt.demangle(symbol.name)) + data["parent"].append(partial if partial else root) + data["size"].append(symbol.size) + data["hover"].append(f"{symbol.name} of type {symbol.symbol_type}") + + for idx, label in enumerate(data["name"]): + if data["size"][idx] == 0: + data["hover"][idx] = f"{label}: {total_sizes.get(label, 0)}" + + if style == ChartStyle.TREE_MAP: + fig = go.Figure( + go.Treemap( + labels=data["name"], + parents=data["parent"], + values=data["size"], + textinfo="label+value+percent parent", + hovertext=data["hover"], + maxdepth=max_depth, + ) + ) + else: + fig = px.sunburst( + data, + names="name", + parents="parent", + values="size", + maxdepth=max_depth, + ) + + fig.update_traces(root_color="lightgray") + fig.show() + + +@click.command() +@click.option( + "--log-level", + default="INFO", + show_default=True, + type=click.Choice(list(__LOG_LEVELS__.keys()), case_sensitive=False), + help="Determines the verbosity of script output.", +) +@click.option( + "--display-type", + default="TREEMAP", + show_default=True, + type=click.Choice(list(__CHART_STYLES__.keys()), case_sensitive=False), + help="Style of the chart", +) +@click.option( + "--max-depth", + default=4, + show_default=True, + type=int, + help="Display depth by default", +) +@click.option( + "--zoom", + default=None, + help="Zoom in the graph to ONLY the specified path as root (e.g. ::chip::app)", +) +@click.option( + "--strip", + default=None, + help="Strip out a tree subset (e.g. ::C)", +) +@click.argument("elf-file", type=Path) +def main( + log_level, + elf_file: Path, + display_type: str, + max_depth: int, + zoom: Optional[str], + strip: Optional[str], +): + log_fmt = "%(asctime)s %(levelname)-7s %(message)s" + coloredlogs.install(level=__LOG_LEVELS__[log_level], fmt=log_fmt) + + items = subprocess.check_output( + [ + "nm", + "--print-size", + "--size-sort", # Filters out empty entries + "--radix=d", + elf_file.absolute().as_posix(), + ] + ).decode("utf8") + + symbols = [] + + # OUTPUT FORMAT: + # + for line in items.split("\n"): + if not line.strip(): + continue + offset, size, t, name = line.split(" ") + + size = int(size, 10) + offset = int(offset, 10) + + if t in { + # Text section + "t", + "T", + # Weak defines + "w", + "W", + # Initialized data + "d", + "D", + # Readonly + "r", + "R", + # Weak object + "v", + "V", + }: + logging.debug("Found %s of size %d", name, size) + symbols.append(Symbol(name=name, symbol_type=t, offset=offset, size=size)) + elif t in { + # BSS - 0-initialized, not code + "b", + "B", + }: + pass + else: + logging.error("SKIPPING SECTION %s", t) + + build_treemap( + elf_file.name, symbols, __CHART_STYLES__[display_type], max_depth, zoom, strip + ) + + +if __name__ == "__main__": + main(auto_envvar_prefix="CHIP") From 3a7c922137297ed196cc3411eef0827694aab68d Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Mon, 7 Oct 2024 17:23:24 -0400 Subject: [PATCH 022/127] Fix handling of controllerNodeID on non-concrete controllers. (#35946) There isn't actually a _cppCommissioner on the base controller, so that implementation made no sense. In practice, the XPC and concrete controller just have different implementations here, and the base should not try to implement anything. Also fixes the concrete implementation to avoid a sync dispatch by caching the value (which should be immutable) during startup and removes the unnecessary controllerNodeId override from the concrete controller: the base class handles that backwards compat shim already. --- .../Framework/CHIP/MTRDeviceController.mm | 12 +++--------- .../CHIP/MTRDeviceController_Concrete.mm | 19 ++----------------- 2 files changed, 5 insertions(+), 26 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm index 32f42944e7..63fb3b5668 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm @@ -318,16 +318,10 @@ - (void)shutdown // Subclass hook; nothing to do. } -- (NSNumber *)controllerNodeID +- (nullable NSNumber *)controllerNodeID { - auto block = ^NSNumber * { return @(self->_cppCommissioner->GetNodeId()); }; - - NSNumber * nodeID = [self syncRunOnWorkQueueWithReturnValue:block error:nil]; - if (!nodeID) { - MTR_LOG_ERROR("%@ A controller has no node id if it has not been started", self); - } - - return nodeID; + MTR_ABSTRACT_METHOD(); + return nil; } - (BOOL)setupCommissioningSessionWithPayload:(MTRSetupPayload *)payload diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm index 92d04cd5f3..cae4103d0f 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm @@ -141,6 +141,7 @@ @implementation MTRDeviceController_Concrete { @synthesize commissionableBrowser = _commissionableBrowser; @synthesize concurrentSubscriptionPool = _concurrentSubscriptionPool; @synthesize storageBehaviorConfiguration = _storageBehaviorConfiguration; +@synthesize controllerNodeID = _controllerNodeID; - (nullable instancetype)initWithParameters:(MTRDeviceControllerAbstractParameters *)parameters error:(NSError * __autoreleasing *)error @@ -729,6 +730,7 @@ - (BOOL)startup:(MTRDeviceControllerStartupParamsInternal *)startupParams self->_storedFabricIndex = fabricIdx; self->_storedCompressedFabricID = _cppCommissioner->GetCompressedFabricId(); + self->_controllerNodeID = @(_cppCommissioner->GetNodeId()); chip::Crypto::P256PublicKey rootPublicKey; if (_cppCommissioner->GetRootPublicKey(rootPublicKey) == CHIP_NO_ERROR) { @@ -793,18 +795,6 @@ - (BOOL)startup:(MTRDeviceControllerStartupParamsInternal *)startupParams return YES; } -- (NSNumber *)controllerNodeID -{ - auto block = ^NSNumber * { return @(self->_cppCommissioner->GetNodeId()); }; - - NSNumber * nodeID = [self syncRunOnWorkQueueWithReturnValue:block error:nil]; - if (!nodeID) { - MTR_LOG_ERROR("%@ A controller has no node id if it has not been started", self); - } - - return nodeID; -} - static inline void emitMetricForSetupPayload(MTRSetupPayload * payload) { MATTER_LOG_METRIC(kMetricDeviceVendorID, [payload.vendorID unsignedIntValue]); @@ -1712,11 +1702,6 @@ - (instancetype)initWithIssuer:(id)nocChainIssuer; @implementation MTRDeviceController_Concrete (Deprecated) -- (NSNumber *)controllerNodeId -{ - return self.controllerNodeID; -} - - (nullable NSData *)fetchAttestationChallengeForDeviceId:(uint64_t)deviceId { return [self attestationChallengeForDeviceID:@(deviceId)]; From 7fd3d5938a4fad78c386ebd3e033193003207bcf Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Mon, 7 Oct 2024 17:39:12 -0400 Subject: [PATCH 023/127] Clean up asyncGetCommissionerOnMatterQueue on MTRDeviceController. (#35947) MTROperationalCredentialsDelegate always works with a concrete controller. Make that explicit. At that point, asyncGetCommissionerOnMatterQueue can only get called on an MTRDeviceController from and MTRBaseDevice that was created for an XPC controller. Having that just fail out is perfectly reasonable. --- .../Framework/CHIP/MTRDeviceController.mm | 25 ++----------------- src/darwin/Framework/CHIP/MTRDevice_XPC.mm | 1 - .../CHIP/MTROperationalCredentialsDelegate.h | 6 ++--- .../CHIP/MTROperationalCredentialsDelegate.mm | 8 +++--- 4 files changed, 9 insertions(+), 31 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm index 63fb3b5668..0bfe6f45f4 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm @@ -43,7 +43,6 @@ #import "MTRLogging_Internal.h" #import "MTRMetricKeys.h" #import "MTRMetricsCollector.h" -#import "MTROperationalCredentialsDelegate.h" #import "MTRP256KeypairBridge.h" #import "MTRPersistentStorageDelegateBridge.h" #import "MTRServerEndpoint_Internal.h" @@ -124,7 +123,6 @@ @implementation MTRDeviceController { chip::Credentials::PartialDACVerifier * _partialDACVerifier; chip::Credentials::DefaultDACVerifier * _defaultDACVerifier; MTRDeviceControllerDelegateBridge * _deviceControllerDelegateBridge; - MTROperationalCredentialsDelegate * _operationalCredentialsDelegate; MTRDeviceAttestationDelegateBridge * _deviceAttestationDelegateBridge; os_unfair_lock _underlyingDeviceMapLock; MTRCommissionableBrowser * _commissionableBrowser; @@ -586,27 +584,8 @@ - (MTRTransportType)sessionTransportTypeForDevice:(MTRBaseDevice *)device - (void)asyncGetCommissionerOnMatterQueue:(void (^)(chip::Controller::DeviceCommissioner *))block errorHandler:(nullable MTRDeviceErrorHandler)errorHandler { - { - NSError * error; - if (![self checkIsRunning:&error]) { - if (errorHandler != nil) { - errorHandler(error); - } - return; - } - } - - dispatch_async(_chipWorkQueue, ^{ - NSError * error; - if (![self checkIsRunning:&error]) { - if (errorHandler != nil) { - errorHandler(error); - } - return; - } - - block(self->_cppCommissioner); - }); + MTR_ABSTRACT_METHOD(); + errorHandler([MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]); } - (void)asyncDispatchToMatterQueue:(dispatch_block_t)block errorHandler:(nullable MTRDeviceErrorHandler)errorHandler diff --git a/src/darwin/Framework/CHIP/MTRDevice_XPC.mm b/src/darwin/Framework/CHIP/MTRDevice_XPC.mm index d7a4574f91..5165e3ad26 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_XPC.mm +++ b/src/darwin/Framework/CHIP/MTRDevice_XPC.mm @@ -49,7 +49,6 @@ #import "MTRLogging_Internal.h" #import "MTRMetricKeys.h" #import "MTRMetricsCollector.h" -#import "MTROperationalCredentialsDelegate.h" #import "MTRP256KeypairBridge.h" #import "MTRPersistentStorageDelegateBridge.h" #import "MTRServerEndpoint_Internal.h" diff --git a/src/darwin/Framework/CHIP/MTROperationalCredentialsDelegate.h b/src/darwin/Framework/CHIP/MTROperationalCredentialsDelegate.h index 63499f024b..928c80ba85 100644 --- a/src/darwin/Framework/CHIP/MTROperationalCredentialsDelegate.h +++ b/src/darwin/Framework/CHIP/MTROperationalCredentialsDelegate.h @@ -20,7 +20,7 @@ #import #import -#import "MTRDeviceController.h" +#import "MTRDeviceController_Concrete.h" #import "MTRError_Internal.h" #import "MTRKeypair.h" #import "MTROperationalCertificateIssuer.h" @@ -38,7 +38,7 @@ class MTROperationalCredentialsDelegate : public chip::Controller::OperationalCr public: using ChipP256KeypairPtr = chip::Crypto::P256Keypair *; - MTROperationalCredentialsDelegate(MTRDeviceController * deviceController); + MTROperationalCredentialsDelegate(MTRDeviceController_Concrete * deviceController); ~MTROperationalCredentialsDelegate() {} CHIP_ERROR Init(ChipP256KeypairPtr nocSigner, NSData * ipk, NSData * rootCert, NSData * _Nullable icaCert); @@ -147,7 +147,7 @@ class MTROperationalCredentialsDelegate : public chip::Controller::OperationalCr NSData * _Nullable mRootCert; NSData * _Nullable mIntermediateCert; - MTRDeviceController * __weak mWeakController; + MTRDeviceController_Concrete * __weak mWeakController; chip::Controller::DeviceCommissioner * _Nullable mCppCommissioner = nullptr; id _Nullable mOperationalCertificateIssuer; dispatch_queue_t _Nullable mOperationalCertificateIssuerQueue; diff --git a/src/darwin/Framework/CHIP/MTROperationalCredentialsDelegate.mm b/src/darwin/Framework/CHIP/MTROperationalCredentialsDelegate.mm index fa280c81e6..673e4df12b 100644 --- a/src/darwin/Framework/CHIP/MTROperationalCredentialsDelegate.mm +++ b/src/darwin/Framework/CHIP/MTROperationalCredentialsDelegate.mm @@ -42,7 +42,7 @@ using namespace Credentials; using namespace Crypto; -MTROperationalCredentialsDelegate::MTROperationalCredentialsDelegate(MTRDeviceController * deviceController) +MTROperationalCredentialsDelegate::MTROperationalCredentialsDelegate(MTRDeviceController_Concrete * deviceController) : mWeakController(deviceController) { } @@ -129,7 +129,7 @@ VerifyOrReturnError(mCppCommissioner != nullptr, CHIP_ERROR_INCORRECT_STATE); - MTRDeviceController * strongController = mWeakController; + MTRDeviceController_Concrete * strongController = mWeakController; VerifyOrReturnError(strongController != nil, CHIP_ERROR_INCORRECT_STATE); mOnNOCCompletionCallback = onCompletion; @@ -168,14 +168,14 @@ certificationDeclaration:AsData(certificationDeclarationSpan) firmwareInfo:firmwareInfo]; - MTRDeviceController * __weak weakController = mWeakController; + MTRDeviceController_Concrete * __weak weakController = mWeakController; dispatch_async(mOperationalCertificateIssuerQueue, ^{ [mOperationalCertificateIssuer issueOperationalCertificateForRequest:csrInfo attestationInfo:attestationInfo controller:strongController completion:^(MTROperationalCertificateChain * _Nullable chain, NSError * _Nullable error) { - MTRDeviceController * strongController = weakController; + MTRDeviceController_Concrete * strongController = weakController; if (strongController == nil || !strongController.isRunning) { // No longer safe to touch "this" return; From 52a5589b11f534e8e6c75465a4c5942ec4500a36 Mon Sep 17 00:00:00 2001 From: Junior Martinez <67972863+jmartinez-silabs@users.noreply.github.com> Date: Mon, 7 Oct 2024 18:56:15 -0400 Subject: [PATCH 024/127] Fix efr32 test_driver build and make sure the linkerfile matches the target board (#35952) --- src/test_driver/efr32/BUILD.gn | 11 +++++++++++ src/test_driver/efr32/args.gni | 8 -------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/test_driver/efr32/BUILD.gn b/src/test_driver/efr32/BUILD.gn index 0d10cb8d76..1fc16ed47f 100644 --- a/src/test_driver/efr32/BUILD.gn +++ b/src/test_driver/efr32/BUILD.gn @@ -61,6 +61,16 @@ efr32_sdk("sdk") { ] } +config("efr32_ldflags") { + _ldscript = + "${chip_root}/examples/platform/silabs/ldscripts/${silabs_family}.ld" + + ldflags = [ + "-T" + rebase_path(_ldscript, root_build_dir), + "-Wl,--no-warn-rwx-segment", + ] +} + # This is the test runner. `pw_test` will dep this for each `silabs_executable` target. source_set("efr32_test_main") { defines = [ "PW_RPC_ENABLED" ] @@ -103,6 +113,7 @@ source_set("efr32_test_main") { ] include_dirs = [ "${chip_root}/examples/common/pigweed/efr32" ] + public_configs = [ ":efr32_ldflags" ] } # This target is referred to by BuildRoot in scripts/build/builders/efr32.py, as well as the example in README.md. diff --git a/src/test_driver/efr32/args.gni b/src/test_driver/efr32/args.gni index f7f52398a5..35be5dd63e 100644 --- a/src/test_driver/efr32/args.gni +++ b/src/test_driver/efr32/args.gni @@ -15,9 +15,7 @@ import("//build_overrides/chip.gni") import("//build_overrides/pigweed.gni") import("${chip_root}/config/efr32/lib/pw_rpc/pw_rpc.gni") -import("${chip_root}/examples/platform/silabs/args.gni") import("${chip_root}/src/platform/silabs/efr32/args.gni") -import("${chip_root}/third_party/silabs/silabs_board.gni") # silabs_family silabs_sdk_target = get_label_info(":sdk", "label_no_toolchain") @@ -46,9 +44,3 @@ pw_unit_test_MAIN = "//:efr32_test_main" # Additional variables needed by silabs_executable that must be passed in to pw_test. test_executable_output_name = "matter-silabs-device_tests-" test_executable_output_name_suffix = ".out" -_ldscript = - "${chip_root}/examples/platform/silabs/ldscripts/${silabs_family}.ld" -test_executable_ldflags = [ - "-T" + rebase_path(_ldscript, root_build_dir), - "-Wl,--no-warn-rwx-segment", -] From 07a28ac0bed1c54843f73590a15b09c661733969 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Mon, 7 Oct 2024 20:29:39 -0400 Subject: [PATCH 025/127] One more decouple from ember from src/app and ensure we can compile without `ember-compatibility-functions.cpp` (#35919) * Add ability to skip compiling of ember-compatibility-functions * Fix build and make sure that CI will validate a data-model-enabled build * Restyle * Fix compilation * Restyled by clang-format * Typo fix * Fix includes * Rename method to something that seems a bit clearer * Fix pwrpc usage to use datamodel interface * Restyle * Remove todo * Update for attribute is list to support not know value * Update src/app/WriteHandler.h Co-authored-by: Boris Zbarsky --------- Co-authored-by: Restyled.io Co-authored-by: Boris Zbarsky --- .github/workflows/examples-linux-arm.yaml | 2 +- .../common/pigweed/rpc_services/Attributes.h | 38 ++++++++++++++++ src/app/WriteHandler.cpp | 44 ++++++++++++++----- src/app/WriteHandler.h | 6 +++ src/app/chip_data_model.cmake | 14 +++++- src/app/chip_data_model.gni | 6 ++- 6 files changed, 95 insertions(+), 15 deletions(-) diff --git a/.github/workflows/examples-linux-arm.yaml b/.github/workflows/examples-linux-arm.yaml index ee226b12dc..7000082f03 100644 --- a/.github/workflows/examples-linux-arm.yaml +++ b/.github/workflows/examples-linux-arm.yaml @@ -65,7 +65,7 @@ jobs: --target linux-arm64-chip-tool-nodeps-ipv6only \ --target linux-arm64-lock-clang \ --target linux-arm64-minmdns-clang \ - --target linux-arm64-light-rpc-ipv6only-clang \ + --target linux-arm64-light-data-model-enabled-rpc-ipv6only-clang \ --target linux-arm64-thermostat-no-ble-clang \ --target linux-arm64-lit-icd-no-ble-clang \ --target linux-arm64-fabric-admin-clang-rpc \ diff --git a/examples/common/pigweed/rpc_services/Attributes.h b/examples/common/pigweed/rpc_services/Attributes.h index e246c5361b..3ff1200be2 100644 --- a/examples/common/pigweed/rpc_services/Attributes.h +++ b/examples/common/pigweed/rpc_services/Attributes.h @@ -22,6 +22,7 @@ #include "pigweed/rpc_services/internal/StatusUtils.h" #include +#include #include #include #include @@ -32,6 +33,13 @@ #include #include +#if CHIP_CONFIG_USE_DATA_MODEL_INTERFACE +#include +#include +#include +#include +#endif + namespace chip { namespace rpc { @@ -202,7 +210,37 @@ class Attributes : public pw_rpc::nanopb::Attributes::Service writer.Init(tlvBuffer); PW_TRY(ChipErrorToPwStatus(writer.StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, outer))); PW_TRY(ChipErrorToPwStatus(attributeReports.Init(&writer, kReportContextTag))); + +#if CHIP_CONFIG_USE_DATA_MODEL_INTERFACE + // TODO: this assumes a singleton data model provider + app::DataModel::Provider * provider = app::InteractionModelEngine::GetInstance()->GetDataModelProvider(); + + app::DataModel::ReadAttributeRequest request; + request.path = path; + request.operationFlags.Set(app::DataModel::OperationFlags::kInternal); + request.subjectDescriptor = subjectDescriptor; + + std::optional info = provider->GetClusterInfo(path); + if (!info.has_value()) + { + return ::pw::Status::NotFound(); + } + + app::AttributeValueEncoder encoder(attributeReports, subjectDescriptor, path, info->dataVersion, + false /* isFabricFiltered */, nullptr /* attributeEncodingState */); + app::DataModel::ActionReturnStatus result = provider->ReadAttribute(request, encoder); + + if (!result.IsSuccess()) + { + app::DataModel::ActionReturnStatus::StringStorage storage; + ChipLogError(Support, "Failed to read data: %s", result.c_str(storage)); + return ::pw::Status::Internal(); + } + +#else PW_TRY(ChipErrorToPwStatus(app::ReadSingleClusterData(subjectDescriptor, false, path, attributeReports, nullptr))); +#endif + attributeReports.EndOfContainer(); PW_TRY(ChipErrorToPwStatus(writer.EndContainer(outer))); PW_TRY(ChipErrorToPwStatus(writer.Finalize())); diff --git a/src/app/WriteHandler.cpp b/src/app/WriteHandler.cpp index 5050cbbee2..d2fde33930 100644 --- a/src/app/WriteHandler.cpp +++ b/src/app/WriteHandler.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -32,6 +33,7 @@ #include #include #include +#include #include #include @@ -41,8 +43,7 @@ namespace chip { namespace app { using namespace Protocols::InteractionModel; -using Status = Protocols::InteractionModel::Status; -constexpr uint8_t kListAttributeType = 0x48; +using Status = Protocols::InteractionModel::Status; CHIP_ERROR WriteHandler::Init(DataModel::Provider * apProvider, WriteHandlerDelegate * apWriteHandlerDelegate) { @@ -79,6 +80,30 @@ void WriteHandler::Close() MoveToState(State::Uninitialized); } +std::optional WriteHandler::IsListAttributePath(const ConcreteAttributePath & path) +{ +#if CHIP_CONFIG_USE_DATA_MODEL_INTERFACE + VerifyOrReturnValue(mDataModelProvider != nullptr, std::nullopt, + ChipLogError(DataManagement, "Null data model while checking attribute properties.")); + + auto info = mDataModelProvider->GetAttributeInfo(path); + if (!info.has_value()) + { + return std::nullopt; + } + + return info->flags.Has(DataModel::AttributeQualityFlags::kListAttribute); +#else + constexpr uint8_t kListAttributeType = 0x48; + const auto attributeMetadata = GetAttributeMetadata(path); + if (attributeMetadata == nullptr) + { + return std::nullopt; + } + return (attributeMetadata->attributeType == kListAttributeType); +#endif +} + Status WriteHandler::HandleWriteRequestMessage(Messaging::ExchangeContext * apExchangeContext, System::PacketBufferHandle && aPayload, bool aIsTimedWrite) { @@ -317,10 +342,7 @@ CHIP_ERROR WriteHandler::ProcessAttributeDataIBs(TLV::TLVReader & aAttributeData err = element.GetData(&dataReader); SuccessOrExit(err); - const auto attributeMetadata = GetAttributeMetadata(dataAttributePath); - bool currentAttributeIsList = (attributeMetadata != nullptr && attributeMetadata->attributeType == kListAttributeType); - - if (!dataAttributePath.IsListOperation() && currentAttributeIsList) + if (!dataAttributePath.IsListOperation() && IsListAttributePath(dataAttributePath).value_or(false)) { dataAttributePath.mListOp = ConcreteDataAttributePath::ListOperation::ReplaceAll; } @@ -446,7 +468,7 @@ CHIP_ERROR WriteHandler::ProcessGroupAttributeDataIBs(TLV::TLVReader & aAttribut mProcessingAttributePath, mStateFlags.Has(StateBits::kProcessingAttributeIsList), dataAttributePath); bool shouldReportListWriteBegin = false; // This will be set below. - const EmberAfAttributeMetadata * attributeMetadata = nullptr; + std::optional isListAttribute = std::nullopt; while (iterator->Next(mapping)) { @@ -460,11 +482,11 @@ CHIP_ERROR WriteHandler::ProcessGroupAttributeDataIBs(TLV::TLVReader & aAttribut // Try to get the metadata from for the attribute from one of the expanded endpoints (it doesn't really matter which // endpoint we pick, as long as it's valid) and update the path info according to it and recheck if we need to report // list write begin. - if (attributeMetadata == nullptr) + if (!isListAttribute.has_value()) { - attributeMetadata = GetAttributeMetadata(dataAttributePath); - bool currentAttributeIsList = - (attributeMetadata != nullptr && attributeMetadata->attributeType == kListAttributeType); + isListAttribute = IsListAttributePath(dataAttributePath); + bool currentAttributeIsList = isListAttribute.value_or(false); + if (!dataAttributePath.IsListOperation() && currentAttributeIsList) { dataAttributePath.mListOp = ConcreteDataAttributePath::ListOperation::ReplaceAll; diff --git a/src/app/WriteHandler.h b/src/app/WriteHandler.h index fe63e028b8..33c068b8cd 100644 --- a/src/app/WriteHandler.h +++ b/src/app/WriteHandler.h @@ -189,6 +189,12 @@ class WriteHandler : public Messaging::ExchangeDelegate CHIP_ERROR WriteClusterData(const Access::SubjectDescriptor & aSubject, const ConcreteDataAttributePath & aPath, TLV::TLVReader & aData); + /// Checks whether the given path corresponds to a list attribute + /// Return values: + /// true/false: valid attribute path, known if list or not + /// std::nulloptr - path not available/valid, unknown if attribute is a list or not + std::optional IsListAttributePath(const ConcreteAttributePath & path); + Messaging::ExchangeHolder mExchangeCtx; WriteResponseMessage::Builder mWriteResponseBuilder; Optional mProcessingAttributePath; diff --git a/src/app/chip_data_model.cmake b/src/app/chip_data_model.cmake index e2d05adb01..11db6d4ec6 100644 --- a/src/app/chip_data_model.cmake +++ b/src/app/chip_data_model.cmake @@ -70,12 +70,17 @@ endfunction() # function(chip_configure_data_model APP_TARGET) set(SCOPE PRIVATE) - cmake_parse_arguments(ARG "" "SCOPE;ZAP_FILE;IDL" "EXTERNAL_CLUSTERS" ${ARGN}) + set(ADD_EMBER_INTERFACE_FILES TRUE) + cmake_parse_arguments(ARG "SKIP_EMBER_INTERFACE" "SCOPE;ZAP_FILE;IDL" "EXTERNAL_CLUSTERS" ${ARGN}) if(ARG_SCOPE) set(SCOPE ${ARG_SCOPE}) endif() + if(ARG_SKIP_EMBER_INTERFACE) + set(ADD_EMBER_INTERFACE_FILES FALSE) + endif() + # CMAKE data model auto-includes the server side implementation target_sources(${APP_TARGET} ${SCOPE} ${CHIP_APP_BASE_DIR}/server/AclStorage.cpp @@ -159,7 +164,6 @@ function(chip_configure_data_model APP_TARGET) ${CHIP_APP_BASE_DIR}/util/attribute-table.cpp ${CHIP_APP_BASE_DIR}/util/binding-table.cpp ${CHIP_APP_BASE_DIR}/util/DataModelHandler.cpp - ${CHIP_APP_BASE_DIR}/util/ember-compatibility-functions.cpp ${CHIP_APP_BASE_DIR}/util/ember-global-attribute-access-interface.cpp ${CHIP_APP_BASE_DIR}/util/ember-io-storage.cpp ${CHIP_APP_BASE_DIR}/util/generic-callback-stubs.cpp @@ -169,4 +173,10 @@ function(chip_configure_data_model APP_TARGET) ${APP_GEN_FILES} ${APP_TEMPLATES_GEN_FILES} ) + + if(ADD_EMBER_INTERFACE_FILES) + target_sources(${APP_TARGET} ${SCOPE} + ${CHIP_APP_BASE_DIR}/util/ember-compatibility-functions.cpp + ) + endif() endfunction() diff --git a/src/app/chip_data_model.gni b/src/app/chip_data_model.gni index 42b221c1a9..cc998948d8 100644 --- a/src/app/chip_data_model.gni +++ b/src/app/chip_data_model.gni @@ -209,11 +209,15 @@ template("chip_data_model") { "${_app_root}/util/DataModelHandler.cpp", "${_app_root}/util/attribute-storage.cpp", "${_app_root}/util/attribute-table.cpp", - "${_app_root}/util/ember-compatibility-functions.cpp", "${_app_root}/util/ember-global-attribute-access-interface.cpp", "${_app_root}/util/ember-io-storage.cpp", "${_app_root}/util/util.cpp", ] + + if (chip_use_data_model_interface != "enabled") { + # This applies to "check" or "disabled" (i.e. use ember-only or use ember for double-checking) + sources += [ "${_app_root}/util/ember-compatibility-functions.cpp" ] + } } if (defined(invoker.zap_file)) { From 43e447c73a352296cf5c02417c2fdf900061e058 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Mon, 7 Oct 2024 18:03:14 -0700 Subject: [PATCH 026/127] [Fabric-Bridge] Replace ScheduleWork with ScheduleLambda (#35949) * [Fabric-Bridge] Replace ScheduleWork with ScheduleLambda * Restyled by whitespace * Restyled by clang-format --------- Co-authored-by: Restyled.io --- .../src/BridgedDevice.cpp | 109 ++++++------------ 1 file changed, 38 insertions(+), 71 deletions(-) diff --git a/examples/fabric-bridge-app/fabric-bridge-common/src/BridgedDevice.cpp b/examples/fabric-bridge-app/fabric-bridge-common/src/BridgedDevice.cpp index 02bdfbdbcb..7d58811299 100644 --- a/examples/fabric-bridge-app/fabric-bridge-common/src/BridgedDevice.cpp +++ b/examples/fabric-bridge-app/fabric-bridge-common/src/BridgedDevice.cpp @@ -24,78 +24,31 @@ #include #include -namespace { - -struct ActiveChangeEventWorkData -{ - chip::EndpointId mEndpointId; - uint32_t mPromisedActiveDuration; -}; - -struct ReportAttributeChangedWorkData -{ - chip::EndpointId mEndpointId; - bool mWindowChanged = false; - bool mFabricIndexChanged = false; - bool mVendorChanged = false; -}; - -void ActiveChangeEventWork(intptr_t arg) -{ - ActiveChangeEventWorkData * data = reinterpret_cast(arg); - - chip::app::Clusters::BridgedDeviceBasicInformation::Events::ActiveChanged::Type event{}; - event.promisedActiveDuration = data->mPromisedActiveDuration; - chip::EventNumber eventNumber = 0; - - CHIP_ERROR err = chip::app::LogEvent(event, data->mEndpointId, eventNumber); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(NotSpecified, "LogEvent for ActiveChanged failed %s", err.AsString()); - } - chip::Platform::Delete(data); -} - -void ReportAttributeChangedWork(intptr_t arg) -{ - ReportAttributeChangedWorkData * data = reinterpret_cast(arg); - - if (data->mWindowChanged) - { - MatterReportingAttributeChangeCallback(data->mEndpointId, chip::app::Clusters::AdministratorCommissioning::Id, - chip::app::Clusters::AdministratorCommissioning::Attributes::WindowStatus::Id); - } - if (data->mFabricIndexChanged) - { - MatterReportingAttributeChangeCallback(data->mEndpointId, chip::app::Clusters::AdministratorCommissioning::Id, - chip::app::Clusters::AdministratorCommissioning::Attributes::AdminFabricIndex::Id); - } - if (data->mVendorChanged) - { - MatterReportingAttributeChangeCallback(data->mEndpointId, chip::app::Clusters::AdministratorCommissioning::Id, - chip::app::Clusters::AdministratorCommissioning::Attributes::AdminVendorId::Id); - } - chip::Platform::Delete(data); -} - -} // namespace - +using namespace chip; using namespace chip::app::Clusters::Actions; -BridgedDevice::BridgedDevice(chip::ScopedNodeId scopedNodeId) +BridgedDevice::BridgedDevice(ScopedNodeId scopedNodeId) { mReachable = false; mScopedNodeId = scopedNodeId; - mEndpointId = chip::kInvalidEndpointId; + mEndpointId = kInvalidEndpointId; } void BridgedDevice::LogActiveChangeEvent(uint32_t promisedActiveDurationMs) { - ActiveChangeEventWorkData * workdata = chip::Platform::New(); - workdata->mEndpointId = mEndpointId; - workdata->mPromisedActiveDuration = promisedActiveDurationMs; - - chip::DeviceLayer::PlatformMgr().ScheduleWork(ActiveChangeEventWork, reinterpret_cast(workdata)); + EndpointId endpointId = mEndpointId; + + DeviceLayer::SystemLayer().ScheduleLambda([endpointId, promisedActiveDurationMs]() { + app::Clusters::BridgedDeviceBasicInformation::Events::ActiveChanged::Type event{}; + event.promisedActiveDuration = promisedActiveDurationMs; + EventNumber eventNumber = 0; + + CHIP_ERROR err = app::LogEvent(event, endpointId, eventNumber); + if (err != CHIP_NO_ERROR) + { + ChipLogProgress(NotSpecified, "LogEvent for ActiveChanged failed %s", err.AsString()); + } + }); } void BridgedDevice::SetReachable(bool reachable) @@ -114,15 +67,29 @@ void BridgedDevice::SetReachable(bool reachable) void BridgedDevice::SetAdminCommissioningAttributes(const AdminCommissioningAttributes & aAdminCommissioningAttributes) { - ReportAttributeChangedWorkData * workdata = chip::Platform::New(); - - workdata->mEndpointId = mEndpointId; - workdata->mWindowChanged = + EndpointId endpointId = mEndpointId; + bool windowChanged = (aAdminCommissioningAttributes.commissioningWindowStatus != mAdminCommissioningAttributes.commissioningWindowStatus); - workdata->mFabricIndexChanged = - (aAdminCommissioningAttributes.openerFabricIndex != mAdminCommissioningAttributes.openerFabricIndex); - workdata->mVendorChanged = (aAdminCommissioningAttributes.openerVendorId != mAdminCommissioningAttributes.openerVendorId); + bool fabricIndexChanged = (aAdminCommissioningAttributes.openerFabricIndex != mAdminCommissioningAttributes.openerFabricIndex); + bool vendorChanged = (aAdminCommissioningAttributes.openerVendorId != mAdminCommissioningAttributes.openerVendorId); mAdminCommissioningAttributes = aAdminCommissioningAttributes; - chip::DeviceLayer::PlatformMgr().ScheduleWork(ReportAttributeChangedWork, reinterpret_cast(workdata)); + + DeviceLayer::SystemLayer().ScheduleLambda([endpointId, windowChanged, fabricIndexChanged, vendorChanged]() { + if (windowChanged) + { + MatterReportingAttributeChangeCallback(endpointId, app::Clusters::AdministratorCommissioning::Id, + app::Clusters::AdministratorCommissioning::Attributes::WindowStatus::Id); + } + if (fabricIndexChanged) + { + MatterReportingAttributeChangeCallback(endpointId, app::Clusters::AdministratorCommissioning::Id, + app::Clusters::AdministratorCommissioning::Attributes::AdminFabricIndex::Id); + } + if (vendorChanged) + { + MatterReportingAttributeChangeCallback(endpointId, app::Clusters::AdministratorCommissioning::Id, + app::Clusters::AdministratorCommissioning::Attributes::AdminVendorId::Id); + } + }); } From 9fc8386905947eb29b7e162c296330fd8454a317 Mon Sep 17 00:00:00 2001 From: mkardous-silabs <84793247+mkardous-silabs@users.noreply.github.com> Date: Mon, 7 Oct 2024 21:50:27 -0400 Subject: [PATCH 027/127] [ICD] Make optional spec checks mandatory with the launch of LongIdleTime ICDs (#35956) * Remove optional spec check * Add static_assert for the slow poll config for SIT ICDs * Add missing include * fix restyler error * fix spacing * Remove client build flag since it is not used --- config/esp32/components/chip/CMakeLists.txt | 3 --- config/esp32/components/chip/Kconfig | 9 +------ config/nrfconnect/chip-module/CMakeLists.txt | 1 - .../enabling_icd_on_ti_devices.md | 3 --- .../contact-sensor-app/nxp/k32w0/args.gni | 1 - .../contact-sensor-app/nxp/k32w1/args.gni | 1 - .../contact-sensor-app/nxp/mcxw71/args.gni | 1 - .../silabs/build_for_wifi_args.gni | 1 - examples/lit-icd-app/silabs/openthread.gni | 1 - examples/lock-app/nxp/k32w1/args.gni | 1 - examples/lock-app/nxp/mcxw71/args.gni | 1 - .../silabs/build_for_wifi_args.gni | 1 - .../smoke-co-alarm-app/silabs/openthread.gni | 1 - src/app/icd/icd.gni | 8 ------ src/app/icd/server/BUILD.gn | 1 - src/app/icd/server/ICDConfigurationData.cpp | 8 +++--- src/app/icd/server/ICDConfigurationData.h | 26 +++++++++++-------- src/app/icd/server/ICDManager.cpp | 3 --- 18 files changed, 20 insertions(+), 51 deletions(-) diff --git a/config/esp32/components/chip/CMakeLists.txt b/config/esp32/components/chip/CMakeLists.txt index f7685cf760..fde62765dd 100644 --- a/config/esp32/components/chip/CMakeLists.txt +++ b/config/esp32/components/chip/CMakeLists.txt @@ -143,9 +143,6 @@ endif() if(CONFIG_ENABLE_ICD_SERVER) chip_gn_arg_append("chip_enable_icd_server" "true") - if(CONFIG_ICD_ENFORCE_SIT_SLOW_POLL_LIMIT) - chip_gn_arg_append("icd_enforce_sit_slow_poll_limit" "true") - endif() if(CONFIG_ICD_REPORT_ON_ACTIVE_MODE) chip_gn_arg_append("chip_icd_report_on_active_mode" "true") endif() diff --git a/config/esp32/components/chip/Kconfig b/config/esp32/components/chip/Kconfig index 5c36284f07..c61ac770a6 100644 --- a/config/esp32/components/chip/Kconfig +++ b/config/esp32/components/chip/Kconfig @@ -32,7 +32,7 @@ menu "CHIP Core" default 8 help The maximum number of simultaneously active CHIP exchange contexts. - + An exchange context object is used to track the state of an ongoing CHIP message exchange (conversation) with a peer, e.g. a cloud service, a mobile application, or another device. @@ -410,13 +410,6 @@ menu "CHIP Device Layer" help Enables or Disables ICD server - config ICD_ENFORCE_SIT_SLOW_POLL_LIMIT - bool "Enforce SIT Slow Polling Max value to 15 seconds" - depends on ENABLE_ICD_SERVER - default n - help - Set to true to enforce SIT Slow Polling Max value to 15seconds - config ICD_REPORT_ON_ACTIVE_MODE bool "Emit a report on entering active mode" depends on ENABLE_ICD_SERVER diff --git a/config/nrfconnect/chip-module/CMakeLists.txt b/config/nrfconnect/chip-module/CMakeLists.txt index 3896ed6be7..b3180fdc1b 100644 --- a/config/nrfconnect/chip-module/CMakeLists.txt +++ b/config/nrfconnect/chip-module/CMakeLists.txt @@ -156,7 +156,6 @@ if (CONFIG_CHIP_ENABLE_ICD_SUPPORT) matter_add_gn_arg_bool ("chip_enable_icd_checkin" CONFIG_CHIP_ICD_CHECK_IN_SUPPORT) matter_add_gn_arg_bool ("chip_enable_icd_user_active_mode_trigger" CONFIG_CHIP_ICD_UAT_SUPPORT) matter_add_gn_arg_bool ("chip_enable_icd_dsls" CONFIG_CHIP_ICD_DSLS_SUPPORT) - matter_add_gn_arg_bool ("icd_enforce_sit_slow_poll_limit" TRUE) endif() if (CONFIG_CHIP_FACTORY_DATA OR CONFIG_CHIP_FACTORY_DATA_CUSTOM_BACKEND) diff --git a/docs/guides/ti/matter-users-guide/enabling_icd_on_ti_devices.md b/docs/guides/ti/matter-users-guide/enabling_icd_on_ti_devices.md index 50495a601e..b024b90b40 100644 --- a/docs/guides/ti/matter-users-guide/enabling_icd_on_ti_devices.md +++ b/docs/guides/ti/matter-users-guide/enabling_icd_on_ti_devices.md @@ -24,9 +24,6 @@ Trigger Support, set the following parameter to true: chip_enable_icd_lit = true ``` -TI examples have only been tested with the ICD Server configuration. To enable -the client configuration, set `chip_enable_icd_client` to true. - Persistent subscriptions allow devices to attempt resuming existing subscriptions following a device reset. To enable persistent subscriptions, set the following parameter to true: diff --git a/examples/contact-sensor-app/nxp/k32w0/args.gni b/examples/contact-sensor-app/nxp/k32w0/args.gni index 1709f1da73..f4b68ae740 100644 --- a/examples/contact-sensor-app/nxp/k32w0/args.gni +++ b/examples/contact-sensor-app/nxp/k32w0/args.gni @@ -28,7 +28,6 @@ chip_generate_link_map_file = true chip_enable_icd_server = true chip_enable_icd_lit = false -icd_enforce_sit_slow_poll_limit = true chip_persist_subscriptions = true chip_subscription_timeout_resumption = true diff --git a/examples/contact-sensor-app/nxp/k32w1/args.gni b/examples/contact-sensor-app/nxp/k32w1/args.gni index 98372f4b82..e5654bdbc7 100644 --- a/examples/contact-sensor-app/nxp/k32w1/args.gni +++ b/examples/contact-sensor-app/nxp/k32w1/args.gni @@ -32,7 +32,6 @@ chip_with_lwip = false chip_enable_icd_server = true chip_enable_icd_lit = false chip_enable_icd_dsls = false -icd_enforce_sit_slow_poll_limit = true chip_persist_subscriptions = true chip_subscription_timeout_resumption = true diff --git a/examples/contact-sensor-app/nxp/mcxw71/args.gni b/examples/contact-sensor-app/nxp/mcxw71/args.gni index 72634a2308..6e6015933d 100644 --- a/examples/contact-sensor-app/nxp/mcxw71/args.gni +++ b/examples/contact-sensor-app/nxp/mcxw71/args.gni @@ -30,7 +30,6 @@ chip_with_lwip = false chip_enable_icd_server = true chip_enable_icd_lit = false -icd_enforce_sit_slow_poll_limit = true chip_persist_subscriptions = true chip_subscription_timeout_resumption = true diff --git a/examples/lit-icd-app/silabs/build_for_wifi_args.gni b/examples/lit-icd-app/silabs/build_for_wifi_args.gni index 56cd70b217..6ef009e906 100644 --- a/examples/lit-icd-app/silabs/build_for_wifi_args.gni +++ b/examples/lit-icd-app/silabs/build_for_wifi_args.gni @@ -29,7 +29,6 @@ sl_enable_test_event_trigger = true chip_enable_icd_server = true chip_subscription_timeout_resumption = false sl_use_subscription_syncing = true -icd_enforce_sit_slow_poll_limit = true chip_enable_icd_lit = true # ICD Matter Configuration flags diff --git a/examples/lit-icd-app/silabs/openthread.gni b/examples/lit-icd-app/silabs/openthread.gni index b12529c2ca..e84e7be8ed 100644 --- a/examples/lit-icd-app/silabs/openthread.gni +++ b/examples/lit-icd-app/silabs/openthread.gni @@ -32,7 +32,6 @@ sl_enable_test_event_trigger = true chip_enable_icd_server = true chip_subscription_timeout_resumption = false sl_use_subscription_syncing = true -icd_enforce_sit_slow_poll_limit = true chip_icd_report_on_active_mode = true chip_enable_icd_lit = true diff --git a/examples/lock-app/nxp/k32w1/args.gni b/examples/lock-app/nxp/k32w1/args.gni index e0c41d1e34..b7a2d790ef 100644 --- a/examples/lock-app/nxp/k32w1/args.gni +++ b/examples/lock-app/nxp/k32w1/args.gni @@ -30,7 +30,6 @@ chip_with_lwip = false chip_enable_icd_server = true chip_enable_icd_lit = false -icd_enforce_sit_slow_poll_limit = true chip_persist_subscriptions = true chip_subscription_timeout_resumption = true diff --git a/examples/lock-app/nxp/mcxw71/args.gni b/examples/lock-app/nxp/mcxw71/args.gni index 761b050b80..1a0940c96a 100644 --- a/examples/lock-app/nxp/mcxw71/args.gni +++ b/examples/lock-app/nxp/mcxw71/args.gni @@ -30,7 +30,6 @@ chip_with_lwip = false chip_enable_icd_server = true chip_enable_icd_lit = false -icd_enforce_sit_slow_poll_limit = true chip_persist_subscriptions = true chip_subscription_timeout_resumption = true diff --git a/examples/smoke-co-alarm-app/silabs/build_for_wifi_args.gni b/examples/smoke-co-alarm-app/silabs/build_for_wifi_args.gni index 0619082413..e5097f8a1d 100644 --- a/examples/smoke-co-alarm-app/silabs/build_for_wifi_args.gni +++ b/examples/smoke-co-alarm-app/silabs/build_for_wifi_args.gni @@ -28,7 +28,6 @@ sl_enable_test_event_trigger = true chip_enable_icd_server = true chip_subscription_timeout_resumption = false sl_use_subscription_syncing = true -icd_enforce_sit_slow_poll_limit = true chip_enable_icd_lit = true # ICD Matter Configuration flags diff --git a/examples/smoke-co-alarm-app/silabs/openthread.gni b/examples/smoke-co-alarm-app/silabs/openthread.gni index 845b2220b4..f2a7ab6ed7 100644 --- a/examples/smoke-co-alarm-app/silabs/openthread.gni +++ b/examples/smoke-co-alarm-app/silabs/openthread.gni @@ -32,7 +32,6 @@ sl_enable_test_event_trigger = true chip_enable_icd_server = true chip_subscription_timeout_resumption = false sl_use_subscription_syncing = true -icd_enforce_sit_slow_poll_limit = true chip_icd_report_on_active_mode = true chip_enable_icd_lit = true diff --git a/src/app/icd/icd.gni b/src/app/icd/icd.gni index ed3fd0518f..b7fef896f5 100644 --- a/src/app/icd/icd.gni +++ b/src/app/icd/icd.gni @@ -14,23 +14,15 @@ declare_args() { # Matter SDK Configuration flag to enable ICD server functionality - # TODO - Add Specifics when the design is refined chip_enable_icd_server = false chip_enable_icd_lit = false - # Matter SDK Configuration flag to enable ICD client functionality - # TODO - Add Specifics when the design is refined - chip_enable_icd_client = false - # Matter SDK Configuration flag to make the ICD manager emit a report on entering active mode chip_icd_report_on_active_mode = false icd_max_notification_subscribers = 1 - # Set to true to enforce SIT Slow Polling Max value to 15seconds (spec 9.16.1.5) - icd_enforce_sit_slow_poll_limit = false - # Set to true if device supports dynamic switching from SIT to LIT operating modes (DSLS) chip_enable_icd_dsls = false } diff --git a/src/app/icd/server/BUILD.gn b/src/app/icd/server/BUILD.gn index e1967c23f5..bef9a0730a 100644 --- a/src/app/icd/server/BUILD.gn +++ b/src/app/icd/server/BUILD.gn @@ -39,7 +39,6 @@ buildconfig_header("icd-server-buildconfig") { "CHIP_CONFIG_ENABLE_ICD_DSLS=${chip_enable_icd_dsls}", "ICD_REPORT_ON_ENTER_ACTIVE_MODE=${chip_icd_report_on_active_mode}", "ICD_MAX_NOTIFICATION_SUBSCRIBERS=${icd_max_notification_subscribers}", - "ICD_ENFORCE_SIT_SLOW_POLL_LIMIT=${icd_enforce_sit_slow_poll_limit}", ] visibility = [ ":icd-server-config" ] diff --git a/src/app/icd/server/ICDConfigurationData.cpp b/src/app/icd/server/ICDConfigurationData.cpp index cfd2325671..44d78bfadf 100644 --- a/src/app/icd/server/ICDConfigurationData.cpp +++ b/src/app/icd/server/ICDConfigurationData.cpp @@ -16,7 +16,6 @@ */ #include "ICDConfigurationData.h" -#include #include namespace chip { @@ -25,15 +24,16 @@ ICDConfigurationData ICDConfigurationData::instance; System::Clock::Milliseconds32 ICDConfigurationData::GetSlowPollingInterval() { -#if ICD_ENFORCE_SIT_SLOW_POLL_LIMIT - // When in SIT mode, the slow poll interval SHOULDN'T be greater than the SIT mode polling threshold, per spec. +#if CHIP_CONFIG_ENABLE_ICD_LIT + // When in SIT mode, the slow poll interval SHALL NOT be greater than the SIT mode polling threshold, per spec. // This is important for ICD device configured for LIT operation but currently operating as a SIT // due to a lack of client registration if (mICDMode == ICDMode::SIT && mSlowPollingInterval > kSITPollingThreshold) { return kSITPollingThreshold; } -#endif +#endif // CHIP_CONFIG_ENABLE_ICD_LIT + return mSlowPollingInterval; } diff --git a/src/app/icd/server/ICDConfigurationData.h b/src/app/icd/server/ICDConfigurationData.h index 0d6e17e55e..4d2597ef26 100644 --- a/src/app/icd/server/ICDConfigurationData.h +++ b/src/app/icd/server/ICDConfigurationData.h @@ -17,6 +17,7 @@ #pragma once +#include #include #include #include @@ -77,14 +78,11 @@ class ICDConfigurationData System::Clock::Seconds32 GetMaximumCheckInBackoff() { return mMaximumCheckInBackOff; } /** - * If ICD_ENFORCE_SIT_SLOW_POLL_LIMIT is set to 0, function will always return the configured Slow Polling interval - * (CHIP_DEVICE_CONFIG_ICD_SLOW_POLL_INTERVAL). - * - * If ICD_ENFORCE_SIT_SLOW_POLL_LIMIT is set to 1, the returned value will depend on the devices operating mode. + * The returned value will depend on the devices operating mode. * If ICDMode == SIT && the configured slow poll interval is superior to the maximum threshold (15s), the function will return - * the threshold (15s). If ICDMode == SIT but the configured slow poll interval is equal or inferior to the threshold, the - * function will the return the configured slow poll interval. If ICDMode == LIT, the function will return the configured slow - * poll interval. + * the threshold kSITPollingThreshold (<= 15s). If ICDMode == SIT but the configured slow poll interval is equal or inferior to + * the threshold, the function will the return the configured slow poll interval. If ICDMode == LIT, the function will return + * the configured slow poll interval. * * @return System::Clock::Milliseconds32 */ @@ -158,12 +156,18 @@ class ICDConfigurationData "Spec requires the MaximumCheckInBackOff to be equal or superior to the IdleModeDuration"); System::Clock::Seconds32 mMaximumCheckInBackOff = System::Clock::Seconds32(CHIP_CONFIG_ICD_MAXIMUM_CHECK_IN_BACKOFF_SEC); - // SIT ICDs should have a SlowPollingThreshold shorter than or equal to 15s (spec 9.16.1.5) - static_assert((CHIP_DEVICE_CONFIG_ICD_SIT_SLOW_POLL_LIMIT).count() <= 15000, + // SIT ICDs SHALL have a SlowPollingThreshold shorter than or equal to 15s (spec 9.16.1.5) + static constexpr System::Clock::Milliseconds32 kSitIcdSlowPollMaximum = System::Clock::Milliseconds32(15000); + static_assert((CHIP_DEVICE_CONFIG_ICD_SIT_SLOW_POLL_LIMIT).count() <= kSitIcdSlowPollMaximum.count(), "Spec requires the maximum slow poll interval for the SIT device to be smaller or equal than 15 s."); static constexpr System::Clock::Milliseconds32 kSITPollingThreshold = CHIP_DEVICE_CONFIG_ICD_SIT_SLOW_POLL_LIMIT; - System::Clock::Milliseconds32 mSlowPollingInterval = CHIP_DEVICE_CONFIG_ICD_SLOW_POLL_INTERVAL; - System::Clock::Milliseconds32 mFastPollingInterval = CHIP_DEVICE_CONFIG_ICD_FAST_POLL_INTERVAL; + +#if CHIP_CONFIG_ENABLE_ICD_LIT == 0 + static_assert((CHIP_DEVICE_CONFIG_ICD_SLOW_POLL_INTERVAL <= kSitIcdSlowPollMaximum), + "LIT support is required for slow polling intervals superior to 15 seconds"); +#endif + System::Clock::Milliseconds32 mSlowPollingInterval = CHIP_DEVICE_CONFIG_ICD_SLOW_POLL_INTERVAL; + System::Clock::Milliseconds32 mFastPollingInterval = CHIP_DEVICE_CONFIG_ICD_FAST_POLL_INTERVAL; ICDMode mICDMode = ICDMode::SIT; }; diff --git a/src/app/icd/server/ICDManager.cpp b/src/app/icd/server/ICDManager.cpp index 3e89af1e16..ba349b22b9 100644 --- a/src/app/icd/server/ICDManager.cpp +++ b/src/app/icd/server/ICDManager.cpp @@ -80,9 +80,6 @@ void ICDManager::Init() VerifyOrDieWithMsg(ICDConfigurationData::GetInstance().GetMinLitActiveModeThreshold() <= ICDConfigurationData::GetInstance().GetActiveModeThreshold(), AppServer, "The minimum ActiveModeThreshold value for a LIT ICD is 5 seconds."); - // Disabling check until LIT support is compelte - // VerifyOrDieWithMsg((GetSlowPollingInterval() <= GetSITPollingThreshold()) , AppServer, - // "LIT support is required for slow polling intervals superior to 15 seconds"); } #endif // CHIP_CONFIG_ENABLE_ICD_LIT From 9a148aba0fc2e25dd429fc209c3f6b73f0662f04 Mon Sep 17 00:00:00 2001 From: yunhanw-google Date: Mon, 7 Oct 2024 19:15:38 -0700 Subject: [PATCH 028/127] [java]fix errorcode in GetConnectedDeviceCallbackForTestJni (#35958) --- src/controller/java/AndroidCallbacks-ForTestJNI.cpp | 2 +- .../GetConnectedDeviceCallbackForTestJni.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/controller/java/AndroidCallbacks-ForTestJNI.cpp b/src/controller/java/AndroidCallbacks-ForTestJNI.cpp index 568e0ee847..1657aef819 100644 --- a/src/controller/java/AndroidCallbacks-ForTestJNI.cpp +++ b/src/controller/java/AndroidCallbacks-ForTestJNI.cpp @@ -43,7 +43,7 @@ JNI_METHOD(void, GetConnectedDeviceCallbackForTestJni, onDeviceConnected) } JNI_METHOD(void, GetConnectedDeviceCallbackForTestJni, onDeviceConnectionFailure) -(JNIEnv * env, jobject self, jlong callbackHandle, jint errorCode) +(JNIEnv * env, jobject self, jlong callbackHandle, jlong errorCode) { GetConnectedDeviceCallback * connectedDeviceCallback = reinterpret_cast(callbackHandle); VerifyOrReturn(connectedDeviceCallback != nullptr, ChipLogError(Controller, "GetConnectedDeviceCallbackJni handle is nullptr")); diff --git a/src/controller/java/src/chip/devicecontroller/GetConnectedDeviceCallbackForTestJni.java b/src/controller/java/src/chip/devicecontroller/GetConnectedDeviceCallbackForTestJni.java index a3321af6d3..bd1343387a 100644 --- a/src/controller/java/src/chip/devicecontroller/GetConnectedDeviceCallbackForTestJni.java +++ b/src/controller/java/src/chip/devicecontroller/GetConnectedDeviceCallbackForTestJni.java @@ -37,9 +37,9 @@ public void onDeviceConnected(GetConnectedDeviceCallbackJni callback) { private native void onDeviceConnected(long callbackHandle, long messagingContextHandle); - public void onDeviceConnectionFailure(GetConnectedDeviceCallbackJni callback, int errorCode) { + public void onDeviceConnectionFailure(GetConnectedDeviceCallbackJni callback, long errorCode) { onDeviceConnectionFailure(callback.getCallbackHandle(), errorCode); } - private native void onDeviceConnectionFailure(long callbackHandle, int errorCode); + private native void onDeviceConnectionFailure(long callbackHandle, long errorCode); } From cec1887241c19d3ab6cd8e23ad8e1c283fcb2723 Mon Sep 17 00:00:00 2001 From: yunhanw-google Date: Mon, 7 Oct 2024 19:58:22 -0700 Subject: [PATCH 029/127] Fix android batch command test (#35954) --- .../pairing/PairOnNetworkLongImExtendableInvokeCommand.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImExtendableInvokeCommand.kt b/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImExtendableInvokeCommand.kt index 0b1a2ab746..be1af1d62c 100644 --- a/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImExtendableInvokeCommand.kt +++ b/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImExtendableInvokeCommand.kt @@ -75,6 +75,7 @@ class PairOnNetworkLongImExtendableInvokeCommand( ) { setFailure("invoke failure with incorrect status") } + responseCount++ } if (clusterId == CLUSTER_ID_TEST && commandId == TEST_ADD_ARGUMENT_RSP_COMMAND) { @@ -89,8 +90,8 @@ class PairOnNetworkLongImExtendableInvokeCommand( if (status != null) { setFailure("invoke failure with incorrect status") } + responseCount++ } - responseCount++ } override fun onNoResponse(noInvokeResponseData: NoInvokeResponseData) { @@ -126,7 +127,7 @@ class PairOnNetworkLongImExtendableInvokeCommand( val element1: InvokeElement = InvokeElement.newInstance( - /* endpointId= */ 0, + /* endpointId= */ 1, CLUSTER_ID_IDENTIFY, IDENTIFY_COMMAND, tlvWriter1.getEncoded(), From 6ced85218f29e52d6671787a3ba1966d4470bf9f Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 8 Oct 2024 00:30:53 -0400 Subject: [PATCH 030/127] Make function argument a reference, to avoid passing in struct data around (#35950) * Make function argument a reference, to avoid passing in struct data around * Restyled by clang-format --------- Co-authored-by: Restyled.io --- .../codegen-data-model-provider/CodegenDataModelProvider.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/codegen-data-model-provider/CodegenDataModelProvider.cpp b/src/app/codegen-data-model-provider/CodegenDataModelProvider.cpp index 972e056513..7f7b7e14b8 100644 --- a/src/app/codegen-data-model-provider/CodegenDataModelProvider.cpp +++ b/src/app/codegen-data-model-provider/CodegenDataModelProvider.cpp @@ -318,7 +318,7 @@ bool operator==(const DataModel::DeviceTypeEntry & a, const EmberAfDeviceType & /// - index == types.size() // i.e. not found or there is no next /// /// hintWherePreviousMayBe represents a search hint where previous may exist. -unsigned FindNextDeviceTypeIndex(Span types, const DataModel::DeviceTypeEntry previous, +unsigned FindNextDeviceTypeIndex(Span types, const DataModel::DeviceTypeEntry & previous, unsigned hintWherePreviousMayBe) { if (hintWherePreviousMayBe < types.size()) From 9ccc52e00227070fddbb8485abe4767c7b324f01 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 8 Oct 2024 00:45:10 -0400 Subject: [PATCH 031/127] Remove a test-only method from base MTRDeviceController. (#35944) This is only used with concrete controllers from tests, and is already implemented by MTRDeviceController_Concrete. Also removes a test-only class method from MTRDeviceController_Concrete that MTRDeviceController already implements (and has to keep implementing, since the tests use it on MTRDeviceController itself, not an instance). --- src/darwin/Framework/CHIP/MTRDeviceController.mm | 12 ------------ .../Framework/CHIP/MTRDeviceController_Concrete.mm | 9 --------- 2 files changed, 21 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm index 0bfe6f45f4..fb13db9b00 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm @@ -441,18 +441,6 @@ - (void)removeDevice:(MTRDevice *)device } } -#ifdef DEBUG -- (NSDictionary *)unitTestGetDeviceAttributeCounts -{ - std::lock_guard lock(*self.deviceMapLock); - NSMutableDictionary * deviceAttributeCounts = [NSMutableDictionary dictionary]; - for (NSNumber * nodeID in _nodeIDToDeviceMap) { - deviceAttributeCounts[nodeID] = @([[_nodeIDToDeviceMap objectForKey:nodeID] unitTestAttributeCount]); - } - return deviceAttributeCounts; -} -#endif - - (BOOL)setOperationalCertificateIssuer:(nullable id)operationalCertificateIssuer queue:(nullable dispatch_queue_t)queue { diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm index cae4103d0f..47c373ac88 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm @@ -1679,15 +1679,6 @@ - (nullable NSNumber *)neededReadPrivilegeForClusterID:(NSNumber *)clusterID att return nil; } -#ifdef DEBUG -+ (void)forceLocalhostAdvertisingOnly -{ - auto interfaceIndex = chip::Inet::InterfaceId::PlatformType(kDNSServiceInterfaceIndexLocalOnly); - auto interfaceId = chip::Inet::InterfaceId(interfaceIndex); - chip::app::DnssdServer::Instance().SetInterfaceId(interfaceId); -} -#endif // DEBUG - @end /** From 0d78b5f037e580a670b7327ad463654e8df92601 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 8 Oct 2024 02:45:48 -0400 Subject: [PATCH 032/127] Fix attribute-table logs to not log strings as %p. (#35941) Fixes https://github.com/project-chip/connectedhomeip/issues/35928 --- src/app/util/attribute-table.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/util/attribute-table.cpp b/src/app/util/attribute-table.cpp index 0d68701b63..40e690b1de 100644 --- a/src/app/util/attribute-table.cpp +++ b/src/app/util/attribute-table.cpp @@ -342,8 +342,8 @@ Status emAfWriteAttribute(const ConcreteAttributePath & path, const EmberAfWrite // if we dont support that attribute if (metadata == nullptr) { - ChipLogProgress(Zcl, "%p ep %x clus " ChipLogFormatMEI " attr " ChipLogFormatMEI " not supported", - "WRITE ERR: ", path.mEndpointId, ChipLogValueMEI(path.mClusterId), ChipLogValueMEI(path.mAttributeId)); + ChipLogProgress(Zcl, "WRITE ERR: ep %x clus " ChipLogFormatMEI " attr " ChipLogFormatMEI " not supported", path.mEndpointId, + ChipLogValueMEI(path.mClusterId), ChipLogValueMEI(path.mAttributeId)); return status; } @@ -352,13 +352,13 @@ Status emAfWriteAttribute(const ConcreteAttributePath & path, const EmberAfWrite { if (input.dataType != metadata->attributeType) { - ChipLogProgress(Zcl, "%p invalid data type", "WRITE ERR: "); + ChipLogProgress(Zcl, "WRITE ERR: invalid data type"); return Status::InvalidDataType; } if (metadata->IsReadOnly()) { - ChipLogProgress(Zcl, "%p attr not writable", "WRITE ERR: "); + ChipLogProgress(Zcl, "WRITE ERR: attr not writable"); return Status::UnsupportedWrite; } } From 4c4970a48f79575487928e927e123df722712f37 Mon Sep 17 00:00:00 2001 From: C Freeman Date: Tue, 8 Oct 2024 02:47:38 -0400 Subject: [PATCH 033/127] Documentation: getting started - changing examples (#35929) * Documentation: getting started - changing examples Add a new documentation file that shows how to change, re-gen and recompile examples. * Add to index * Fix spelling --- docs/getting_started/changing_examples.md | 64 +++++++++++++++++++++++ docs/getting_started/index.md | 5 +- 2 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 docs/getting_started/changing_examples.md diff --git a/docs/getting_started/changing_examples.md b/docs/getting_started/changing_examples.md new file mode 100644 index 0000000000..611610ce43 --- /dev/null +++ b/docs/getting_started/changing_examples.md @@ -0,0 +1,64 @@ +# Changing Examples + +The composition of most examples in the SDK is static and code generated. + +The tool used to describe and change the composition of an example is called +ZAP. More information about ZAP and a walk-through of the tool can be found in +the [ZAP introduction](./zap.md). The composition of the device is captured in a +.zap file, which is readable by the ZAP tool. This is then compiled into a +human-readable .matter file, which is used to build the static features of the +example. + +To change the composition of a device example, you need to + +1. Change the zap file to implement your desired changes +2. Run the code generation tool to generate the .matter file +3. Re-build the example + +## Changing the zap file in an example + +Most examples in the SDK keep the .zap file in a sub-directory called +example-name-common (ex. lighting-common). To load an existing .zap file into +the ZAP tool, from the chip-root use + +``` +./scripts/tools/zap/run_zaptool.sh +``` + +For example, to make changes to the lighting app, use: + +``` +./scripts/tools/zap/run_zaptool.sh examples/lighting-app/lighting-common/lighting-app.zap +``` + +This will open the ZAP GUI tool, which can be used to change the endpoint +composition, clusters, features, attributes, commands and events exposed by the +device. + +Details of how to use the tool can be found in the [ZAP Introduction](./zap.md). + +## Running code generation + +To compile the .matter file for use in building, use: + +``` +./scripts/tools/zap/generate.py +``` + +For example, for changes to the lighting app, use: + +``` +./scripts/tools/zap/generate.py examples/lighting-app/lighting-common/lighting-app.zap +``` + +If there are changes to many .zap files, the following script can be used to +recompile the .zap files for all the examples and the controller. + +``` + ./scripts/tools/zap_regen_all.py +``` + +## Rebuilding the example + +After generating the .matter file, re-build the example. Instructions for +building examples are given in [Building your first example](./first_example.md) diff --git a/docs/getting_started/index.md b/docs/getting_started/index.md index ea881141ff..098f047ed7 100644 --- a/docs/getting_started/index.md +++ b/docs/getting_started/index.md @@ -12,5 +12,6 @@ The following docs are a brief introduction to SDK development. ``` - [Running your first example](./first_example.md) -- [SDK Basics](./SDKBasics.md) -- [ZAP](./zap.md) +- [Changing examples](./changing_examples.md) +- [SDK Architecture Introduction](./SDKBasics.md) +- [ZAP Introduction](./zap.md) From 1dadbe433c3587a7a55800f03b88e7f00310000a Mon Sep 17 00:00:00 2001 From: mkardous-silabs <84793247+mkardous-silabs@users.noreply.github.com> Date: Tue, 8 Oct 2024 05:15:32 -0400 Subject: [PATCH 034/127] Add missing feature map bit (#35915) (#35961) * Add missing feature map bit * Generation From 9b34d55917bf345c28e88f6a01395a8ae8b8956d Mon Sep 17 00:00:00 2001 From: Arkadiusz Bokowy Date: Tue, 8 Oct 2024 15:18:59 +0200 Subject: [PATCH 035/127] Fix --int-arg, --bool-arg, etc options parsing (#35249) * Fix --int-arg, --bool-arg, etc options parsing * Update CI arguments * Convert to YAML * Support mixed arguments type: multi and append * Restyled by isort --------- Co-authored-by: Restyled.io --- src/python_testing/TC_ACE_1_4.py | 14 +++++----- src/python_testing/TC_EWATERHTR_2_1.py | 27 ++++++++++++++----- src/python_testing/TC_RVCCLEANM_2_1.py | 25 ++++++++++++----- src/python_testing/TC_RVCRUNM_2_1.py | 25 ++++++++++++----- src/python_testing/TC_RVCRUNM_2_2.py | 25 ++++++++++++----- .../TestMatterTestingSupport.py | 20 +++++++++++++- src/python_testing/matter_testing_support.py | 15 ++++++----- 7 files changed, 110 insertions(+), 41 deletions(-) diff --git a/src/python_testing/TC_ACE_1_4.py b/src/python_testing/TC_ACE_1_4.py index 9344b0bd3e..4d6e00ec1c 100644 --- a/src/python_testing/TC_ACE_1_4.py +++ b/src/python_testing/TC_ACE_1_4.py @@ -22,18 +22,20 @@ # test-runner-runs: # run1: # app: ${ALL_CLUSTERS_APP} -# factoryreset: true -# quiet: true # app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json # script-args: > # --storage-path admin_storage.json # --commissioning-method on-network # --discriminator 1234 # --passcode 20202021 -# --int-arg PIXIT.ACE.APPENDPOINT:1 PIXIT.ACE.APPDEVTYPEID:0x0100 -# --string-arg PIXIT.ACE.APPCLUSTER:OnOff PIXIT.ACE.APPATTRIBUTE:OnOff +# --int-arg PIXIT.ACE.APPENDPOINT:1 +# --int-arg PIXIT.ACE.APPDEVTYPEID:0x0100 +# --string-arg PIXIT.ACE.APPCLUSTER:OnOff +# --string-arg PIXIT.ACE.APPATTRIBUTE:OnOff # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factoryreset: true +# quiet: true # === END CI TEST ARGUMENTS === import sys @@ -45,8 +47,8 @@ # This test requires several additional command line arguments # run with -# --int-arg PIXIT.ACE.ENDPOINT: PIXIT.ACE.APPDEVTYPE: -# --string-arg PIXIT.ACE.APPCLUSTER: PIXIT.ACE.APPATTRIBUTE: +# --int-arg PIXIT.ACE.ENDPOINT: --int-arg PIXIT.ACE.APPDEVTYPE: +# --string-arg PIXIT.ACE.APPCLUSTER: --string-arg PIXIT.ACE.APPATTRIBUTE: def str_to_cluster(str): diff --git a/src/python_testing/TC_EWATERHTR_2_1.py b/src/python_testing/TC_EWATERHTR_2_1.py index e9ae195f98..8ee466a547 100644 --- a/src/python_testing/TC_EWATERHTR_2_1.py +++ b/src/python_testing/TC_EWATERHTR_2_1.py @@ -19,12 +19,27 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_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 --enable-key 000102030405060708090a0b0c0d0e0f --featureSet 0x03 --application water-heater -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# --featureSet 0x03 +# --application water-heater +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factoryreset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_RVCCLEANM_2_1.py b/src/python_testing/TC_RVCCLEANM_2_1.py index 8e5013ad4c..c9b8362eb2 100644 --- a/src/python_testing/TC_RVCCLEANM_2_1.py +++ b/src/python_testing/TC_RVCCLEANM_2_1.py @@ -19,12 +19,23 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_RVC_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 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.RVCCLEANM.MODE_CHANGE_FAIL:1 PIXIT.RVCCLEANM.MODE_CHANGE_OK:2 +# test-runner-runs: +# run1: +# app: ${CHIP_RVC_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --int-arg PIXIT.RVCCLEANM.MODE_CHANGE_FAIL:1 +# --int-arg PIXIT.RVCCLEANM.MODE_CHANGE_OK:2 +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factoryreset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging @@ -35,7 +46,7 @@ # This test requires several additional command line arguments # run with -# --int-arg PIXIT.RVCCLEANM.MODE_CHANGE_OK: PIXIT.RVCCLEANM.MODE_CHANGE_FAIL: +# --int-arg PIXIT.RVCCLEANM.MODE_CHANGE_OK: --int-arg PIXIT.RVCCLEANM.MODE_CHANGE_FAIL: class TC_RVCCLEANM_2_1(MatterBaseTest): diff --git a/src/python_testing/TC_RVCRUNM_2_1.py b/src/python_testing/TC_RVCRUNM_2_1.py index 2693cb041a..d3da69a6fa 100644 --- a/src/python_testing/TC_RVCRUNM_2_1.py +++ b/src/python_testing/TC_RVCRUNM_2_1.py @@ -19,12 +19,23 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_RVC_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 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_CHANGE_OK:0 PIXIT.RVCRUNM.MODE_CHANGE_FAIL:2 +# test-runner-runs: +# run1: +# app: ${CHIP_RVC_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --endpoint 1 +# --int-arg PIXIT.RVCRUNM.MODE_CHANGE_OK:0 +# --int-arg PIXIT.RVCRUNM.MODE_CHANGE_FAIL:2 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factoryreset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging @@ -35,7 +46,7 @@ # This test requires several additional command line arguments # run with -# --int-arg PIXIT.RVCRUNM.MODE_CHANGE_OK: PIXIT.RVCRUNM.MODE_CHANGE_FAIL: +# --int-arg PIXIT.RVCRUNM.MODE_CHANGE_OK: --int-arg PIXIT.RVCRUNM.MODE_CHANGE_FAIL: # For running in CI, it is expected that OK=0 and FAIL=2 diff --git a/src/python_testing/TC_RVCRUNM_2_2.py b/src/python_testing/TC_RVCRUNM_2_2.py index 3a2ce23ea2..0eefcc20a9 100644 --- a/src/python_testing/TC_RVCRUNM_2_2.py +++ b/src/python_testing/TC_RVCRUNM_2_2.py @@ -19,12 +19,23 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_RVC_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 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 +# test-runner-runs: +# run1: +# app: ${CHIP_RVC_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --endpoint 1 +# --int-arg PIXIT.RVCRUNM.MODE_A:1 +# --int-arg PIXIT.RVCRUNM.MODE_B:2 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factoryreset: true +# quiet: true # === END CI TEST ARGUMENTS === import enum @@ -35,7 +46,7 @@ # This test requires several additional command line arguments. # Run the test with -# --int-arg PIXIT.RVCRUNM.MODE_A: PIXIT.RVCRUNM.MODE_B: +# --int-arg PIXIT.RVCRUNM.MODE_A: --int-arg PIXIT.RVCRUNM.MODE_B: class RvcStatusEnum(enum.IntEnum): diff --git a/src/python_testing/TestMatterTestingSupport.py b/src/python_testing/TestMatterTestingSupport.py index d2a259f154..08c3e830d2 100644 --- a/src/python_testing/TestMatterTestingSupport.py +++ b/src/python_testing/TestMatterTestingSupport.py @@ -24,7 +24,7 @@ from chip.clusters.Types import Nullable, NullValue from chip.tlv import uint from matter_testing_support import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, - get_wait_seconds_from_set_time, type_matches, utc_time_in_matter_epoch) + get_wait_seconds_from_set_time, parse_matter_test_args, type_matches, utc_time_in_matter_epoch) from mobly import asserts, signals from pics_support import parse_pics, parse_pics_xml from taglist_and_topology_test_support import (TagProblem, create_device_type_list_for_root, create_device_type_lists, @@ -629,6 +629,24 @@ def test_xml_pics(self): self.pics_assert('BINFO.S.A0014', False) self.pics_assert('PICSDOESNOTEXIST', False) + def test_parse_matter_test_args(self): + args = [ + # Verify that values are appended to a single argument + "--int-arg", "PIXIT.TEST.DEC:42", + "--int-arg", "PIXIT.TEST.HEX:0x1234", + # Verify that multiple values can be passed for a single argument + "--string-arg", "PIXIT.TEST.STR.MULTI.1:foo", "PIXIT.TEST.STR.MULTI.2:bar", + # Verify JSON parsing + "--json-arg", "PIXIT.TEST.JSON:{\"key\":\"value\"}", + ] + + parsed = parse_matter_test_args(args) + asserts.assert_equal(parsed.global_test_params.get("PIXIT.TEST.DEC"), 42) + asserts.assert_equal(parsed.global_test_params.get("PIXIT.TEST.HEX"), 0x1234) + asserts.assert_equal(parsed.global_test_params.get("PIXIT.TEST.STR.MULTI.1"), "foo") + asserts.assert_equal(parsed.global_test_params.get("PIXIT.TEST.STR.MULTI.2"), "bar") + asserts.assert_equal(parsed.global_test_params.get("PIXIT.TEST.JSON"), {"key": "value"}) + if __name__ == "__main__": default_matter_test_main() diff --git a/src/python_testing/matter_testing_support.py b/src/python_testing/matter_testing_support.py index 92cde9edb6..2e153a37de 100644 --- a/src/python_testing/matter_testing_support.py +++ b/src/python_testing/matter_testing_support.py @@ -38,6 +38,7 @@ from datetime import datetime, timedelta, timezone from enum import Enum, IntFlag from functools import partial +from itertools import chain from typing import Any, Iterable, List, Optional, Tuple from chip.tlv import float32, uint @@ -1842,7 +1843,7 @@ def convert_args_to_matter_config(args: argparse.Namespace) -> MatterTestConfig: all_global_args = [] argsets = [item for item in (args.int_arg, args.float_arg, args.string_arg, args.json_arg, args.hex_arg, args.bool_arg) if item is not None] - for argset in argsets: + for argset in chain.from_iterable(argsets): all_global_args.extend(argset) config.global_test_params = {} @@ -1954,17 +1955,17 @@ def parse_matter_test_args(argv: Optional[List[str]] = None) -> MatterTestConfig help='Path to chip-tool credentials file root') args_group = parser.add_argument_group(title="Config arguments", description="Test configuration global arguments set") - args_group.add_argument('--int-arg', nargs='*', type=int_named_arg, metavar="NAME:VALUE", + args_group.add_argument('--int-arg', nargs='*', action='append', type=int_named_arg, metavar="NAME:VALUE", help="Add a named test argument for an integer as hex or decimal (e.g. -2 or 0xFFFF_1234)") - args_group.add_argument('--bool-arg', nargs='*', type=bool_named_arg, metavar="NAME:VALUE", + args_group.add_argument('--bool-arg', nargs='*', action='append', type=bool_named_arg, metavar="NAME:VALUE", help="Add a named test argument for an boolean value (e.g. true/false or 0/1)") - args_group.add_argument('--float-arg', nargs='*', type=float_named_arg, metavar="NAME:VALUE", + args_group.add_argument('--float-arg', nargs='*', action='append', type=float_named_arg, metavar="NAME:VALUE", help="Add a named test argument for a floating point value (e.g. -2.1 or 6.022e23)") - args_group.add_argument('--string-arg', nargs='*', type=str_named_arg, metavar="NAME:VALUE", + args_group.add_argument('--string-arg', nargs='*', action='append', type=str_named_arg, metavar="NAME:VALUE", help="Add a named test argument for a string value") - args_group.add_argument('--json-arg', nargs='*', type=json_named_arg, metavar="NAME:VALUE", + args_group.add_argument('--json-arg', nargs='*', action='append', type=json_named_arg, metavar="NAME:VALUE", help="Add a named test argument for JSON stored as a list or dict") - args_group.add_argument('--hex-arg', nargs='*', type=bytes_as_hex_named_arg, metavar="NAME:VALUE", + args_group.add_argument('--hex-arg', nargs='*', action='append', type=bytes_as_hex_named_arg, metavar="NAME:VALUE", help="Add a named test argument for an octet string in hex (e.g. 0011cafe or 00:11:CA:FE)") if not argv: From 6034c87bd1145f267d53565f5593e4234e405908 Mon Sep 17 00:00:00 2001 From: Arkadiusz Bokowy Date: Tue, 8 Oct 2024 15:32:33 +0200 Subject: [PATCH 036/127] Add TC_BRBINFO_4_1 to CI (#35940) * Use async sleep instead of blocking one * Keep AppServer wrapper class in chip.testing.tasks * Fix typos * Arguments for CI workflow * Require dut_fsa_stdin_pipe options in CI run * Start ICD server on CI run * Read all attributes defined in test plan * Wrap ICD server with IcdAppServerSubprocess * Move app testing wrappers to chip.testing.apps * Add TODO for fixing imports in unit test * Restyled by isort * Remove test from exception list --------- Co-authored-by: Restyled.io --- src/python_testing/TC_BRBINFO_4_1.py | 218 ++++++++++-------- src/python_testing/TC_CCTRL_2_2.py | 8 +- src/python_testing/TC_CCTRL_2_3.py | 8 +- src/python_testing/TC_ECOINFO_2_1.py | 8 +- src/python_testing/TC_ECOINFO_2_2.py | 8 +- src/python_testing/TC_MCORE_FS_1_1.py | 28 +-- src/python_testing/TC_MCORE_FS_1_2.py | 18 +- src/python_testing/TC_MCORE_FS_1_3.py | 8 +- src/python_testing/TC_MCORE_FS_1_4.py | 16 +- src/python_testing/TC_MCORE_FS_1_5.py | 18 +- src/python_testing/execute_python_tests.py | 1 - .../matter_testing_infrastructure/BUILD.gn | 1 + .../chip/testing/apps.py | 69 ++++++ .../chip/testing/test_tasks.py | 4 + 14 files changed, 260 insertions(+), 153 deletions(-) create mode 100644 src/python_testing/matter_testing_infrastructure/chip/testing/apps.py diff --git a/src/python_testing/TC_BRBINFO_4_1.py b/src/python_testing/TC_BRBINFO_4_1.py index 32dd541d66..f0c194ac2b 100644 --- a/src/python_testing/TC_BRBINFO_4_1.py +++ b/src/python_testing/TC_BRBINFO_4_1.py @@ -15,22 +15,44 @@ # 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: +# app: examples/fabric-admin/scripts/fabric-sync-app.py +# app-args: --app-admin=${FABRIC_ADMIN_APP} --app-bridge=${FABRIC_BRIDGE_APP} --stdin-pipe=dut-fsa-stdin --discriminator=1234 +# app-ready-pattern: "Successfully opened pairing window on the device" +# script-args: > +# --PICS src/app/tests/suites/certification/ci-pics-values +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --string-arg th_icd_server_app_path:${LIT_ICD_APP} dut_fsa_stdin_pipe:dut-fsa-stdin +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factoryreset: true +# quiet: true +# === END CI TEST ARGUMENTS === + # 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_icd_server_app_path:out/linux-x64-lit-icd/lit-icd-app +import asyncio import logging import os import queue -import signal -import subprocess -import time -import uuid +import random +import tempfile import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.interaction_model import InteractionModelError, Status +from chip.testing.apps import IcdAppServerSubprocess from matter_testing_support import MatterBaseTest, SimpleEventCallback, TestStep, async_test_body, default_matter_test_main from mobly import asserts @@ -40,13 +62,6 @@ class TC_BRBINFO_4_1(MatterBaseTest): - # - # Class Helper functions - # - - async def _read_attribute_expect_success(self, endpoint, cluster, attribute, node_id): - return await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=attribute, node_id=node_id) - # This test has some manual steps and also multiple sleeps >= 30 seconds. Test typically runs under 3 mins, # so 6 minutes is more than enough. @property @@ -58,7 +73,7 @@ def desc_TC_BRBINFO_4_1(self) -> str: return "[TC_BRBINFO_4_1] Verification of KeepActive Command [DUT-Server]" def steps_TC_BRBINFO_4_1(self) -> list[TestStep]: - steps = [ + return [ TestStep("0", "DUT commissioned and preconditions", is_commissioning=True), TestStep("1", "TH reads from the ICD the A_IDLE_MODE_DURATION, A_ACTIVE_MODE_DURATION, and ACTIVE_MODE_THRESHOLD attributes"), TestStep("2", "Setting up subscribe to ActiveChange event"), @@ -77,16 +92,16 @@ def steps_TC_BRBINFO_4_1(self) -> list[TestStep]: TestStep("15", "Send KeepActive command with shortest TimeoutMs value while TH_ICD is prevented from sending check-ins"), TestStep("16", "Wait 15 seconds then send second KeepActive command with double the TimeoutMs value of the previous step"), TestStep("17", "TH allows TH_ICD to resume sending check-ins after timeout from step 15 expired but before second timeout from step 16 still valid"), - TestStep("18", "Wait for TH_ICD to check into TH, then confirm we have received new event from DUT")] - return steps + TestStep("18", "Wait for TH_ICD to check into TH, then confirm we have received new event from DUT"), + ] - def _ask_for_vendor_commissioniong_ux_operation(self, discriminator, setupPinCode, setupManualCode, setupQRCode): + def _ask_for_vendor_commissioning_ux_operation(self, discriminator, setupPinCode, setupManualCode, setupQRCode): self.wait_for_user_input( prompt_msg=f"Using the DUT vendor's provided interface, commission the ICD device using the following parameters:\n" f"- discriminator: {discriminator}\n" f"- setupPinCode: {setupPinCode}\n" f"- setupQRCode: {setupQRCode}\n" - f"- setupManualcode: {setupManualCode}\n" + f"- setupManualCode: {setupManualCode}\n" f"If using FabricSync Admin test app, you may type:\n" f">>> pairing onnetwork 111 {setupPinCode} --icd-registration true") @@ -117,81 +132,88 @@ async def _get_dynamic_endpoint(self) -> int: @async_test_body async def setup_class(self): + super().setup_class() + # These steps are not explicitly, but they help identify the dynamically added endpoint # The second part of this process happens on _get_dynamic_endpoint() - root_part_list = await self.read_single_attribute_check_success(cluster=Clusters.Descriptor, attribute=Clusters.Descriptor.Attributes.PartsList, endpoint=_ROOT_ENDPOINT_ID) + root_part_list = await self.read_single_attribute_check_success( + cluster=Clusters.Descriptor, + attribute=Clusters.Descriptor.Attributes.PartsList, + endpoint=_ROOT_ENDPOINT_ID) self.set_of_dut_endpoints_before_adding_device = set(root_part_list) - super().setup_class() self._active_change_event_subscription = None - self.app_process = 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_ICD_SERVER app. Specify app path with --string-arg th_icd_server_app_path:') - - self.kvs = f'kvs_{str(uuid.uuid4())}' - discriminator = 3850 - passcode = 20202021 - cmd = [app] - cmd.extend(['--secured-device-port', str(5543)]) - cmd.extend(['--discriminator', str(discriminator)]) - cmd.extend(['--passcode', str(passcode)]) - cmd.extend(['--KVS', self.kvs]) + self.th_icd_server = None + self.storage = None - logging.info("Starting ICD Server App") - self.app_process = subprocess.Popen(cmd) - logging.info("ICD started") - time.sleep(3) + th_icd_server_app = self.user_params.get("th_icd_server_app_path", None) + if not th_icd_server_app: + asserts.fail('This test requires a TH_ICD_SERVER app. Specify app path with --string-arg th_icd_server_app_path:') + if not os.path.exists(th_icd_server_app): + asserts.fail(f'The path {th_icd_server_app} does not exist') + + # Create a temporary storage directory for keeping KVS files. + self.storage = tempfile.TemporaryDirectory(prefix=self.__class__.__name__) + logging.info("Temporary storage directory: %s", self.storage.name) + + if self.is_pics_sdk_ci_only: + # Get the named pipe path for the DUT_FSA app input from the user params. + dut_fsa_stdin_pipe = self.user_params.get("dut_fsa_stdin_pipe") + if not dut_fsa_stdin_pipe: + asserts.fail("CI setup requires --string-arg dut_fsa_stdin_pipe:") + self.dut_fsa_stdin = open(dut_fsa_stdin_pipe, "w") + + self.th_icd_server_port = 5543 + self.th_icd_server_discriminator = random.randint(0, 4095) + self.th_icd_server_passcode = 20202021 + + # Start the TH_ICD_SERVER app. + self.th_icd_server = IcdAppServerSubprocess( + th_icd_server_app, + storage_dir=self.storage.name, + port=self.th_icd_server_port, + discriminator=self.th_icd_server_discriminator, + passcode=self.th_icd_server_passcode) + self.th_icd_server.start( + expected_output="Server initialization complete", + timeout=30) 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) + await self.default_controller.CommissionOnNetwork( + nodeId=self.icd_nodeid, + setupPinCode=self.th_icd_server_passcode, + filterType=ChipDeviceCtrl.DiscoveryFilterType.LONG_DISCRIMINATOR, + filter=self.th_icd_server_discriminator) logging.info("Commissioning of ICD to fabric two (DUT)") params = await self.openCommissioningWindow(dev_ctrl=self.default_controller, node_id=self.icd_nodeid) - self._ask_for_vendor_commissioniong_ux_operation(params.randomDiscriminator, params.commissioningParameters.setupPinCode, - params.commissioningParameters.setupManualCode, params.commissioningParameters.setupQRCode) + if not self.is_pics_sdk_ci_only: + self._ask_for_vendor_commissioning_ux_operation( + params.randomDiscriminator, + params.commissioningParameters.setupPinCode, + params.commissioningParameters.setupManualCode, + params.commissioningParameters.setupQRCode) + else: + self.dut_fsa_stdin.write( + f"pairing onnetwork 2 {params.commissioningParameters.setupPinCode} --icd-registration true\n") + self.dut_fsa_stdin.flush() + # Wait for the commissioning to complete. + await asyncio.sleep(5) def teardown_class(self): if self._active_change_event_subscription is not None: self._active_change_event_subscription.Shutdown() self._active_change_event_subscription = None - - # 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() - - if os.path.exists(self.kvs): - os.remove(self.kvs) - + if self.th_icd_server is not None: + self.th_icd_server.terminate() + if self.storage is not None: + self.storage.cleanup() 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 # @@ -210,34 +232,42 @@ async def test_TC_BRBINFO_4_1(self): self.step("0") logging.info("Ensuring DUT is commissioned to TH") - # Confirms commissioning of DUT on TH as it reads its fature map - await self._read_attribute_expect_success( - _ROOT_ENDPOINT_ID, - basic_info_cluster, - basic_info_attributes.FeatureMap, - self.dut_node_id + # Confirms commissioning of DUT on TH as it reads its feature map + await self.read_single_attribute_check_success( + endpoint=_ROOT_ENDPOINT_ID, + cluster=basic_info_cluster, + attribute=basic_info_attributes.FeatureMap, + node_id=self.dut_node_id, ) logging.info("Ensuring ICD is commissioned to TH") self.step("1") - idle_mode_duration_s = await self._read_attribute_expect_success( - _ROOT_ENDPOINT_ID, - icdm_cluster, - icdm_attributes.IdleModeDuration, - self.icd_nodeid + idle_mode_duration_s = await self.read_single_attribute_check_success( + endpoint=_ROOT_ENDPOINT_ID, + cluster=icdm_cluster, + attribute=icdm_attributes.IdleModeDuration, + node_id=self.icd_nodeid, ) logging.info(f"IdleModeDurationS: {idle_mode_duration_s}") - active_mode_duration_ms = await self._read_attribute_expect_success( - _ROOT_ENDPOINT_ID, - icdm_cluster, - icdm_attributes.ActiveModeDuration, - self.icd_nodeid + active_mode_duration_ms = await self.read_single_attribute_check_success( + endpoint=_ROOT_ENDPOINT_ID, + cluster=icdm_cluster, + attribute=icdm_attributes.ActiveModeDuration, + node_id=self.icd_nodeid, ) logging.info(f"ActiveModeDurationMs: {active_mode_duration_ms}") + active_mode_threshold_ms = await self.read_single_attribute_check_success( + endpoint=_ROOT_ENDPOINT_ID, + cluster=icdm_cluster, + attribute=icdm_attributes.ActiveModeThreshold, + node_id=self.icd_nodeid, + ) + logging.info(f"ActiveModeThresholdMs: {active_mode_threshold_ms}") + self.step("2") event = brb_info_cluster.Events.ActiveChanged self.q = queue.Queue() @@ -292,7 +322,7 @@ async def test_TC_BRBINFO_4_1(self): asserts.assert_equal(self.q.qsize(), 0, "Unexpected event received from DUT") self.step("9") - self.pause_th_icd_server(check_state=True) + self.th_icd_server.pause() # sends 3x keep active commands stay_active_duration_ms = 2000 keep_active_timeout_ms = 60000 @@ -304,7 +334,7 @@ async def test_TC_BRBINFO_4_1(self): await self._send_keep_active_command(stay_active_duration_ms, keep_active_timeout_ms, dynamic_endpoint_id) self.step("10") - self.resume_th_icd_server(check_state=True) + self.th_icd_server.resume() await self.default_controller.WaitForActive(self.icd_nodeid, timeoutSeconds=wait_for_icd_checkin_timeout_s, stayActiveDurationMs=5000) promised_active_duration_ms = await self._wait_for_active_changed_event(timeout_s=wait_for_dut_event_subscription_s) asserts.assert_equal(self.q.qsize(), 0, "More than one event received from DUT") @@ -314,14 +344,14 @@ async def test_TC_BRBINFO_4_1(self): asserts.assert_equal(self.q.qsize(), 0, "More than one event received from DUT") self.step("12") - self.pause_th_icd_server(check_state=True) + self.th_icd_server.pause() stay_active_duration_ms = 2000 keep_active_timeout_ms = 30000 await self._send_keep_active_command(stay_active_duration_ms, keep_active_timeout_ms, dynamic_endpoint_id) self.step("13") - time.sleep(30) - self.resume_th_icd_server(check_state=True) + await asyncio.sleep(30) + self.th_icd_server.resume() self.step("14") await self.default_controller.WaitForActive(self.icd_nodeid, timeoutSeconds=wait_for_icd_checkin_timeout_s, stayActiveDurationMs=5000) @@ -329,20 +359,20 @@ async def test_TC_BRBINFO_4_1(self): asserts.assert_equal(self.q.qsize(), 0, "Unexpected event received from DUT") self.step("15") - self.pause_th_icd_server(check_state=True) + self.th_icd_server.pause() stay_active_duration_ms = 2000 keep_active_timeout_ms = 30000 await self._send_keep_active_command(stay_active_duration_ms, keep_active_timeout_ms, dynamic_endpoint_id) self.step("16") - time.sleep(15) + await asyncio.sleep(15) stay_active_duration_ms = 2000 keep_active_timeout_ms = 60000 await self._send_keep_active_command(stay_active_duration_ms, keep_active_timeout_ms, dynamic_endpoint_id) self.step("17") - time.sleep(15) - self.resume_th_icd_server(check_state=True) + await asyncio.sleep(15) + self.th_icd_server.resume() self.step("18") await self.default_controller.WaitForActive(self.icd_nodeid, timeoutSeconds=wait_for_icd_checkin_timeout_s, stayActiveDurationMs=5000) diff --git a/src/python_testing/TC_CCTRL_2_2.py b/src/python_testing/TC_CCTRL_2_2.py index 4b6f800170..ea2918fcc0 100644 --- a/src/python_testing/TC_CCTRL_2_2.py +++ b/src/python_testing/TC_CCTRL_2_2.py @@ -49,10 +49,10 @@ import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.interaction_model import InteractionModelError, Status +from chip.testing.apps import AppServerSubprocess from matter_testing_support import (MatterBaseTest, TestStep, async_test_body, default_matter_test_main, has_cluster, run_if_endpoint_matches) from mobly import asserts -from TC_MCORE_FS_1_1 import AppServer class TC_CCTRL_2_2(MatterBaseTest): @@ -79,13 +79,15 @@ async def setup_class(self): self.th_server_passcode = 20202021 # Start the TH_SERVER app. - self.th_server = AppServer( + self.th_server = AppServerSubprocess( th_server_app, storage_dir=self.storage.name, port=self.th_server_port, discriminator=self.th_server_discriminator, passcode=self.th_server_passcode) - self.th_server.start() + self.th_server.start( + expected_output="Server initialization complete", + timeout=30) logging.info("Commissioning from separate fabric") diff --git a/src/python_testing/TC_CCTRL_2_3.py b/src/python_testing/TC_CCTRL_2_3.py index 15f7304dab..c5ccaa8377 100644 --- a/src/python_testing/TC_CCTRL_2_3.py +++ b/src/python_testing/TC_CCTRL_2_3.py @@ -49,10 +49,10 @@ import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.interaction_model import InteractionModelError, Status +from chip.testing.apps import AppServerSubprocess from matter_testing_support import (MatterBaseTest, TestStep, async_test_body, default_matter_test_main, has_cluster, run_if_endpoint_matches) from mobly import asserts -from TC_MCORE_FS_1_1 import AppServer class TC_CCTRL_2_3(MatterBaseTest): @@ -79,13 +79,15 @@ async def setup_class(self): self.th_server_passcode = 20202021 # Start the TH_SERVER app. - self.th_server = AppServer( + self.th_server = AppServerSubprocess( th_server_app, storage_dir=self.storage.name, port=self.th_server_port, discriminator=self.th_server_discriminator, passcode=self.th_server_passcode) - self.th_server.start() + self.th_server.start( + expected_output="Server initialization complete", + timeout=30) logging.info("Commissioning from separate fabric") diff --git a/src/python_testing/TC_ECOINFO_2_1.py b/src/python_testing/TC_ECOINFO_2_1.py index f3f22bb99c..cd966e4c14 100644 --- a/src/python_testing/TC_ECOINFO_2_1.py +++ b/src/python_testing/TC_ECOINFO_2_1.py @@ -46,10 +46,10 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import Status +from chip.testing.apps import AppServerSubprocess from chip.tlv import uint from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts -from TC_MCORE_FS_1_1 import AppServer class TC_ECOINFO_2_1(MatterBaseTest): @@ -95,13 +95,15 @@ async def _setup_ci_prerequisites(self): self.th_server_passcode = 20202021 # Start the server app. - self.th_server = AppServer( + self.th_server = AppServerSubprocess( th_server_app, storage_dir=self.storage.name, port=self.th_server_port, discriminator=self.th_server_discriminator, passcode=self.th_server_passcode) - self.th_server.start() + self.th_server.start( + expected_output="Server initialization complete", + timeout=30) # Add some server to the DUT_FSA's Aggregator/Bridge. self.dut_fsa_stdin.write(f"pairing onnetwork 2 {self.th_server_passcode}\n") diff --git a/src/python_testing/TC_ECOINFO_2_2.py b/src/python_testing/TC_ECOINFO_2_2.py index 96fa2cd4d0..41d7fc0770 100644 --- a/src/python_testing/TC_ECOINFO_2_2.py +++ b/src/python_testing/TC_ECOINFO_2_2.py @@ -45,9 +45,9 @@ import chip.clusters as Clusters from chip.interaction_model import Status +from chip.testing.apps import AppServerSubprocess from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts -from TC_MCORE_FS_1_1 import AppServer _DEVICE_TYPE_AGGREGGATOR = 0x000E @@ -94,13 +94,15 @@ def _setup_ci_prerequisites(self): self.th_server_passcode = 20202021 # Start the server app. - self.th_server = AppServer( + self.th_server = AppServerSubprocess( th_server_app, storage_dir=self.storage.name, port=self.th_server_port, discriminator=self.th_server_discriminator, passcode=self.th_server_passcode) - self.th_server.start() + self.th_server.start( + expected_output="Server initialization complete", + timeout=30) def steps_TC_ECOINFO_2_2(self) -> list[TestStep]: return [ diff --git a/src/python_testing/TC_MCORE_FS_1_1.py b/src/python_testing/TC_MCORE_FS_1_1.py index 8e43d61106..c30c1ec1b2 100755 --- a/src/python_testing/TC_MCORE_FS_1_1.py +++ b/src/python_testing/TC_MCORE_FS_1_1.py @@ -47,31 +47,11 @@ import chip.clusters as Clusters from chip import ChipDeviceCtrl -from chip.testing.tasks import Subprocess +from chip.testing.apps import AppServerSubprocess from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts -class AppServer(Subprocess): - """Wrapper class for starting an application server in a subprocess.""" - - # Prefix for log messages from the application server. - PREFIX = b"[SERVER]" - - def __init__(self, app: str, storage_dir: str, discriminator: int, passcode: int, port: int = 5540): - storage_kvs_dir = tempfile.mkstemp(dir=storage_dir, prefix="kvs-app-")[1] - # Start the server application with dedicated KVS storage. - super().__init__(app, "--KVS", storage_kvs_dir, - '--secured-device-port', str(port), - "--discriminator", str(discriminator), - "--passcode", str(passcode), - output_cb=lambda line, is_stderr: self.PREFIX + line) - - def start(self): - # Start process and block until it prints the expected output. - super().start(expected_output="Server initialization complete") - - class TC_MCORE_FS_1_1(MatterBaseTest): @async_test_body @@ -96,13 +76,15 @@ async def setup_class(self): self.th_server_passcode = 20202021 # Start the TH_SERVER app. - self.th_server = AppServer( + self.th_server = AppServerSubprocess( th_server_app, storage_dir=self.storage.name, port=self.th_server_port, discriminator=self.th_server_discriminator, passcode=self.th_server_passcode) - self.th_server.start() + self.th_server.start( + expected_output="Server initialization complete", + timeout=30) logging.info("Commissioning from separate fabric") # Create a second controller on a new fabric to communicate to the server diff --git a/src/python_testing/TC_MCORE_FS_1_2.py b/src/python_testing/TC_MCORE_FS_1_2.py index 6cd1c85bac..f7e88870dd 100644 --- a/src/python_testing/TC_MCORE_FS_1_2.py +++ b/src/python_testing/TC_MCORE_FS_1_2.py @@ -50,10 +50,10 @@ import chip.clusters as Clusters from chip import ChipDeviceCtrl +from chip.testing.apps import AppServerSubprocess from ecdsa.curves import NIST256p from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts -from TC_MCORE_FS_1_1 import AppServer from TC_SC_3_6 import AttributeChangeAccumulator # Length of `w0s` and `w1s` elements @@ -97,9 +97,11 @@ async def setup_class(self): self.storage = tempfile.TemporaryDirectory(prefix=self.__class__.__name__) logging.info("Temporary storage directory: %s", self.storage.name) - # Get the named pipe path for the DUT_FSA app input from the user params. - dut_fsa_stdin_pipe = self.user_params.get("dut_fsa_stdin_pipe", None) - if dut_fsa_stdin_pipe is not None: + if self.is_pics_sdk_ci_only: + # Get the named pipe path for the DUT_FSA app input from the user params. + dut_fsa_stdin_pipe = self.user_params.get("dut_fsa_stdin_pipe") + if not dut_fsa_stdin_pipe: + asserts.fail("CI setup requires --string-arg dut_fsa_stdin_pipe:") self.dut_fsa_stdin = open(dut_fsa_stdin_pipe, "w") self.th_server_port = th_server_port @@ -111,13 +113,15 @@ async def setup_class(self): passcode=20202021) # Start the TH_SERVER app. - self.th_server = AppServer( + self.th_server = AppServerSubprocess( th_server_app, storage_dir=self.storage.name, port=self.th_server_port, discriminator=self.th_server_setup_params.discriminator, passcode=self.th_server_setup_params.passcode) - self.th_server.start() + self.th_server.start( + expected_output="Server initialization complete", + timeout=30) def teardown_class(self): if self._partslist_subscription is not None: @@ -135,7 +139,7 @@ def _ask_for_vendor_commissioning_ux_operation(self, setup_params: _SetupParamet f"- discriminator: {setup_params.discriminator}\n" f"- setupPinCode: {setup_params.passcode}\n" f"- setupQRCode: {setup_params.setup_qr_code}\n" - f"- setupManualcode: {setup_params.manual_code}\n" + f"- setupManualCode: {setup_params.manual_code}\n" f"If using FabricSync Admin test app, you may type:\n" f">>> pairing onnetwork 111 {setup_params.passcode}") diff --git a/src/python_testing/TC_MCORE_FS_1_3.py b/src/python_testing/TC_MCORE_FS_1_3.py index 49dc89386c..7dcca366a4 100644 --- a/src/python_testing/TC_MCORE_FS_1_3.py +++ b/src/python_testing/TC_MCORE_FS_1_3.py @@ -50,9 +50,9 @@ import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.interaction_model import Status +from chip.testing.apps import AppServerSubprocess from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts -from TC_MCORE_FS_1_1 import AppServer class TC_MCORE_FS_1_3(MatterBaseTest): @@ -84,13 +84,15 @@ def setup_class(self): self.th_server_passcode = 20202021 # Start the TH_SERVER_NO_UID app. - self.th_server = AppServer( + self.th_server = AppServerSubprocess( th_server_app, storage_dir=self.storage.name, port=self.th_server_port, discriminator=self.th_server_discriminator, passcode=self.th_server_passcode) - self.th_server.start() + self.th_server.start( + expected_output="Server initialization complete", + timeout=30) def teardown_class(self): if self.th_server is not None: diff --git a/src/python_testing/TC_MCORE_FS_1_4.py b/src/python_testing/TC_MCORE_FS_1_4.py index c365b4e9b9..90d1960649 100644 --- a/src/python_testing/TC_MCORE_FS_1_4.py +++ b/src/python_testing/TC_MCORE_FS_1_4.py @@ -49,10 +49,10 @@ import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.interaction_model import Status +from chip.testing.apps import AppServerSubprocess from chip.testing.tasks import Subprocess from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts -from TC_MCORE_FS_1_1 import AppServer class FabricSyncApp(Subprocess): @@ -160,9 +160,11 @@ def setup_class(self): vendor_id=0xFFF1) self.th_fsa_controller.start() - # Get the named pipe path for the DUT_FSA app input from the user params. - dut_fsa_stdin_pipe = self.user_params.get("dut_fsa_stdin_pipe", None) - if dut_fsa_stdin_pipe is not None: + if self.is_pics_sdk_ci_only: + # Get the named pipe path for the DUT_FSA app input from the user params. + dut_fsa_stdin_pipe = self.user_params.get("dut_fsa_stdin_pipe") + if not dut_fsa_stdin_pipe: + asserts.fail("CI setup requires --string-arg dut_fsa_stdin_pipe:") self.dut_fsa_stdin = open(dut_fsa_stdin_pipe, "w") self.th_server_port = 5544 @@ -170,13 +172,15 @@ def setup_class(self): self.th_server_passcode = 20202022 # Start the TH_SERVER_NO_UID app. - self.th_server = AppServer( + self.th_server = AppServerSubprocess( th_server_app, storage_dir=self.storage.name, port=self.th_server_port, discriminator=self.th_server_discriminator, passcode=self.th_server_passcode) - self.th_server.start() + self.th_server.start( + expected_output="Server initialization complete", + timeout=30) def teardown_class(self): if self.th_fsa_controller is not None: diff --git a/src/python_testing/TC_MCORE_FS_1_5.py b/src/python_testing/TC_MCORE_FS_1_5.py index d4f408a2ce..9b7e32b1d9 100755 --- a/src/python_testing/TC_MCORE_FS_1_5.py +++ b/src/python_testing/TC_MCORE_FS_1_5.py @@ -50,10 +50,10 @@ import chip.clusters as Clusters from chip import ChipDeviceCtrl +from chip.testing.apps import AppServerSubprocess from ecdsa.curves import NIST256p from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts -from TC_MCORE_FS_1_1 import AppServer from TC_SC_3_6 import AttributeChangeAccumulator # Length of `w0s` and `w1s` elements @@ -98,9 +98,11 @@ async def setup_class(self): self.storage = tempfile.TemporaryDirectory(prefix=self.__class__.__name__) logging.info("Temporary storage directory: %s", self.storage.name) - # Get the named pipe path for the DUT_FSA app input from the user params. - dut_fsa_stdin_pipe = self.user_params.get("dut_fsa_stdin_pipe", None) - if dut_fsa_stdin_pipe is not None: + if self.is_pics_sdk_ci_only: + # Get the named pipe path for the DUT_FSA app input from the user params. + dut_fsa_stdin_pipe = self.user_params.get("dut_fsa_stdin_pipe") + if not dut_fsa_stdin_pipe: + asserts.fail("CI setup requires --string-arg dut_fsa_stdin_pipe:") self.dut_fsa_stdin = open(dut_fsa_stdin_pipe, "w") self.th_server_port = th_server_port @@ -112,13 +114,15 @@ async def setup_class(self): passcode=20202021) # Start the TH_SERVER app. - self.th_server = AppServer( + self.th_server = AppServerSubprocess( th_server_app, storage_dir=self.storage.name, port=self.th_server_port, discriminator=self.th_server_setup_params.discriminator, passcode=self.th_server_setup_params.passcode) - self.th_server.start() + self.th_server.start( + expected_output="Server initialization complete", + timeout=30) def teardown_class(self): if self._partslist_subscription is not None: @@ -139,7 +143,7 @@ def _ask_for_vendor_commissioning_ux_operation(self, setup_params: _SetupParamet f"- discriminator: {setup_params.discriminator}\n" f"- setupPinCode: {setup_params.passcode}\n" f"- setupQRCode: {setup_params.setup_qr_code}\n" - f"- setupManualcode: {setup_params.manual_code}\n" + f"- setupManualCode: {setup_params.manual_code}\n" f"If using FabricSync Admin test app, you may type:\n" f">>> pairing onnetwork 111 {setup_params.passcode}") diff --git a/src/python_testing/execute_python_tests.py b/src/python_testing/execute_python_tests.py index f316d49e25..4e678211c5 100644 --- a/src/python_testing/execute_python_tests.py +++ b/src/python_testing/execute_python_tests.py @@ -66,7 +66,6 @@ def main(search_directory, env_file): "TC_TMP_2_1.py", # src/python_testing/test_testing/test_TC_TMP_2_1.py is the Unit test of this test "TC_OCC_3_1.py", # There are CI issues for the test cases that implements manually controlling sensor device for the occupancy state ON/OFF change "TC_OCC_3_2.py", # There are CI issues for the test cases that implements manually controlling sensor device for the occupancy state ON/OFF change - "TC_BRBINFO_4_1.py", # This test requires a TH_ICD_SERVER application, hence not ready run with CI "TestCommissioningTimeSync.py", # Code/Test not being used or not shared code for any other tests "TestConformanceSupport.py", # Unit test - does not run against an app "TestChoiceConformanceSupport.py", # Unit test - does not run against an app diff --git a/src/python_testing/matter_testing_infrastructure/BUILD.gn b/src/python_testing/matter_testing_infrastructure/BUILD.gn index c8d54fb008..41bbcef22b 100644 --- a/src/python_testing/matter_testing_infrastructure/BUILD.gn +++ b/src/python_testing/matter_testing_infrastructure/BUILD.gn @@ -30,6 +30,7 @@ pw_python_package("chip-testing") { sources = [ "chip/testing/__init__.py", + "chip/testing/apps.py", "chip/testing/metadata.py", "chip/testing/tasks.py", ] diff --git a/src/python_testing/matter_testing_infrastructure/chip/testing/apps.py b/src/python_testing/matter_testing_infrastructure/chip/testing/apps.py new file mode 100644 index 0000000000..af56efc3d5 --- /dev/null +++ b/src/python_testing/matter_testing_infrastructure/chip/testing/apps.py @@ -0,0 +1,69 @@ +# Copyright (c) 2024 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os +import signal +import tempfile + +from .tasks import Subprocess + + +class AppServerSubprocess(Subprocess): + """Wrapper class for starting an application server in a subprocess.""" + + # Prefix for log messages from the application server. + PREFIX = b"[SERVER]" + + def __init__(self, app: str, storage_dir: str, discriminator: int, + passcode: int, port: int = 5540): + self.kvs_fd, kvs_path = tempfile.mkstemp(dir=storage_dir, prefix="kvs-app-") + # Start the server application with dedicated KVS storage. + super().__init__(app, "--KVS", kvs_path, + '--secured-device-port', str(port), + "--discriminator", str(discriminator), + "--passcode", str(passcode), + output_cb=lambda line, is_stderr: self.PREFIX + line) + + def __del__(self): + # Do not leak KVS file descriptor. + os.close(self.kvs_fd) + + +class IcdAppServerSubprocess(AppServerSubprocess): + """Wrapper class for starting an ICD application server in a subprocess.""" + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.paused = False + + def pause(self, check_state: bool = True): + if check_state and self.paused: + raise ValueError("ICD TH Server unexpectedly is already paused") + if not self.paused: + # Stop (halt) the ICD server process by sending a SIGTOP signal. + self.p.send_signal(signal.SIGSTOP) + self.paused = True + + def resume(self, check_state: bool = True): + if check_state and not self.paused: + raise ValueError("ICD TH Server unexpectedly is already running") + if self.paused: + # Resume (continue) the ICD server process by sending a SIGCONT signal. + self.p.send_signal(signal.SIGCONT) + self.paused = False + + def terminate(self): + # Make sure the ICD server process is not paused before terminating it. + self.resume(check_state=False) + super().terminate() diff --git a/src/python_testing/matter_testing_infrastructure/chip/testing/test_tasks.py b/src/python_testing/matter_testing_infrastructure/chip/testing/test_tasks.py index 5e91a89cf6..051d571d79 100644 --- a/src/python_testing/matter_testing_infrastructure/chip/testing/test_tasks.py +++ b/src/python_testing/matter_testing_infrastructure/chip/testing/test_tasks.py @@ -14,6 +14,10 @@ import unittest +# TODO: Allow to use relative imports or imports from chip.testing package. Then, +# rename "tasks" module to "subprocess", because it would be more descriptive. +# Unfortunately, current way of importing clashes with the subprocess module +# from the Python standard library. from tasks import Subprocess From bd8803a9522ce766a07ac9d843bdaea2f53d306a Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Tue, 8 Oct 2024 15:36:25 +0200 Subject: [PATCH 037/127] [darwin-framework-tool] Automatically check for leaks on shutdown if enable_leak_checking is true (#35936) --- examples/darwin-framework-tool/BUILD.gn | 8 +++ .../darwin-framework-tool/debug/LeakChecker.h | 28 ++++++++ .../debug/LeakChecker.mm | 70 +++++++++++++++++++ examples/darwin-framework-tool/main.mm | 5 +- .../Matter.xcodeproj/project.pbxproj | 16 +++++ 5 files changed, 126 insertions(+), 1 deletion(-) create mode 100644 examples/darwin-framework-tool/debug/LeakChecker.h create mode 100644 examples/darwin-framework-tool/debug/LeakChecker.mm diff --git a/examples/darwin-framework-tool/BUILD.gn b/examples/darwin-framework-tool/BUILD.gn index 665dccf484..2c202475a7 100644 --- a/examples/darwin-framework-tool/BUILD.gn +++ b/examples/darwin-framework-tool/BUILD.gn @@ -43,6 +43,9 @@ declare_args() { # Disable generating compiler database by default generate_compilation_database = false + + # Enable automatic leak checks before the application exits + enable_leak_checking = false } sdk = "macosx" @@ -219,6 +222,7 @@ executable("darwin-framework-tool") { "commands/provider/OTASoftwareUpdateInteractive.mm", "commands/storage/Commands.h", "commands/storage/StorageManagementCommand.mm", + "debug/LeakChecker.mm", "logging/logging.mm", "main.mm", ] @@ -280,6 +284,10 @@ executable("darwin-framework-tool") { defines += [ "MTR_ENABLE_PROVISIONAL=1" ] } + if (enable_leak_checking) { + defines += [ "DFT_ENABLE_LEAK_CHECKING=1" ] + } + public_configs = [ ":config" ] output_dir = root_out_dir diff --git a/examples/darwin-framework-tool/debug/LeakChecker.h b/examples/darwin-framework-tool/debug/LeakChecker.h new file mode 100644 index 0000000000..c83ed64910 --- /dev/null +++ b/examples/darwin-framework-tool/debug/LeakChecker.h @@ -0,0 +1,28 @@ +/* + * 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 + +/* + * This function performs a memory leak check if the build flag `enable_leak_checking` is set to true + * If leaks are detected, it overrides the provided exit code with `EXIT_FAILURE`. + * + * @param exitCode The initial exit code to return if no leaks are detected or if leak checking is disabled. + * @return `EXIT_FAILURE` if leaks are detected and leak checking is enabled; otherwise, the original `exitCode`. + */ +int ConditionalLeaksCheck(int exitCode); diff --git a/examples/darwin-framework-tool/debug/LeakChecker.mm b/examples/darwin-framework-tool/debug/LeakChecker.mm new file mode 100644 index 0000000000..72a441420a --- /dev/null +++ b/examples/darwin-framework-tool/debug/LeakChecker.mm @@ -0,0 +1,70 @@ +/* + * 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 "LeakChecker.h" + +#import +#include // For getpid() + +@interface LeakChecker : NSObject +- (BOOL)hasMemoryLeaks; +@end + +@implementation LeakChecker + +- (BOOL)hasMemoryLeaks +{ + pid_t pid = getpid(); + auto * pidString = [NSString stringWithFormat:@"%d", pid]; + + auto * task = [[NSTask alloc] init]; + task.launchPath = @"/usr/bin/leaks"; + task.arguments = @[ pidString ]; + + auto * pipe = [NSPipe pipe]; + task.standardOutput = pipe; + task.standardError = pipe; + + NSFileHandle * fileHandle = [pipe fileHandleForReading]; + [task launch]; + [task waitUntilExit]; + + int exitCode = [task terminationStatus]; + if (exitCode) { + NSData * data = [fileHandle readDataToEndOfFile]; + NSString * output = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + NSLog(@"%@", output); + return YES; + } + + return NO; +} + +@end + +int ConditionalLeaksCheck(int exitCode) +{ +#ifdef DFT_ENABLE_LEAK_CHECKING + auto * leakChecker = [[LeakChecker alloc] init]; + if ([leakChecker hasMemoryLeaks]) { + return EXIT_FAILURE; + } +#endif // DFT_ENABLE_LEAK_CHECKING + + return exitCode; +} diff --git a/examples/darwin-framework-tool/main.mm b/examples/darwin-framework-tool/main.mm index 5f31cb6abf..ad31cfe32e 100644 --- a/examples/darwin-framework-tool/main.mm +++ b/examples/darwin-framework-tool/main.mm @@ -18,6 +18,7 @@ #import +#import "debug/LeakChecker.h" #import "logging/logging.h" #include "commands/bdx/Commands.h" @@ -35,6 +36,7 @@ int main(int argc, const char * argv[]) { + int exitCode = EXIT_SUCCESS; @autoreleasepool { dft::logging::Setup(); @@ -49,6 +51,7 @@ int main(int argc, const char * argv[]) registerCommandsStorage(commands); registerCommandsConfiguration(commands); registerClusters(commands); - return commands.Run(argc, (char **) argv); + exitCode = commands.Run(argc, (char **) argv); } + return ConditionalLeaksCheck(exitCode); } diff --git a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj index afc1df1933..8a39c63440 100644 --- a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj +++ b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj @@ -373,6 +373,8 @@ B4E262172AA0CF2000DBA5BC /* RemoteDataModelLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = B4E262132AA0C7A300DBA5BC /* RemoteDataModelLogger.h */; }; B4E2621B2AA0D02000DBA5BC /* SleepCommand.mm in Sources */ = {isa = PBXBuildFile; fileRef = B4E262192AA0D01D00DBA5BC /* SleepCommand.mm */; }; B4E2621E2AA0D02D00DBA5BC /* WaitForCommissioneeCommand.mm in Sources */ = {isa = PBXBuildFile; fileRef = B4E2621C2AA0D02A00DBA5BC /* WaitForCommissioneeCommand.mm */; }; + B4F773CA2CB54B61008C6B23 /* LeakChecker.h in Headers */ = {isa = PBXBuildFile; fileRef = B4F773C72CB54B61008C6B23 /* LeakChecker.h */; }; + B4F773CB2CB54B61008C6B23 /* LeakChecker.mm in Sources */ = {isa = PBXBuildFile; fileRef = B4F773C82CB54B61008C6B23 /* LeakChecker.mm */; }; B4FCD56A2B5EDBD300832859 /* MTRDiagnosticLogsType.h in Headers */ = {isa = PBXBuildFile; fileRef = B4FCD5692B5EDBD300832859 /* MTRDiagnosticLogsType.h */; settings = {ATTRIBUTES = (Public, ); }; }; B4FCD5702B603A6300832859 /* Commands.h in Headers */ = {isa = PBXBuildFile; fileRef = B4FCD56D2B603A6300832859 /* Commands.h */; }; B4FCD5712B603A6300832859 /* DownloadLogCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = B4FCD56E2B603A6300832859 /* DownloadLogCommand.h */; }; @@ -818,6 +820,8 @@ B4E262132AA0C7A300DBA5BC /* RemoteDataModelLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteDataModelLogger.h; sourceTree = ""; }; B4E262192AA0D01D00DBA5BC /* SleepCommand.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SleepCommand.mm; sourceTree = ""; }; B4E2621C2AA0D02A00DBA5BC /* WaitForCommissioneeCommand.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WaitForCommissioneeCommand.mm; sourceTree = ""; }; + B4F773C72CB54B61008C6B23 /* LeakChecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LeakChecker.h; sourceTree = ""; }; + B4F773C82CB54B61008C6B23 /* LeakChecker.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LeakChecker.mm; sourceTree = ""; }; B4FCD5692B5EDBD300832859 /* MTRDiagnosticLogsType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRDiagnosticLogsType.h; sourceTree = ""; }; B4FCD56D2B603A6300832859 /* Commands.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Commands.h; sourceTree = ""; }; B4FCD56E2B603A6300832859 /* DownloadLogCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DownloadLogCommand.h; sourceTree = ""; }; @@ -874,6 +878,7 @@ 037C3CA82991A44B00B7EEE2 /* darwin-framework-tool */ = { isa = PBXGroup; children = ( + B4F773C92CB54B61008C6B23 /* debug */, 039145E02993102B00257B3E /* main.mm */, 03F430A52994100000166449 /* controller */, 039547092992DB02006D42A8 /* editline */, @@ -1543,6 +1548,15 @@ path = delay; sourceTree = ""; }; + B4F773C92CB54B61008C6B23 /* debug */ = { + isa = PBXGroup; + children = ( + B4F773C72CB54B61008C6B23 /* LeakChecker.h */, + B4F773C82CB54B61008C6B23 /* LeakChecker.mm */, + ); + path = debug; + sourceTree = ""; + }; B4FCD56C2B603A6300832859 /* bdx */ = { isa = PBXGroup; children = ( @@ -1594,6 +1608,7 @@ 037C3DAF2991BD4F00B7EEE2 /* DeviceControllerDelegateBridge.h in Headers */, B4FCD5712B603A6300832859 /* DownloadLogCommand.h in Headers */, 037C3DC32991BD5100B7EEE2 /* Commands.h in Headers */, + B4F773CA2CB54B61008C6B23 /* LeakChecker.h in Headers */, 037C3DB82991BD5000B7EEE2 /* ClusterCommandBridge.h in Headers */, 037C3DC82991BD5100B7EEE2 /* CHIPToolKeypair.h in Headers */, 037C3DB52991BD5000B7EEE2 /* WriteAttributeCommandBridge.h in Headers */, @@ -1900,6 +1915,7 @@ 03F430A82994112B00166449 /* editline.c in Sources */, 03F430AA2994113500166449 /* sysunix.c in Sources */, B45373BF2A9FEA9100807602 /* adopt.c in Sources */, + B4F773CB2CB54B61008C6B23 /* LeakChecker.mm in Sources */, B45373D12A9FEB0C00807602 /* alloc.c in Sources */, B45373DD2A9FEB5300807602 /* base64-decode.c in Sources */, B45373D22A9FEB0C00807602 /* buflist.c in Sources */, From 18fafa5db6aee17d47bea5d0d8a5bb9ec90c6beb Mon Sep 17 00:00:00 2001 From: C Freeman Date: Tue, 8 Oct 2024 11:19:09 -0400 Subject: [PATCH 038/127] DM XMLs: Remove a couple of clusters/DTs not in 0.9 (#35937) --- .../clusters/DemandResponseLoadControl.xml | 453 ------------------ data_model/1.4/clusters/EnergyCalendar.xml | 287 ----------- data_model/1.4/clusters/Humidistat.xml | 283 ----------- data_model/1.4/clusters/cluster_ids.json | 3 - data_model/1.4/device_types/EnergyTariff.xml | 64 --- .../1.4/device_types/EnergyTariffCalendar.xml | 64 --- .../device_types/HumidifierDehumidifier.xml | 63 --- 7 files changed, 1217 deletions(-) delete mode 100644 data_model/1.4/clusters/DemandResponseLoadControl.xml delete mode 100644 data_model/1.4/clusters/EnergyCalendar.xml delete mode 100644 data_model/1.4/clusters/Humidistat.xml delete mode 100644 data_model/1.4/device_types/EnergyTariff.xml delete mode 100644 data_model/1.4/device_types/EnergyTariffCalendar.xml delete mode 100644 data_model/1.4/device_types/HumidifierDehumidifier.xml diff --git a/data_model/1.4/clusters/DemandResponseLoadControl.xml b/data_model/1.4/clusters/DemandResponseLoadControl.xml deleted file mode 100644 index 1acd1ea26c..0000000000 --- a/data_model/1.4/clusters/DemandResponseLoadControl.xml +++ /dev/null @@ -1,453 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/data_model/1.4/clusters/EnergyCalendar.xml b/data_model/1.4/clusters/EnergyCalendar.xml deleted file mode 100644 index 2ba9320361..0000000000 --- a/data_model/1.4/clusters/EnergyCalendar.xml +++ /dev/null @@ -1,287 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/data_model/1.4/clusters/Humidistat.xml b/data_model/1.4/clusters/Humidistat.xml deleted file mode 100644 index 1af5469848..0000000000 --- a/data_model/1.4/clusters/Humidistat.xml +++ /dev/null @@ -1,283 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/data_model/1.4/clusters/cluster_ids.json b/data_model/1.4/clusters/cluster_ids.json index 9de2f243b3..687bbc3229 100644 --- a/data_model/1.4/clusters/cluster_ids.json +++ b/data_model/1.4/clusters/cluster_ids.json @@ -64,11 +64,9 @@ "144": "Electrical Power Measurement", "145": "Electrical Energy Measurement", "148": "Water Heater Management", - "150": "Demand Response Load Control", "151": "Messages", "152": "Device Energy Management", "153": "Energy EVSE", - "154": "Energy Calendar", "155": "Energy Preference", "156": "Power Topology", "157": "Energy EVSE Mode", @@ -81,7 +79,6 @@ "513": "Thermostat", "514": "Fan Control", "516": "Thermostat User Interface Configuration", - "517": "Humidistat", "768": "Color Control", "769": "Ballast Configuration", "1024": "Illuminance Measurement", diff --git a/data_model/1.4/device_types/EnergyTariff.xml b/data_model/1.4/device_types/EnergyTariff.xml deleted file mode 100644 index 887bfa420d..0000000000 --- a/data_model/1.4/device_types/EnergyTariff.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/data_model/1.4/device_types/EnergyTariffCalendar.xml b/data_model/1.4/device_types/EnergyTariffCalendar.xml deleted file mode 100644 index 70d74b7239..0000000000 --- a/data_model/1.4/device_types/EnergyTariffCalendar.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/data_model/1.4/device_types/HumidifierDehumidifier.xml b/data_model/1.4/device_types/HumidifierDehumidifier.xml deleted file mode 100644 index 973919635f..0000000000 --- a/data_model/1.4/device_types/HumidifierDehumidifier.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - \ No newline at end of file From ccd45b0a8c3a4bef7a5ae468ddf5edb758f6d292 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 8 Oct 2024 11:32:25 -0400 Subject: [PATCH 039/127] Add restyled workflow (#35967) * Add restyled workflow * Update pullapprove to look at the restyle workflow * Update comment * Use same checkout command as the rest of the scripts --------- Co-authored-by: Andrei Litvin --- .github/workflows/restyled.yml | 35 +++ .pullapprove.yml | 478 ++++++++++++++++----------------- 2 files changed, 274 insertions(+), 239 deletions(-) create mode 100644 .github/workflows/restyled.yml diff --git a/.github/workflows/restyled.yml b/.github/workflows/restyled.yml new file mode 100644 index 0000000000..9174483ecb --- /dev/null +++ b/.github/workflows/restyled.yml @@ -0,0 +1,35 @@ +name: Restyled + +on: + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + restyled: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - uses: restyled-io/actions/setup@v4 + - id: restyler + uses: restyled-io/actions/run@v4 + with: + fail-on-differences: true + + - if: | + !cancelled() && + steps.restyler.outputs.success == 'true' && + github.event.pull_request.head.repo.full_name == github.repository + uses: peter-evans/create-pull-request@v6 + with: + base: ${{ steps.restyler.outputs.restyled-base }} + branch: ${{ steps.restyler.outputs.restyled-head }} + title: ${{ steps.restyler.outputs.restyled-title }} + body: ${{ steps.restyler.outputs.restyled-body }} + labels: "restyled" + reviewers: ${{ github.event.pull_request.user.login }} + delete-branch: true diff --git a/.pullapprove.yml b/.pullapprove.yml index 83d7b70b34..c8564b7cbf 100644 --- a/.pullapprove.yml +++ b/.pullapprove.yml @@ -8,257 +8,257 @@ github_api_version: "shadow-cat-preview" ############################################################ overrides: - - if: "'hotfix' in labels" - status: success - explanation: "Hotfix label added, bypassing reviews" + - if: "'hotfix' in labels" + status: success + explanation: "Hotfix label added, bypassing reviews" - ############################################################ - # Draft PRs - ############################################################ - - if: "draft" - status: pending - explanation: "PR is draft, pending review" + ############################################################ + # Draft PRs + ############################################################ + - if: "draft" + status: pending + explanation: "PR is draft, pending review" - ############################################################ - # License Checks - ############################################################ - - if: "'*license/cla*' not in statuses.successful" - status: pending - explanation: "CLA must be agreed to by all contributors" + ############################################################ + # License Checks + ############################################################ + - if: "'*license/cla*' not in statuses.successful" + status: pending + explanation: "CLA must be agreed to by all contributors" - ############################################################ - # Conditions to Skip Review - ############################################################ - - if: "base.ref != 'master'" - status: success - explanation: "Review not required unless merging to master" + ############################################################ + # Conditions to Skip Review + ############################################################ + - if: "base.ref != 'master'" + status: success + explanation: "Review not required unless merging to master" - ############################################################ - # Required status checks - ############################################################ - - if: "'*restyle*' not in statuses.successful" - status: failure - explanation: "Style must be inline before reviewing can be complete" + ############################################################ + # Required status checks + ############################################################ + - if: "'*restyled*' not in statuses.successful" + status: failure + explanation: "Restyled workflow must be successful" - ############################################################ - # Require Issues - ############################################################ - # disabling until we have PRs up to date - # - if: "'*issue*' not in statuses.successful" - # status: failure - # explanation: "An issue is required for all PRs" + ############################################################ + # Require Issues + ############################################################ + # disabling until we have PRs up to date + # - if: "'*issue*' not in statuses.successful" + # status: failure + # explanation: "An issue is required for all PRs" - ############################################################ - # Fast tracking - ############################################################ - - if: "'fast track' in labels" - status: success - explanation: "PR has been fast tracked, bypassing reviews" + ############################################################ + # Fast tracking + ############################################################ + - if: "'fast track' in labels" + status: success + explanation: "PR has been fast tracked, bypassing reviews" ############################################################ # Notifications ############################################################ notifications: - ############################################################ - # New contributors - ############################################################ - - when: pull_request.opened - if: "author_association == 'FIRST_TIME_CONTRIBUTOR'" - comment: | - Hey @{{ author }}, thanks for the PR! The review will start once - the tests and CI checks have passed. If they don't, please review - the logs and try to fix the issues (ask for help if you can't - figure it out). A reviewer will be assigned once the tests are - passing and they'll walk you through getting the PR finished - and merged. + ############################################################ + # New contributors + ############################################################ + - when: pull_request.opened + if: "author_association == 'FIRST_TIME_CONTRIBUTOR'" + comment: | + Hey @{{ author }}, thanks for the PR! The review will start once + the tests and CI checks have passed. If they don't, please review + the logs and try to fix the issues (ask for help if you can't + figure it out). A reviewer will be assigned once the tests are + passing and they'll walk you through getting the PR finished + and merged. groups: - ############################################################ - # Shared Reviewer Groups - ############################################################ - shared-reviewers-amazon: - type: optional - conditions: - - files.include('*') - reviewers: - teams: [reviewers-amazon] - reviews: - request: 0 # Do not auto-add - shared-reviewers-apple: - type: optional - conditions: - - files.include('*') - reviewers: - teams: [reviewers-apple] - reviews: - request: 0 # Do not auto-add - shared-reviewers-bosch: - type: optional - conditions: - - files.include('*') - reviewers: - teams: [reviewers-bosch] - reviews: - request: 0 # Do not auto-add - shared-reviewers-comcast: - type: optional - conditions: - - files.include('*') - reviewers: - teams: [reviewers-comcast] - reviews: - request: 0 # Do not auto-add - shared-reviewers-dyson: - type: optional - conditions: - - files.include('*') - reviewers: - teams: [reviewers-dyson] - reviews: - request: 0 # Do not auto-add - shared-reviewers-espressif: - type: optional - conditions: - - files.include('*') - reviewers: - teams: [reviewers-espressif] - reviews: - request: 0 # Do not auto-add - shared-reviewers-google: - type: optional - conditions: - - files.include('*') - reviewers: - teams: [reviewers-google] - reviews: - request: 0 # Do not auto-add - shared-reviewers-grundfos: - type: optional - conditions: - - files.include('*') - reviewers: - teams: [reviewers-grundfos] - reviews: - request: 0 # Do not auto-add - shared-reviewers-irobot: - type: optional - conditions: - - files.include('*') - reviewers: - teams: [reviewers-irobot] - reviews: - request: 0 # Do not auto-add - shared-reviewers-lg: - type: optional - conditions: - - files.include('*') - reviewers: - teams: [reviewers-lg] - reviews: - request: 0 # Do not auto-add - shared-reviewers-logitech: - type: optional - conditions: - - files.include('*') - reviewers: - teams: [reviewers-logitech] - reviews: - request: 0 # Requested to be only on demand - shared-reviewers-nordic: - type: optional - conditions: - - files.include('*') - reviewers: - teams: [reviewers-nordic] - reviews: - request: 0 # Do not auto-add - shared-reviewers-nxp: - type: optional - conditions: - - files.include('*') - reviewers: - teams: [reviewers-nxp] - reviews: - request: 0 # Do not auto-add - shared-reviewers-samsung: - type: optional - conditions: - - files.include('*') - reviewers: - teams: [reviewers-samsung] - reviews: - request: 0 # Do not auto-add - shared-reviewers-eve: - type: optional - conditions: - - files.include('*') - reviewers: - teams: [reviewers-eve] - reviews: - request: 0 # Do not auto-add - # shared-reviewers-signify disabled for now, because the reviewers-signify - # team is empty and pullapprove seems to mis-handle that badly and treats - # _all_ reviewers as being in this group. - # - # See https://github.com/dropseed/pullapprove/issues/71 - # - # shared-reviewers-signify: - # type: optional - # conditions: - # - files.include('*') - # reviewers: - # teams: [reviewers-signify] - # reviews: - # request: 0 # Do not auto-add - shared-reviewers-silabs: - type: optional - conditions: - - files.include('*') - reviewers: - teams: [reviewers-silabs] - reviews: - request: 0 # Do not auto-add - shared-reviewers-somfy: - type: optional - conditions: - - files.include('*') - reviewers: - teams: [reviewers-somfy] - reviews: - request: 0 # Do not auto-add - shared-reviewers-tcl: - type: optional - conditions: - - files.include('*') - reviewers: - teams: [reviewers-tcl] - reviews: - request: 0 # Do not auto-add - shared-reviewers-qorvo: - type: optional - conditions: - - files.include('*') - reviewers: - teams: [reviewers-qorvo] - reviews: - request: 0 # Do not auto-add + ############################################################ + # Shared Reviewer Groups + ############################################################ + shared-reviewers-amazon: + type: optional + conditions: + - files.include('*') + reviewers: + teams: [reviewers-amazon] + reviews: + request: 0 # Do not auto-add + shared-reviewers-apple: + type: optional + conditions: + - files.include('*') + reviewers: + teams: [reviewers-apple] + reviews: + request: 0 # Do not auto-add + shared-reviewers-bosch: + type: optional + conditions: + - files.include('*') + reviewers: + teams: [reviewers-bosch] + reviews: + request: 0 # Do not auto-add + shared-reviewers-comcast: + type: optional + conditions: + - files.include('*') + reviewers: + teams: [reviewers-comcast] + reviews: + request: 0 # Do not auto-add + shared-reviewers-dyson: + type: optional + conditions: + - files.include('*') + reviewers: + teams: [reviewers-dyson] + reviews: + request: 0 # Do not auto-add + shared-reviewers-espressif: + type: optional + conditions: + - files.include('*') + reviewers: + teams: [reviewers-espressif] + reviews: + request: 0 # Do not auto-add + shared-reviewers-google: + type: optional + conditions: + - files.include('*') + reviewers: + teams: [reviewers-google] + reviews: + request: 0 # Do not auto-add + shared-reviewers-grundfos: + type: optional + conditions: + - files.include('*') + reviewers: + teams: [reviewers-grundfos] + reviews: + request: 0 # Do not auto-add + shared-reviewers-irobot: + type: optional + conditions: + - files.include('*') + reviewers: + teams: [reviewers-irobot] + reviews: + request: 0 # Do not auto-add + shared-reviewers-lg: + type: optional + conditions: + - files.include('*') + reviewers: + teams: [reviewers-lg] + reviews: + request: 0 # Do not auto-add + shared-reviewers-logitech: + type: optional + conditions: + - files.include('*') + reviewers: + teams: [reviewers-logitech] + reviews: + request: 0 # Requested to be only on demand + shared-reviewers-nordic: + type: optional + conditions: + - files.include('*') + reviewers: + teams: [reviewers-nordic] + reviews: + request: 0 # Do not auto-add + shared-reviewers-nxp: + type: optional + conditions: + - files.include('*') + reviewers: + teams: [reviewers-nxp] + reviews: + request: 0 # Do not auto-add + shared-reviewers-samsung: + type: optional + conditions: + - files.include('*') + reviewers: + teams: [reviewers-samsung] + reviews: + request: 0 # Do not auto-add + shared-reviewers-eve: + type: optional + conditions: + - files.include('*') + reviewers: + teams: [reviewers-eve] + reviews: + request: 0 # Do not auto-add + # shared-reviewers-signify disabled for now, because the reviewers-signify + # team is empty and pullapprove seems to mis-handle that badly and treats + # _all_ reviewers as being in this group. + # + # See https://github.com/dropseed/pullapprove/issues/71 + # + # shared-reviewers-signify: + # type: optional + # conditions: + # - files.include('*') + # reviewers: + # teams: [reviewers-signify] + # reviews: + # request: 0 # Do not auto-add + shared-reviewers-silabs: + type: optional + conditions: + - files.include('*') + reviewers: + teams: [reviewers-silabs] + reviews: + request: 0 # Do not auto-add + shared-reviewers-somfy: + type: optional + conditions: + - files.include('*') + reviewers: + teams: [reviewers-somfy] + reviews: + request: 0 # Do not auto-add + shared-reviewers-tcl: + type: optional + conditions: + - files.include('*') + reviewers: + teams: [reviewers-tcl] + reviews: + request: 0 # Do not auto-add + shared-reviewers-qorvo: + type: optional + conditions: + - files.include('*') + reviewers: + teams: [reviewers-qorvo] + reviews: + request: 0 # Do not auto-add - ############################################################ - # Base Required Reviewers - ############################################################ - required-reviewers: - description: > - [Required - Reviewers](https://github.com/project-chip/connectedhomeip/blob/master/CONTRIBUTING.md#review-requirements) - This is the main group of required reviews for general pull - requests. - type: required - requirements: - - len(groups.approved.include('shared-reviewers-*')) >= 2 - reviews: - required: 0 - labels: - approved: "review - approved" - pending: "review - pending" - rejected: "review - changed requested" + ############################################################ + # Base Required Reviewers + ############################################################ + required-reviewers: + description: > + [Required + Reviewers](https://github.com/project-chip/connectedhomeip/blob/master/CONTRIBUTING.md#review-requirements) + This is the main group of required reviews for general pull + requests. + type: required + requirements: + - len(groups.approved.include('shared-reviewers-*')) >= 2 + reviews: + required: 0 + labels: + approved: "review - approved" + pending: "review - pending" + rejected: "review - changed requested" From f7600dffd911f3e1ab080dda00ff3aa0a8a545fb Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 8 Oct 2024 11:43:28 -0400 Subject: [PATCH 040/127] Fix mis-quote in pullapprove (#35968) Co-authored-by: Andrei Litvin --- .pullapprove.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pullapprove.yml b/.pullapprove.yml index c8564b7cbf..30ebc46343 100644 --- a/.pullapprove.yml +++ b/.pullapprove.yml @@ -36,7 +36,7 @@ overrides: ############################################################ # Required status checks ############################################################ - - if: "'*restyled*' not in statuses.successful" + - if: "*restyled*' not in statuses.successful" status: failure explanation: "Restyled workflow must be successful" From ca70de28d578deeca0ad75783f54aeea070619c5 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 8 Oct 2024 11:47:36 -0400 Subject: [PATCH 041/127] Use check runs for checking restyle workflow (#35969) * Fix mis-quote in pullapprove * Another fix * Move the check in check_runs --------- Co-authored-by: Andrei Litvin --- .pullapprove.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pullapprove.yml b/.pullapprove.yml index 30ebc46343..8a81d7da1e 100644 --- a/.pullapprove.yml +++ b/.pullapprove.yml @@ -36,7 +36,7 @@ overrides: ############################################################ # Required status checks ############################################################ - - if: "*restyled*' not in statuses.successful" + - if: "'restyled' not in check_runs.successful" status: failure explanation: "Restyled workflow must be successful" From 7c68210af5303f16e74c3736ee8ee01cfbea734c Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 8 Oct 2024 12:04:26 -0400 Subject: [PATCH 042/127] Remove restyle check in pullapprove: moved this requirement to the branch security (#35970) Co-authored-by: Andrei Litvin --- .pullapprove.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.pullapprove.yml b/.pullapprove.yml index 8a81d7da1e..81267526ee 100644 --- a/.pullapprove.yml +++ b/.pullapprove.yml @@ -33,13 +33,6 @@ overrides: status: success explanation: "Review not required unless merging to master" - ############################################################ - # Required status checks - ############################################################ - - if: "'restyled' not in check_runs.successful" - status: failure - explanation: "Restyled workflow must be successful" - ############################################################ # Require Issues ############################################################ From 0a2e58d0fe2b4d64b7501d42e9c062bc16bfb303 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C5=82osz=20Tomkiel?= Date: Tue, 8 Oct 2024 18:19:59 +0200 Subject: [PATCH 043/127] [devcontainer] Add icecc cluster compilation (#35502) * Add script to start/stop iceccd * Add icecc and ccache * Add ninja-jobs flag * Restyled by whitespace * Restyled by isort * Allow ninja-jobs to be 0 * Fix icecc.sh * Add ninja_jobs to non-GN targets * Add better env var description Co-authored-by: Arkadiusz Bokowy * Restyled by autopep8 * Fix formatting * Restyled by isort --------- Co-authored-by: Restyled.io Co-authored-by: Arkadiusz Bokowy --- .devcontainer/Dockerfile | 11 ++++++++++ scripts/build/build/__init__.py | 8 ++++--- scripts/build/build/target.py | 3 ++- scripts/build/build_examples.py | 13 ++++++++--- scripts/build/builders/ameba.py | 8 +++++-- scripts/build/builders/android.py | 7 +++++- scripts/build/builders/gn.py | 2 ++ scripts/build/builders/host.py | 9 +++++++- scripts/build/builders/nrf.py | 8 +++++-- scripts/build/builders/telink.py | 3 +++ scripts/icecc.sh | 36 +++++++++++++++++++++++++++++++ 11 files changed, 95 insertions(+), 13 deletions(-) create mode 100755 scripts/icecc.sh diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 386253bb60..3d2c6295f8 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -37,6 +37,7 @@ RUN apt-get update \ valgrind \ docker.io \ iputils-ping \ + icecc \ && : RUN groupadd -g $USER_GID $USERNAME \ @@ -80,3 +81,13 @@ ENV TIZEN_ROOTFS /tizen_rootfs # Fast Model GDB plugins path for debugging support ENV FAST_MODEL_PLUGINS_PATH /opt/FastModelsPortfolio_11.16/plugins/Linux64_GCC-9.3 + +# Set up ccache as a pigweed command launcher when using the scripts/build/build_examples.py +# script. Also, set up icecc as the command prefix for ccache. Such setup allows to benefit +# from compilation caching and distributed compilation at the same time. +# +# NOTE: In order to use distributed compilation with icecc, one should run +# "scripts/icecc.sh start" before starting the build. +ENV CHIP_PW_COMMAND_LAUNCHER ccache +ENV CCACHE_PREFIX icecc +ENV PATH /usr/lib/ccache:$PATH diff --git a/scripts/build/build/__init__.py b/scripts/build/build/__init__.py index c363f6c326..5f3cbbab36 100644 --- a/scripts/build/build/__init__.py +++ b/scripts/build/build/__init__.py @@ -4,9 +4,10 @@ from enum import Enum, auto from typing import Sequence -from .targets import BUILD_TARGETS from builders.builder import BuilderOptions +from .targets import BUILD_TARGETS + class BuildSteps(Enum): GENERATED = auto() @@ -18,11 +19,12 @@ class Context: to generate make/ninja instructions and to compile. """ - def __init__(self, runner, repository_path: str, output_prefix: str): + def __init__(self, runner, repository_path: str, output_prefix: str, ninja_jobs: int): self.builders = [] self.runner = runner self.repository_path = repository_path self.output_prefix = output_prefix + self.ninja_jobs = ninja_jobs self.completed_steps = set() def SetupBuilders(self, targets: Sequence[str], options: BuilderOptions): @@ -36,7 +38,7 @@ def SetupBuilders(self, targets: Sequence[str], options: BuilderOptions): found = False for choice in BUILD_TARGETS: builder = choice.Create(target, self.runner, self.repository_path, - self.output_prefix, options) + self.output_prefix, self.ninja_jobs, options) if builder: self.builders.append(builder) found = True diff --git a/scripts/build/build/target.py b/scripts/build/build/target.py index 7f17161701..78e4599fb5 100644 --- a/scripts/build/build/target.py +++ b/scripts/build/build/target.py @@ -389,7 +389,7 @@ def StringIntoTargetParts(self, value: str): return _StringIntoParts(value, suffix, self.fixed_targets, self.modifiers) def Create(self, name: str, runner, repository_path: str, output_prefix: str, - builder_options: BuilderOptions): + ninja_jobs: int, builder_options: BuilderOptions): parts = self.StringIntoTargetParts(name) @@ -406,6 +406,7 @@ def Create(self, name: str, runner, repository_path: str, output_prefix: str, builder.target = self builder.identifier = name builder.output_dir = os.path.join(output_prefix, name) + builder.ninja_jobs = ninja_jobs builder.chip_dir = os.path.abspath(repository_path) builder.options = builder_options diff --git a/scripts/build/build_examples.py b/scripts/build/build_examples.py index e1f37fca79..171c788c05 100755 --- a/scripts/build/build_examples.py +++ b/scripts/build/build_examples.py @@ -104,6 +104,13 @@ def ValidateTargetNames(context, parameter, values): default='./out', type=click.Path(file_okay=False, resolve_path=True), help='Prefix for the generated file output.') +@click.option( + '--ninja-jobs', + type=int, + is_flag=False, + flag_value=0, + default=None, + help='Number of ninja jobs') @click.option( '--pregen-dir', default=None, @@ -136,8 +143,8 @@ def ValidateTargetNames(context, parameter, values): 'for using ccache when building examples.')) @click.pass_context def main(context, log_level, target, enable_link_map_file, repo, - out_prefix, pregen_dir, clean, dry_run, dry_run_output, enable_flashbundle, - no_log_timestamps, pw_command_launcher): + out_prefix, ninja_jobs, pregen_dir, clean, dry_run, dry_run_output, + enable_flashbundle, no_log_timestamps, pw_command_launcher): # Ensures somewhat pretty logging of what is going on log_fmt = '%(asctime)s %(levelname)-7s %(message)s' if no_log_timestamps: @@ -161,7 +168,7 @@ def main(context, log_level, target, enable_link_map_file, repo, logging.info('Building targets: %s', CommaSeparate(requested_targets)) context.obj = build.Context( - repository_path=repo, output_prefix=out_prefix, runner=runner) + repository_path=repo, output_prefix=out_prefix, ninja_jobs=ninja_jobs, runner=runner) context.obj.SetupBuilders(targets=requested_targets, options=BuilderOptions( enable_link_map_file=enable_link_map_file, enable_flashbundle=enable_flashbundle, diff --git a/scripts/build/builders/ameba.py b/scripts/build/builders/ameba.py index 802ce1f73c..a4b3338b0c 100644 --- a/scripts/build/builders/ameba.py +++ b/scripts/build/builders/ameba.py @@ -85,8 +85,12 @@ def generate(self): title='Generating ' + self.identifier) def _build(self): - self._Execute(['ninja', '-C', self.output_dir], - title='Building ' + self.identifier) + cmd = ['ninja', '-C', self.output_dir] + + if self.ninja_jobs is not None: + cmd.append('-j' + str(self.ninja_jobs)) + + self._Execute(cmd, title='Building ' + self.identifier) def build_outputs(self): yield BuilderOutput( diff --git a/scripts/build/builders/android.py b/scripts/build/builders/android.py index 94d3a566a6..3f640177f1 100644 --- a/scripts/build/builders/android.py +++ b/scripts/build/builders/android.py @@ -466,8 +466,13 @@ def _build(self): title="Building APP " + self.identifier, ) else: + cmd = ["ninja", "-C", self.output_dir] + + if self.ninja_jobs is not None: + cmd.append('-j' + str(self.ninja_jobs)) + self._Execute( - ["ninja", "-C", self.output_dir], + cmd, title="Building JNI " + self.identifier, ) diff --git a/scripts/build/builders/gn.py b/scripts/build/builders/gn.py index d2b09f393c..6d9385bd4f 100644 --- a/scripts/build/builders/gn.py +++ b/scripts/build/builders/gn.py @@ -95,6 +95,8 @@ def _build(self): self.PreBuildCommand() cmd = ['ninja', '-C', self.output_dir] + if self.ninja_jobs is not None: + cmd.append('-j' + str(self.ninja_jobs)) if self.build_command: cmd.append(self.build_command) diff --git a/scripts/build/builders/host.py b/scripts/build/builders/host.py index a07064795a..8d209d6d29 100644 --- a/scripts/build/builders/host.py +++ b/scripts/build/builders/host.py @@ -570,7 +570,14 @@ def generate(self): def PreBuildCommand(self): if self.app == HostApp.TESTS and self.use_coverage: - self._Execute(['ninja', '-C', self.output_dir, 'default'], title="Build-only") + cmd = ['ninja', '-C', self.output_dir] + + if self.ninja_jobs is not None: + cmd.append('-j' + str(self.ninja_jobs)) + + cmd.append('default') + + self._Execute(cmd, title="Build-only") self._Execute(['lcov', '--initial', '--capture', '--directory', os.path.join(self.output_dir, 'obj'), '--exclude', os.path.join(self.chip_dir, '**/tests/*'), '--exclude', os.path.join(self.chip_dir, 'zzz_generated/*'), diff --git a/scripts/build/builders/nrf.py b/scripts/build/builders/nrf.py index 5fbc417ffe..b94a695359 100644 --- a/scripts/build/builders/nrf.py +++ b/scripts/build/builders/nrf.py @@ -215,8 +215,12 @@ def generate(self): def _build(self): logging.info('Compiling NrfConnect at %s', self.output_dir) - self._Execute(['ninja', '-C', self.output_dir], - title='Building ' + self.identifier) + cmd = ['ninja', '-C', self.output_dir] + + if self.ninja_jobs is not None: + cmd.append('-j' + str(self.ninja_jobs)) + + self._Execute(cmd, title='Building ' + self.identifier) if self.app == NrfApp.UNIT_TESTS: # Note: running zephyr/zephyr.elf has the same result except it creates diff --git a/scripts/build/builders/telink.py b/scripts/build/builders/telink.py index 6ac4c30ca2..2badbce4d1 100644 --- a/scripts/build/builders/telink.py +++ b/scripts/build/builders/telink.py @@ -238,6 +238,9 @@ def _build(self): cmd = self.get_cmd_prefixes() + ("ninja -C %s" % self.output_dir) + if self.ninja_jobs is not None: + cmd += " -j%s" % str(self.ninja_jobs) + self._Execute(['bash', '-c', cmd], title='Building ' + self.identifier) def build_outputs(self): diff --git a/scripts/icecc.sh b/scripts/icecc.sh new file mode 100755 index 0000000000..54783a4874 --- /dev/null +++ b/scripts/icecc.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash +# +# 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. +# + +# This scripts starts or stops the iceccd. +# It's meant to be use within devcontainer. + +if [ "$1" = "start" ]; then + IFS='.' read -ra PARTS <<<"$HOSTNAME" + if iceccd -d -m 0 -N "devcontainer-${PARTS[0]}"; then + echo "iceccd started" + else + echo "Failed to start iceccd" + fi +fi + +if [ "$1" = "stop" ]; then + if pkill icecc; then + echo "iceccd stopped" + else + echo "Failed to stop iceccd" + fi +fi From 4a21a8dcc6307d4f2d2777f61abe15d01a4c0322 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Tue, 8 Oct 2024 20:53:04 +0200 Subject: [PATCH 044/127] [AllClusters] If opened multiple times and something fails in Init, closing the app with Ctrl^C makes it crashes (#35844) * [InteractionModelEngine] Add some checks to Shutdown to prevent crashing if someone calls Shutdown before Init * [CommissioningWindowManager] Ensure Shutdown does nothing if Init has not been called --- src/app/InteractionModelEngine.cpp | 6 ++++++ src/app/InteractionModelEngine.h | 8 ++++++++ src/app/server/CommissioningWindowManager.cpp | 2 ++ 3 files changed, 16 insertions(+) diff --git a/src/app/InteractionModelEngine.cpp b/src/app/InteractionModelEngine.cpp index b122333ac2..59888feaf9 100644 --- a/src/app/InteractionModelEngine.cpp +++ b/src/app/InteractionModelEngine.cpp @@ -89,6 +89,7 @@ CHIP_ERROR InteractionModelEngine::Init(Messaging::ExchangeManager * apExchangeM VerifyOrReturnError(apExchangeMgr != nullptr, CHIP_ERROR_INVALID_ARGUMENT); VerifyOrReturnError(reportScheduler != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + mState = State::kInitializing; mpExchangeMgr = apExchangeMgr; mpFabricTable = apFabricTable; mpCASESessionMgr = apCASESessionMgr; @@ -111,11 +112,14 @@ CHIP_ERROR InteractionModelEngine::Init(Messaging::ExchangeManager * apExchangeM ChipLogError(InteractionModel, "WARNING └────────────────────────────────────────────────────"); #endif + mState = State::kInitialized; return CHIP_NO_ERROR; } void InteractionModelEngine::Shutdown() { + VerifyOrReturn(State::kUninitialized != mState); + mpExchangeMgr->GetSessionManager()->SystemLayer()->CancelTimer(ResumeSubscriptionsTimerCallback, this); // TODO: individual object clears the entire command handler interface registry. @@ -187,6 +191,8 @@ void InteractionModelEngine::Shutdown() // // mpFabricTable = nullptr; // mpExchangeMgr = nullptr; + + mState = State::kUninitialized; } uint32_t InteractionModelEngine::GetNumActiveReadHandlers() const diff --git a/src/app/InteractionModelEngine.h b/src/app/InteractionModelEngine.h index ba0a099bb7..b52b4eb451 100644 --- a/src/app/InteractionModelEngine.h +++ b/src/app/InteractionModelEngine.h @@ -713,6 +713,14 @@ class InteractionModelEngine : public Messaging::UnsolicitedMessageHandler, DataModel::Provider * mDataModelProvider = nullptr; Messaging::ExchangeContext * mCurrentExchange = nullptr; + enum class State : uint8_t + { + kUninitialized, // The object has not been initialized. + kInitializing, // Initial setup is in progress (e.g. setting up mpExchangeMgr). + kInitialized // The object has been fully initialized and is ready for use. + }; + State mState = State::kUninitialized; + // Changes the current exchange context of a InteractionModelEngine to a given context class CurrentExchangeValueScope { diff --git a/src/app/server/CommissioningWindowManager.cpp b/src/app/server/CommissioningWindowManager.cpp index 110a729d8f..2a8611ba34 100644 --- a/src/app/server/CommissioningWindowManager.cpp +++ b/src/app/server/CommissioningWindowManager.cpp @@ -111,6 +111,8 @@ void CommissioningWindowManager::OnPlatformEvent(const DeviceLayer::ChipDeviceEv void CommissioningWindowManager::Shutdown() { + VerifyOrReturn(nullptr != mServer); + StopAdvertisement(/* aShuttingDown = */ true); ResetState(); From 7fcc60f250ca1e589bcb7ac43bf88de0f78e11d4 Mon Sep 17 00:00:00 2001 From: yunhanw-google Date: Tue, 8 Oct 2024 12:46:30 -0700 Subject: [PATCH 045/127] [Android] Add StayActive support during commission flow for LIT (#35959) --- .../DeviceProvisioningFragment.kt | 2 +- .../java/AndroidDeviceControllerWrapper.cpp | 24 +++++++++++++++---- .../devicecontroller/ICDRegistrationInfo.java | 17 +++++++++++++ 3 files changed, 38 insertions(+), 5 deletions(-) diff --git a/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/provisioning/DeviceProvisioningFragment.kt b/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/provisioning/DeviceProvisioningFragment.kt index 97b2576827..f7049b68ea 100644 --- a/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/provisioning/DeviceProvisioningFragment.kt +++ b/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/provisioning/DeviceProvisioningFragment.kt @@ -289,7 +289,7 @@ class DeviceProvisioningFragment : Fragment() { override fun onICDRegistrationInfoRequired() { Log.d(TAG, "onICDRegistrationInfoRequired") deviceController.updateCommissioningICDRegistrationInfo( - ICDRegistrationInfo.newBuilder().build() + ICDRegistrationInfo.newBuilder().setICDStayActiveDurationMsec(30000L).build() ) } diff --git a/src/controller/java/AndroidDeviceControllerWrapper.cpp b/src/controller/java/AndroidDeviceControllerWrapper.cpp index f634f8a26f..fccb1ba7cb 100644 --- a/src/controller/java/AndroidDeviceControllerWrapper.cpp +++ b/src/controller/java/AndroidDeviceControllerWrapper.cpp @@ -508,28 +508,44 @@ CHIP_ERROR AndroidDeviceControllerWrapper::ApplyICDRegistrationInfo(chip::Contro VerifyOrReturnError(icdRegistrationInfo != nullptr, CHIP_ERROR_INVALID_ARGUMENT); JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Controller, "Failed to retrieve JNIEnv in %s.", __func__); + return CHIP_ERROR_INCORRECT_STATE; + } + + jmethodID getICDStayActiveDurationMsecMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, icdRegistrationInfo, "getICDStayActiveDurationMsec", + "()Ljava/lang/Long;", &getICDStayActiveDurationMsecMethod); + ReturnErrorOnFailure(err); + jobject jStayActiveMsec = env->CallObjectMethod(icdRegistrationInfo, getICDStayActiveDurationMsecMethod); + if (jStayActiveMsec != 0) + { + params.SetICDStayActiveDurationMsec(chip::JniReferences::GetInstance().IntegerToPrimitive(jStayActiveMsec)); + } + jmethodID getCheckInNodeIdMethod; err = chip::JniReferences::GetInstance().FindMethod(env, icdRegistrationInfo, "getCheckInNodeId", "()Ljava/lang/Long;", &getCheckInNodeIdMethod); - VerifyOrReturnError(err == CHIP_NO_ERROR, err); + ReturnErrorOnFailure(err); jobject jCheckInNodeId = env->CallObjectMethod(icdRegistrationInfo, getCheckInNodeIdMethod); jmethodID getMonitoredSubjectMethod; err = chip::JniReferences::GetInstance().FindMethod(env, icdRegistrationInfo, "getMonitoredSubject", "()Ljava/lang/Long;", &getMonitoredSubjectMethod); - VerifyOrReturnError(err == CHIP_NO_ERROR, err); + ReturnErrorOnFailure(err); jobject jMonitoredSubject = env->CallObjectMethod(icdRegistrationInfo, getMonitoredSubjectMethod); jmethodID getSymmetricKeyMethod; err = chip::JniReferences::GetInstance().FindMethod(env, icdRegistrationInfo, "getSymmetricKey", "()[B", &getSymmetricKeyMethod); - VerifyOrReturnError(err == CHIP_NO_ERROR, err); + ReturnErrorOnFailure(err); jbyteArray jSymmetricKey = static_cast(env->CallObjectMethod(icdRegistrationInfo, getSymmetricKeyMethod)); jmethodID getClientTypeMethod; err = chip::JniReferences::GetInstance().FindMethod(env, icdRegistrationInfo, "getClientType", "()Ljava/lang/Integer;", &getClientTypeMethod); - VerifyOrReturnError(err == CHIP_NO_ERROR, err); + ReturnErrorOnFailure(err); jobject jClientType = env->CallObjectMethod(icdRegistrationInfo, getClientTypeMethod); chip::NodeId checkInNodeId = chip::kUndefinedNodeId; diff --git a/src/controller/java/src/chip/devicecontroller/ICDRegistrationInfo.java b/src/controller/java/src/chip/devicecontroller/ICDRegistrationInfo.java index 417d147238..b8fcde3a36 100644 --- a/src/controller/java/src/chip/devicecontroller/ICDRegistrationInfo.java +++ b/src/controller/java/src/chip/devicecontroller/ICDRegistrationInfo.java @@ -25,12 +25,19 @@ public class ICDRegistrationInfo { @Nullable private final Long monitoredSubject; @Nullable private final byte[] symmetricKey; @Nullable private final Integer clientType; + @Nullable private final Long stayActiveDurationMsec; private ICDRegistrationInfo(Builder builder) { this.checkInNodeId = builder.checkInNodeId; this.monitoredSubject = builder.monitoredSubject; this.symmetricKey = builder.symmetricKey; this.clientType = builder.clientType; + this.stayActiveDurationMsec = builder.stayActiveDurationMsec; + } + + /** Returns the duration period to stay active. */ + public Long getICDStayActiveDurationMsec() { + return stayActiveDurationMsec; } /** Returns the check in node ID. */ @@ -62,6 +69,7 @@ public static class Builder { @Nullable private Long monitoredSubject = null; @Nullable private byte[] symmetricKey = null; @Nullable private Integer clientType = null; + @Nullable private Long stayActiveDurationMsec = null; private Builder() {} @@ -93,6 +101,15 @@ public Builder setClientType(Integer clientType) { return this; } + /** + * Request LIT device to stay active for specific duration after commission completes, the upper + * bound is 30 seconds. + */ + public Builder setICDStayActiveDurationMsec(Long stayActiveDurationMsec) { + this.stayActiveDurationMsec = stayActiveDurationMsec; + return this; + } + public ICDRegistrationInfo build() { return new ICDRegistrationInfo(this); } From a854245a4d7e629b30713df49d85e67463efb0c2 Mon Sep 17 00:00:00 2001 From: "tianfeng.yang" <130436698+tianfeng-yang@users.noreply.github.com> Date: Wed, 9 Oct 2024 04:16:44 +0800 Subject: [PATCH 046/127] [Python] Fix the value type of enumeration kUnknownEnumValue (#35963) Co-authored-by: Andrei Litvin --- .../python/chip/clusters/Objects.py | 474 +++++++++--------- .../python/templates/partials/enum_def.zapt | 2 +- 2 files changed, 238 insertions(+), 238 deletions(-) diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 2daa5e799b..bd4f5cfbd8 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -269,7 +269,7 @@ class AreaTypeTag(MatterIntEnum): # 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 = 95, + kUnknownEnumValue = 95 class AtomicRequestTypeEnum(MatterIntEnum): kBeginWrite = 0x00 @@ -279,7 +279,7 @@ class AtomicRequestTypeEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class FloorSurfaceTag(MatterIntEnum): kCarpet = 0x00 @@ -310,7 +310,7 @@ class FloorSurfaceTag(MatterIntEnum): # 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 = 24, + kUnknownEnumValue = 24 class LandmarkTag(MatterIntEnum): kAirConditioner = 0x00 @@ -368,7 +368,7 @@ class LandmarkTag(MatterIntEnum): # 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 = 51, + kUnknownEnumValue = 51 class PositionTag(MatterIntEnum): kLeft = 0x00 @@ -382,7 +382,7 @@ class PositionTag(MatterIntEnum): # 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 = 7, + kUnknownEnumValue = 7 class RelativePositionTag(MatterIntEnum): kUnder = 0x00 @@ -396,7 +396,7 @@ class RelativePositionTag(MatterIntEnum): # 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 = 7, + kUnknownEnumValue = 7 class TestGlobalEnum(MatterIntEnum): kSomeValue = 0x00 @@ -406,7 +406,7 @@ class TestGlobalEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class ThreeLevelAutoEnum(MatterIntEnum): kLow = 0x00 @@ -417,7 +417,7 @@ class ThreeLevelAutoEnum(MatterIntEnum): # 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 = 4, + kUnknownEnumValue = 4 class Bitmaps: class TestGlobalBitmap(IntFlag): @@ -509,7 +509,7 @@ class EffectIdentifierEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class EffectVariantEnum(MatterIntEnum): kDefault = 0x00 @@ -517,7 +517,7 @@ class EffectVariantEnum(MatterIntEnum): # 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 = 1, + kUnknownEnumValue = 1 class IdentifyTypeEnum(MatterIntEnum): kNone = 0x00 @@ -530,7 +530,7 @@ class IdentifyTypeEnum(MatterIntEnum): # 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 = 6, + kUnknownEnumValue = 6 class Commands: @dataclass @@ -1057,7 +1057,7 @@ class DelayedAllOffEffectVariantEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class DyingLightEffectVariantEnum(MatterIntEnum): kDyingLightFadeOff = 0x00 @@ -1065,7 +1065,7 @@ class DyingLightEffectVariantEnum(MatterIntEnum): # 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 = 1, + kUnknownEnumValue = 1 class EffectIdentifierEnum(MatterIntEnum): kDelayedAllOff = 0x00 @@ -1074,7 +1074,7 @@ class EffectIdentifierEnum(MatterIntEnum): # 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 = 2 class StartUpOnOffEnum(MatterIntEnum): kOff = 0x00 @@ -1084,7 +1084,7 @@ class StartUpOnOffEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class Bitmaps: class Feature(IntFlag): @@ -1423,7 +1423,7 @@ class MoveModeEnum(MatterIntEnum): # 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 = 2 class StepModeEnum(MatterIntEnum): kUp = 0x00 @@ -1432,7 +1432,7 @@ class StepModeEnum(MatterIntEnum): # 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 = 2 class Bitmaps: class Feature(IntFlag): @@ -2527,7 +2527,7 @@ class AccessControlEntryAuthModeEnum(MatterIntEnum): # 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 = 0 class AccessControlEntryPrivilegeEnum(MatterIntEnum): kView = 0x01 @@ -2539,7 +2539,7 @@ class AccessControlEntryPrivilegeEnum(MatterIntEnum): # 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 = 0 class AccessRestrictionTypeEnum(MatterIntEnum): kAttributeAccessForbidden = 0x00 @@ -2550,7 +2550,7 @@ class AccessRestrictionTypeEnum(MatterIntEnum): # 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 = 4, + kUnknownEnumValue = 4 class ChangeTypeEnum(MatterIntEnum): kChanged = 0x00 @@ -2560,7 +2560,7 @@ class ChangeTypeEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class Bitmaps: class Feature(IntFlag): @@ -3020,7 +3020,7 @@ class ActionErrorEnum(MatterIntEnum): # 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 = 2 class ActionStateEnum(MatterIntEnum): kInactive = 0x00 @@ -3031,7 +3031,7 @@ class ActionStateEnum(MatterIntEnum): # 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 = 4, + kUnknownEnumValue = 4 class ActionTypeEnum(MatterIntEnum): kOther = 0x00 @@ -3045,7 +3045,7 @@ class ActionTypeEnum(MatterIntEnum): # 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 = 7, + kUnknownEnumValue = 7 class EndpointListTypeEnum(MatterIntEnum): kOther = 0x00 @@ -3055,7 +3055,7 @@ class EndpointListTypeEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class Bitmaps: class CommandBits(IntFlag): @@ -3629,7 +3629,7 @@ class ColorEnum(MatterIntEnum): # 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 = 21, + kUnknownEnumValue = 21 class ProductFinishEnum(MatterIntEnum): kOther = 0x00 @@ -3642,7 +3642,7 @@ class ProductFinishEnum(MatterIntEnum): # 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 = 6, + kUnknownEnumValue = 6 class Structs: @dataclass @@ -4257,7 +4257,7 @@ class ApplyUpdateActionEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class DownloadProtocolEnum(MatterIntEnum): kBDXSynchronous = 0x00 @@ -4268,7 +4268,7 @@ class DownloadProtocolEnum(MatterIntEnum): # 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 = 4, + kUnknownEnumValue = 4 class StatusEnum(MatterIntEnum): kUpdateAvailable = 0x00 @@ -4279,7 +4279,7 @@ class StatusEnum(MatterIntEnum): # 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 = 4, + kUnknownEnumValue = 4 class Commands: @dataclass @@ -4534,7 +4534,7 @@ class AnnouncementReasonEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class ChangeReasonEnum(MatterIntEnum): kUnknown = 0x00 @@ -4546,7 +4546,7 @@ class ChangeReasonEnum(MatterIntEnum): # 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 = 5, + kUnknownEnumValue = 5 class UpdateStateEnum(MatterIntEnum): kUnknown = 0x00 @@ -4562,7 +4562,7 @@ class UpdateStateEnum(MatterIntEnum): # 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 = 9, + kUnknownEnumValue = 9 class Structs: @dataclass @@ -5044,7 +5044,7 @@ class CalendarTypeEnum(MatterIntEnum): # 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 = 12, + kUnknownEnumValue = 12 class HourFormatEnum(MatterIntEnum): k12hr = 0x00 @@ -5054,7 +5054,7 @@ class HourFormatEnum(MatterIntEnum): # 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 = 2 class Bitmaps: class Feature(IntFlag): @@ -5240,7 +5240,7 @@ class TempUnitEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class Bitmaps: class Feature(IntFlag): @@ -5625,7 +5625,7 @@ class BatApprovedChemistryEnum(MatterIntEnum): # 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 = 33, + kUnknownEnumValue = 33 class BatChargeFaultEnum(MatterIntEnum): kUnspecified = 0x00 @@ -5643,7 +5643,7 @@ class BatChargeFaultEnum(MatterIntEnum): # 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 = 11, + kUnknownEnumValue = 11 class BatChargeLevelEnum(MatterIntEnum): kOk = 0x00 @@ -5653,7 +5653,7 @@ class BatChargeLevelEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class BatChargeStateEnum(MatterIntEnum): kUnknown = 0x00 @@ -5664,7 +5664,7 @@ class BatChargeStateEnum(MatterIntEnum): # 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 = 4, + kUnknownEnumValue = 4 class BatCommonDesignationEnum(MatterIntEnum): kUnspecified = 0x00 @@ -5752,7 +5752,7 @@ class BatCommonDesignationEnum(MatterIntEnum): # 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 = 81, + kUnknownEnumValue = 81 class BatFaultEnum(MatterIntEnum): kUnspecified = 0x00 @@ -5762,7 +5762,7 @@ class BatFaultEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class BatReplaceabilityEnum(MatterIntEnum): kUnspecified = 0x00 @@ -5773,7 +5773,7 @@ class BatReplaceabilityEnum(MatterIntEnum): # 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 = 4, + kUnknownEnumValue = 4 class PowerSourceStatusEnum(MatterIntEnum): kUnspecified = 0x00 @@ -5784,7 +5784,7 @@ class PowerSourceStatusEnum(MatterIntEnum): # 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 = 4, + kUnknownEnumValue = 4 class WiredCurrentTypeEnum(MatterIntEnum): kAc = 0x00 @@ -5793,7 +5793,7 @@ class WiredCurrentTypeEnum(MatterIntEnum): # 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 = 2 class WiredFaultEnum(MatterIntEnum): kUnspecified = 0x00 @@ -5803,7 +5803,7 @@ class WiredFaultEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class Bitmaps: class Feature(IntFlag): @@ -6583,7 +6583,7 @@ class CommissioningErrorEnum(MatterIntEnum): # 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 = 8, + kUnknownEnumValue = 8 class RegulatoryLocationTypeEnum(MatterIntEnum): kIndoor = 0x00 @@ -6593,7 +6593,7 @@ class RegulatoryLocationTypeEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class Bitmaps: class Feature(IntFlag): @@ -7075,7 +7075,7 @@ class NetworkCommissioningStatusEnum(MatterIntEnum): # 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 = 13, + kUnknownEnumValue = 13 class WiFiBandEnum(MatterIntEnum): k2g4 = 0x00 @@ -7088,7 +7088,7 @@ class WiFiBandEnum(MatterIntEnum): # 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 = 6, + kUnknownEnumValue = 6 class Bitmaps: class Feature(IntFlag): @@ -7703,7 +7703,7 @@ class IntentEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class StatusEnum(MatterIntEnum): kSuccess = 0x00 @@ -7715,7 +7715,7 @@ class StatusEnum(MatterIntEnum): # 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 = 5, + kUnknownEnumValue = 5 class TransferProtocolEnum(MatterIntEnum): kResponsePayload = 0x00 @@ -7724,7 +7724,7 @@ class TransferProtocolEnum(MatterIntEnum): # 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 = 2 class Commands: @dataclass @@ -7921,7 +7921,7 @@ class BootReasonEnum(MatterIntEnum): # 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 = 7, + kUnknownEnumValue = 7 class HardwareFaultEnum(MatterIntEnum): kUnspecified = 0x00 @@ -7939,7 +7939,7 @@ class HardwareFaultEnum(MatterIntEnum): # 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 = 11, + kUnknownEnumValue = 11 class InterfaceTypeEnum(MatterIntEnum): kUnspecified = 0x00 @@ -7951,7 +7951,7 @@ class InterfaceTypeEnum(MatterIntEnum): # 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 = 5, + kUnknownEnumValue = 5 class NetworkFaultEnum(MatterIntEnum): kUnspecified = 0x00 @@ -7962,7 +7962,7 @@ class NetworkFaultEnum(MatterIntEnum): # 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 = 4, + kUnknownEnumValue = 4 class RadioFaultEnum(MatterIntEnum): kUnspecified = 0x00 @@ -7976,7 +7976,7 @@ class RadioFaultEnum(MatterIntEnum): # 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 = 7, + kUnknownEnumValue = 7 class Bitmaps: class Feature(IntFlag): @@ -8831,7 +8831,7 @@ class ConnectionStatusEnum(MatterIntEnum): # 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 = 2 class NetworkFaultEnum(MatterIntEnum): kUnspecified = 0x00 @@ -8842,7 +8842,7 @@ class NetworkFaultEnum(MatterIntEnum): # 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 = 4, + kUnknownEnumValue = 4 class RoutingRoleEnum(MatterIntEnum): kUnspecified = 0x00 @@ -8856,7 +8856,7 @@ class RoutingRoleEnum(MatterIntEnum): # 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 = 7, + kUnknownEnumValue = 7 class Bitmaps: class Feature(IntFlag): @@ -10198,7 +10198,7 @@ class AssociationFailureCauseEnum(MatterIntEnum): # 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 = 4, + kUnknownEnumValue = 4 class ConnectionStatusEnum(MatterIntEnum): kConnected = 0x00 @@ -10207,7 +10207,7 @@ class ConnectionStatusEnum(MatterIntEnum): # 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 = 2 class SecurityTypeEnum(MatterIntEnum): kUnspecified = 0x00 @@ -10220,7 +10220,7 @@ class SecurityTypeEnum(MatterIntEnum): # 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 = 6, + kUnknownEnumValue = 6 class WiFiVersionEnum(MatterIntEnum): kA = 0x00 @@ -10234,7 +10234,7 @@ class WiFiVersionEnum(MatterIntEnum): # 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 = 7, + kUnknownEnumValue = 7 class Bitmaps: class Feature(IntFlag): @@ -10678,7 +10678,7 @@ class PHYRateEnum(MatterIntEnum): # 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 = 10, + kUnknownEnumValue = 10 class Bitmaps: class Feature(IntFlag): @@ -11001,7 +11001,7 @@ class GranularityEnum(MatterIntEnum): # 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 = 5, + kUnknownEnumValue = 5 class StatusCode(MatterIntEnum): kTimeNotAccepted = 0x02 @@ -11009,7 +11009,7 @@ class StatusCode(MatterIntEnum): # 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 = 0 class TimeSourceEnum(MatterIntEnum): kNone = 0x00 @@ -11033,7 +11033,7 @@ class TimeSourceEnum(MatterIntEnum): # 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 = 17, + kUnknownEnumValue = 17 class TimeZoneDatabaseEnum(MatterIntEnum): kFull = 0x00 @@ -11043,7 +11043,7 @@ class TimeZoneDatabaseEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class Bitmaps: class Feature(IntFlag): @@ -11691,7 +11691,7 @@ class ColorEnum(MatterIntEnum): # 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 = 21, + kUnknownEnumValue = 21 class ProductFinishEnum(MatterIntEnum): kOther = 0x00 @@ -11704,7 +11704,7 @@ class ProductFinishEnum(MatterIntEnum): # 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 = 6, + kUnknownEnumValue = 6 class Bitmaps: class Feature(IntFlag): @@ -12563,7 +12563,7 @@ class CommissioningWindowStatusEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class StatusCode(MatterIntEnum): kBusy = 0x02 @@ -12573,7 +12573,7 @@ class StatusCode(MatterIntEnum): # 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 = 0 class Bitmaps: class Feature(IntFlag): @@ -12834,7 +12834,7 @@ class CertificateChainTypeEnum(MatterIntEnum): # 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 = 0 class NodeOperationalCertStatusEnum(MatterIntEnum): kOk = 0x00 @@ -12851,7 +12851,7 @@ class NodeOperationalCertStatusEnum(MatterIntEnum): # 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 = 7, + kUnknownEnumValue = 7 class Structs: @dataclass @@ -13336,7 +13336,7 @@ class GroupKeySecurityPolicyEnum(MatterIntEnum): # 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 = 2 class Bitmaps: class Feature(IntFlag): @@ -14535,7 +14535,7 @@ class ClientTypeEnum(MatterIntEnum): # 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 = 2 class OperatingModeEnum(MatterIntEnum): kSit = 0x00 @@ -14544,7 +14544,7 @@ class OperatingModeEnum(MatterIntEnum): # 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 = 2 class Bitmaps: class Feature(IntFlag): @@ -14978,7 +14978,7 @@ class TimerStatusEnum(MatterIntEnum): # 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 = 4, + kUnknownEnumValue = 4 class Bitmaps: class Feature(IntFlag): @@ -15237,7 +15237,7 @@ class ErrorStateEnum(MatterIntEnum): # 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 = 4, + kUnknownEnumValue = 4 class OperationalStateEnum(MatterIntEnum): kStopped = 0x00 @@ -15248,7 +15248,7 @@ class OperationalStateEnum(MatterIntEnum): # 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 = 4, + kUnknownEnumValue = 4 class Structs: @dataclass @@ -15641,7 +15641,7 @@ class ModeTag(MatterIntEnum): # 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 = 10, + kUnknownEnumValue = 10 class Bitmaps: class Feature(IntFlag): @@ -15910,7 +15910,7 @@ class DrynessLevelEnum(MatterIntEnum): # 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 = 4, + kUnknownEnumValue = 4 class Attributes: @dataclass @@ -16926,7 +16926,7 @@ class NumberOfRinsesEnum(MatterIntEnum): # 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 = 4, + kUnknownEnumValue = 4 class Bitmaps: class Feature(IntFlag): @@ -18389,7 +18389,7 @@ class AirQualityEnum(MatterIntEnum): # 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 = 7, + kUnknownEnumValue = 7 class Bitmaps: class Feature(IntFlag): @@ -18570,7 +18570,7 @@ class AlarmStateEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class ContaminationStateEnum(MatterIntEnum): kNormal = 0x00 @@ -18581,7 +18581,7 @@ class ContaminationStateEnum(MatterIntEnum): # 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 = 4, + kUnknownEnumValue = 4 class EndOfServiceEnum(MatterIntEnum): kNormal = 0x00 @@ -18590,7 +18590,7 @@ class EndOfServiceEnum(MatterIntEnum): # 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 = 2 class ExpressedStateEnum(MatterIntEnum): kNormal = 0x00 @@ -18606,7 +18606,7 @@ class ExpressedStateEnum(MatterIntEnum): # 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 = 9, + kUnknownEnumValue = 9 class MuteStateEnum(MatterIntEnum): kNotMuted = 0x00 @@ -18615,7 +18615,7 @@ class MuteStateEnum(MatterIntEnum): # 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 = 2 class SensitivityEnum(MatterIntEnum): kHigh = 0x00 @@ -18625,7 +18625,7 @@ class SensitivityEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class Bitmaps: class Feature(IntFlag): @@ -19453,7 +19453,7 @@ class ModeTag(MatterIntEnum): # 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 = 10, + kUnknownEnumValue = 10 class Bitmaps: class Feature(IntFlag): @@ -19993,7 +19993,7 @@ class ErrorStateEnum(MatterIntEnum): # 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 = 4, + kUnknownEnumValue = 4 class OperationalStateEnum(MatterIntEnum): kStopped = 0x00 @@ -20004,7 +20004,7 @@ class OperationalStateEnum(MatterIntEnum): # 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 = 4, + kUnknownEnumValue = 4 class Structs: @dataclass @@ -21321,7 +21321,7 @@ class ChangeIndicationEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class DegradationDirectionEnum(MatterIntEnum): kUp = 0x00 @@ -21330,7 +21330,7 @@ class DegradationDirectionEnum(MatterIntEnum): # 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 = 2 class ProductIdentifierTypeEnum(MatterIntEnum): kUpc = 0x00 @@ -21342,7 +21342,7 @@ class ProductIdentifierTypeEnum(MatterIntEnum): # 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 = 5, + kUnknownEnumValue = 5 class Bitmaps: class Feature(IntFlag): @@ -21616,7 +21616,7 @@ class ChangeIndicationEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class DegradationDirectionEnum(MatterIntEnum): kUp = 0x00 @@ -21625,7 +21625,7 @@ class DegradationDirectionEnum(MatterIntEnum): # 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 = 2 class ProductIdentifierTypeEnum(MatterIntEnum): kUpc = 0x00 @@ -21637,7 +21637,7 @@ class ProductIdentifierTypeEnum(MatterIntEnum): # 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 = 5, + kUnknownEnumValue = 5 class Bitmaps: class Feature(IntFlag): @@ -22272,7 +22272,7 @@ class StatusCodeEnum(MatterIntEnum): # 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 = 0 class ValveStateEnum(MatterIntEnum): kClosed = 0x00 @@ -22282,7 +22282,7 @@ class ValveStateEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class Bitmaps: class Feature(IntFlag): @@ -22726,7 +22726,7 @@ class MeasurementTypeEnum(MatterIntEnum): # 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 = 15, + kUnknownEnumValue = 15 class PowerModeEnum(MatterIntEnum): kUnknown = 0x00 @@ -22736,7 +22736,7 @@ class PowerModeEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class Bitmaps: class Feature(IntFlag): @@ -23313,7 +23313,7 @@ class MeasurementTypeEnum(MatterIntEnum): # 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 = 15, + kUnknownEnumValue = 15 class Bitmaps: class Feature(IntFlag): @@ -23683,7 +23683,7 @@ class BoostStateEnum(MatterIntEnum): # 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 = 2 class Bitmaps: class Feature(IntFlag): @@ -24034,7 +24034,7 @@ class CriticalityLevelEnum(MatterIntEnum): # 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 = 10, + kUnknownEnumValue = 10 class HeatingSourceEnum(MatterIntEnum): kAny = 0x00 @@ -24044,7 +24044,7 @@ class HeatingSourceEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class LoadControlEventChangeSourceEnum(MatterIntEnum): kAutomatic = 0x00 @@ -24053,7 +24053,7 @@ class LoadControlEventChangeSourceEnum(MatterIntEnum): # 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 = 2 class LoadControlEventStatusEnum(MatterIntEnum): kUnknown = 0x00 @@ -24073,7 +24073,7 @@ class LoadControlEventStatusEnum(MatterIntEnum): # 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 = 13, + kUnknownEnumValue = 13 class Bitmaps: class CancelControlBitmap(IntFlag): @@ -24625,7 +24625,7 @@ class FutureMessagePreferenceEnum(MatterIntEnum): # 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 = 5, + kUnknownEnumValue = 5 class MessagePriorityEnum(MatterIntEnum): kLow = 0x00 @@ -24636,7 +24636,7 @@ class MessagePriorityEnum(MatterIntEnum): # 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 = 4, + kUnknownEnumValue = 4 class Bitmaps: class Feature(IntFlag): @@ -24975,7 +24975,7 @@ class AdjustmentCauseEnum(MatterIntEnum): # 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 = 2 class CauseEnum(MatterIntEnum): kNormalCompletion = 0x00 @@ -24987,7 +24987,7 @@ class CauseEnum(MatterIntEnum): # 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 = 5, + kUnknownEnumValue = 5 class CostTypeEnum(MatterIntEnum): kFinancial = 0x00 @@ -24998,7 +24998,7 @@ class CostTypeEnum(MatterIntEnum): # 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 = 4, + kUnknownEnumValue = 4 class ESAStateEnum(MatterIntEnum): kOffline = 0x00 @@ -25010,7 +25010,7 @@ class ESAStateEnum(MatterIntEnum): # 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 = 5, + kUnknownEnumValue = 5 class ESATypeEnum(MatterIntEnum): kEvse = 0x00 @@ -25032,7 +25032,7 @@ class ESATypeEnum(MatterIntEnum): # 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 = 14, + kUnknownEnumValue = 14 class ForecastUpdateReasonEnum(MatterIntEnum): kInternalOptimization = 0x00 @@ -25042,7 +25042,7 @@ class ForecastUpdateReasonEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class OptOutStateEnum(MatterIntEnum): kNoOptOut = 0x00 @@ -25053,7 +25053,7 @@ class OptOutStateEnum(MatterIntEnum): # 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 = 4, + kUnknownEnumValue = 4 class PowerAdjustReasonEnum(MatterIntEnum): kNoAdjustment = 0x00 @@ -25063,7 +25063,7 @@ class PowerAdjustReasonEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class Bitmaps: class Feature(IntFlag): @@ -25742,7 +25742,7 @@ class EnergyTransferStoppedReasonEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class FaultStateEnum(MatterIntEnum): kNoError = 0x00 @@ -25766,7 +25766,7 @@ class FaultStateEnum(MatterIntEnum): # 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 = 16, + kUnknownEnumValue = 16 class StateEnum(MatterIntEnum): kNotPluggedIn = 0x00 @@ -25780,7 +25780,7 @@ class StateEnum(MatterIntEnum): # 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 = 7, + kUnknownEnumValue = 7 class SupplyStateEnum(MatterIntEnum): kDisabled = 0x00 @@ -25793,7 +25793,7 @@ class SupplyStateEnum(MatterIntEnum): # 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 = 6, + kUnknownEnumValue = 6 class Bitmaps: class Feature(IntFlag): @@ -26644,7 +26644,7 @@ class EnergyPriorityEnum(MatterIntEnum): # 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 = 4, + kUnknownEnumValue = 4 class Bitmaps: class Feature(IntFlag): @@ -27981,7 +27981,7 @@ class AlarmCodeEnum(MatterIntEnum): # 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 = 2 class CredentialRuleEnum(MatterIntEnum): kSingle = 0x00 @@ -27991,7 +27991,7 @@ class CredentialRuleEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class CredentialTypeEnum(MatterIntEnum): kProgrammingPIN = 0x00 @@ -28007,7 +28007,7 @@ class CredentialTypeEnum(MatterIntEnum): # 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 = 9, + kUnknownEnumValue = 9 class DataOperationTypeEnum(MatterIntEnum): kAdd = 0x00 @@ -28017,7 +28017,7 @@ class DataOperationTypeEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class DlLockState(MatterIntEnum): kNotFullyLocked = 0x00 @@ -28028,7 +28028,7 @@ class DlLockState(MatterIntEnum): # 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 = 4, + kUnknownEnumValue = 4 class DlLockType(MatterIntEnum): kDeadBolt = 0x00 @@ -28047,7 +28047,7 @@ class DlLockType(MatterIntEnum): # 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 = 12, + kUnknownEnumValue = 12 class DlStatus(MatterIntEnum): kSuccess = 0x00 @@ -28061,7 +28061,7 @@ class DlStatus(MatterIntEnum): # 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 = 4, + kUnknownEnumValue = 4 class DoorLockOperationEventCode(MatterIntEnum): kUnknownOrMfgSpecific = 0x00 @@ -28083,7 +28083,7 @@ class DoorLockOperationEventCode(MatterIntEnum): # 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 = 15, + kUnknownEnumValue = 15 class DoorLockProgrammingEventCode(MatterIntEnum): kUnknownOrMfgSpecific = 0x00 @@ -28097,7 +28097,7 @@ class DoorLockProgrammingEventCode(MatterIntEnum): # 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 = 7, + kUnknownEnumValue = 7 class DoorLockSetPinOrIdStatus(MatterIntEnum): kSuccess = 0x00 @@ -28108,7 +28108,7 @@ class DoorLockSetPinOrIdStatus(MatterIntEnum): # 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 = 4, + kUnknownEnumValue = 4 class DoorLockUserStatus(MatterIntEnum): kAvailable = 0x00 @@ -28119,7 +28119,7 @@ class DoorLockUserStatus(MatterIntEnum): # 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 = 2 class DoorLockUserType(MatterIntEnum): kUnrestricted = 0x00 @@ -28132,7 +28132,7 @@ class DoorLockUserType(MatterIntEnum): # 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 = 5, + kUnknownEnumValue = 5 class DoorStateEnum(MatterIntEnum): kDoorOpen = 0x00 @@ -28145,7 +28145,7 @@ class DoorStateEnum(MatterIntEnum): # 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 = 6, + kUnknownEnumValue = 6 class LockDataTypeEnum(MatterIntEnum): kUnspecified = 0x00 @@ -28166,7 +28166,7 @@ class LockDataTypeEnum(MatterIntEnum): # 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 = 14, + kUnknownEnumValue = 14 class LockOperationTypeEnum(MatterIntEnum): kLock = 0x00 @@ -28178,7 +28178,7 @@ class LockOperationTypeEnum(MatterIntEnum): # 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 = 5, + kUnknownEnumValue = 5 class OperatingModeEnum(MatterIntEnum): kNormal = 0x00 @@ -28190,7 +28190,7 @@ class OperatingModeEnum(MatterIntEnum): # 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 = 5, + kUnknownEnumValue = 5 class OperationErrorEnum(MatterIntEnum): kUnspecified = 0x00 @@ -28202,7 +28202,7 @@ class OperationErrorEnum(MatterIntEnum): # 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 = 5, + kUnknownEnumValue = 5 class OperationSourceEnum(MatterIntEnum): kUnspecified = 0x00 @@ -28220,7 +28220,7 @@ class OperationSourceEnum(MatterIntEnum): # 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 = 11, + kUnknownEnumValue = 11 class UserStatusEnum(MatterIntEnum): kAvailable = 0x00 @@ -28230,7 +28230,7 @@ class UserStatusEnum(MatterIntEnum): # 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 = 2 class UserTypeEnum(MatterIntEnum): kUnrestrictedUser = 0x00 @@ -28247,7 +28247,7 @@ class UserTypeEnum(MatterIntEnum): # 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 = 10, + kUnknownEnumValue = 10 class Bitmaps: class DaysMaskMap(IntFlag): @@ -30032,7 +30032,7 @@ class EndProductType(MatterIntEnum): # 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 = 24, + kUnknownEnumValue = 24 class Type(MatterIntEnum): kRollerShade = 0x00 @@ -30050,7 +30050,7 @@ class Type(MatterIntEnum): # 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 = 10, + kUnknownEnumValue = 10 class Bitmaps: class ConfigStatus(IntFlag): @@ -30693,7 +30693,7 @@ class OperationalStatusEnum(MatterIntEnum): # 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 = 4, + kUnknownEnumValue = 4 class SelectAreasStatus(MatterIntEnum): kSuccess = 0x00 @@ -30704,7 +30704,7 @@ class SelectAreasStatus(MatterIntEnum): # 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 = 4, + kUnknownEnumValue = 4 class SkipAreaStatus(MatterIntEnum): kSuccess = 0x00 @@ -30715,7 +30715,7 @@ class SkipAreaStatus(MatterIntEnum): # 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 = 4, + kUnknownEnumValue = 4 class Bitmaps: class Feature(IntFlag): @@ -31139,7 +31139,7 @@ class ControlModeEnum(MatterIntEnum): # 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 = 4, + kUnknownEnumValue = 4 class OperationModeEnum(MatterIntEnum): kNormal = 0x00 @@ -31150,7 +31150,7 @@ class OperationModeEnum(MatterIntEnum): # 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 = 4, + kUnknownEnumValue = 4 class Bitmaps: class Feature(IntFlag): @@ -32062,7 +32062,7 @@ class ACCapacityFormatEnum(MatterIntEnum): # 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 = 1, + kUnknownEnumValue = 1 class ACCompressorTypeEnum(MatterIntEnum): kUnknown = 0x00 @@ -32073,7 +32073,7 @@ class ACCompressorTypeEnum(MatterIntEnum): # 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 = 4, + kUnknownEnumValue = 4 class ACLouverPositionEnum(MatterIntEnum): kClosed = 0x01 @@ -32085,7 +32085,7 @@ class ACLouverPositionEnum(MatterIntEnum): # 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 = 0 class ACRefrigerantTypeEnum(MatterIntEnum): kUnknown = 0x00 @@ -32096,7 +32096,7 @@ class ACRefrigerantTypeEnum(MatterIntEnum): # 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 = 4, + kUnknownEnumValue = 4 class ACTypeEnum(MatterIntEnum): kUnknown = 0x00 @@ -32108,7 +32108,7 @@ class ACTypeEnum(MatterIntEnum): # 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 = 5, + kUnknownEnumValue = 5 class ControlSequenceOfOperationEnum(MatterIntEnum): kCoolingOnly = 0x00 @@ -32121,7 +32121,7 @@ class ControlSequenceOfOperationEnum(MatterIntEnum): # 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 = 6, + kUnknownEnumValue = 6 class PresetScenarioEnum(MatterIntEnum): kOccupied = 0x01 @@ -32135,7 +32135,7 @@ class PresetScenarioEnum(MatterIntEnum): # 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 = 0 class SetpointChangeSourceEnum(MatterIntEnum): kManual = 0x00 @@ -32145,7 +32145,7 @@ class SetpointChangeSourceEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class SetpointRaiseLowerModeEnum(MatterIntEnum): kHeat = 0x00 @@ -32155,7 +32155,7 @@ class SetpointRaiseLowerModeEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class StartOfWeekEnum(MatterIntEnum): kSunday = 0x00 @@ -32169,7 +32169,7 @@ class StartOfWeekEnum(MatterIntEnum): # 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 = 7, + kUnknownEnumValue = 7 class SystemModeEnum(MatterIntEnum): kOff = 0x00 @@ -32185,7 +32185,7 @@ class SystemModeEnum(MatterIntEnum): # 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 = 2 class TemperatureSetpointHoldEnum(MatterIntEnum): kSetpointHoldOff = 0x00 @@ -32194,7 +32194,7 @@ class TemperatureSetpointHoldEnum(MatterIntEnum): # 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 = 2 class ThermostatRunningModeEnum(MatterIntEnum): kOff = 0x00 @@ -32204,7 +32204,7 @@ class ThermostatRunningModeEnum(MatterIntEnum): # 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 = 1, + kUnknownEnumValue = 1 class Bitmaps: class ACErrorCodeBitmap(IntFlag): @@ -33665,7 +33665,7 @@ class AirflowDirectionEnum(MatterIntEnum): # 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 = 2 class FanModeEnum(MatterIntEnum): kOff = 0x00 @@ -33679,7 +33679,7 @@ class FanModeEnum(MatterIntEnum): # 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 = 7, + kUnknownEnumValue = 7 class FanModeSequenceEnum(MatterIntEnum): kOffLowMedHigh = 0x00 @@ -33692,7 +33692,7 @@ class FanModeSequenceEnum(MatterIntEnum): # 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 = 6, + kUnknownEnumValue = 6 class StepDirectionEnum(MatterIntEnum): kIncrease = 0x00 @@ -33701,7 +33701,7 @@ class StepDirectionEnum(MatterIntEnum): # 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 = 2 class Bitmaps: class Feature(IntFlag): @@ -34073,7 +34073,7 @@ class KeypadLockoutEnum(MatterIntEnum): # 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 = 6, + kUnknownEnumValue = 6 class ScheduleProgrammingVisibilityEnum(MatterIntEnum): kScheduleProgrammingPermitted = 0x00 @@ -34082,7 +34082,7 @@ class ScheduleProgrammingVisibilityEnum(MatterIntEnum): # 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 = 2 class TemperatureDisplayModeEnum(MatterIntEnum): kCelsius = 0x00 @@ -34091,7 +34091,7 @@ class TemperatureDisplayModeEnum(MatterIntEnum): # 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 = 2 class Attributes: @dataclass @@ -34375,7 +34375,7 @@ class ColorLoopActionEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class ColorLoopDirectionEnum(MatterIntEnum): kDecrement = 0x00 @@ -34384,7 +34384,7 @@ class ColorLoopDirectionEnum(MatterIntEnum): # 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 = 2 class ColorModeEnum(MatterIntEnum): kCurrentHueAndCurrentSaturation = 0x00 @@ -34394,7 +34394,7 @@ class ColorModeEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class DirectionEnum(MatterIntEnum): kShortest = 0x00 @@ -34405,7 +34405,7 @@ class DirectionEnum(MatterIntEnum): # 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 = 4, + kUnknownEnumValue = 4 class DriftCompensationEnum(MatterIntEnum): kNone = 0x00 @@ -34417,7 +34417,7 @@ class DriftCompensationEnum(MatterIntEnum): # 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 = 5, + kUnknownEnumValue = 5 class EnhancedColorModeEnum(MatterIntEnum): kCurrentHueAndCurrentSaturation = 0x00 @@ -34428,7 +34428,7 @@ class EnhancedColorModeEnum(MatterIntEnum): # 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 = 4, + kUnknownEnumValue = 4 class MoveModeEnum(MatterIntEnum): kStop = 0x00 @@ -34438,7 +34438,7 @@ class MoveModeEnum(MatterIntEnum): # 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 = 2 class StepModeEnum(MatterIntEnum): kUp = 0x01 @@ -34447,7 +34447,7 @@ class StepModeEnum(MatterIntEnum): # 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 = 0 class Bitmaps: class ColorCapabilitiesBitmap(IntFlag): @@ -36274,7 +36274,7 @@ class LightSensorTypeEnum(MatterIntEnum): # 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 = 2 class Attributes: @dataclass @@ -37381,7 +37381,7 @@ class OccupancySensorTypeEnum(MatterIntEnum): # 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 = 4, + kUnknownEnumValue = 4 class Bitmaps: class Feature(IntFlag): @@ -37816,7 +37816,7 @@ class LevelValueEnum(MatterIntEnum): # 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 = 5, + kUnknownEnumValue = 5 class MeasurementMediumEnum(MatterIntEnum): kAir = 0x00 @@ -37826,7 +37826,7 @@ class MeasurementMediumEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class MeasurementUnitEnum(MatterIntEnum): kPpm = 0x00 @@ -37841,7 +37841,7 @@ class MeasurementUnitEnum(MatterIntEnum): # 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 = 8, + kUnknownEnumValue = 8 class Bitmaps: class Feature(IntFlag): @@ -38182,7 +38182,7 @@ class LevelValueEnum(MatterIntEnum): # 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 = 5, + kUnknownEnumValue = 5 class MeasurementMediumEnum(MatterIntEnum): kAir = 0x00 @@ -38192,7 +38192,7 @@ class MeasurementMediumEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class MeasurementUnitEnum(MatterIntEnum): kPpm = 0x00 @@ -38207,7 +38207,7 @@ class MeasurementUnitEnum(MatterIntEnum): # 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 = 8, + kUnknownEnumValue = 8 class Bitmaps: class Feature(IntFlag): @@ -38548,7 +38548,7 @@ class LevelValueEnum(MatterIntEnum): # 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 = 5, + kUnknownEnumValue = 5 class MeasurementMediumEnum(MatterIntEnum): kAir = 0x00 @@ -38558,7 +38558,7 @@ class MeasurementMediumEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class MeasurementUnitEnum(MatterIntEnum): kPpm = 0x00 @@ -38573,7 +38573,7 @@ class MeasurementUnitEnum(MatterIntEnum): # 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 = 8, + kUnknownEnumValue = 8 class Bitmaps: class Feature(IntFlag): @@ -38914,7 +38914,7 @@ class LevelValueEnum(MatterIntEnum): # 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 = 5, + kUnknownEnumValue = 5 class MeasurementMediumEnum(MatterIntEnum): kAir = 0x00 @@ -38924,7 +38924,7 @@ class MeasurementMediumEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class MeasurementUnitEnum(MatterIntEnum): kPpm = 0x00 @@ -38939,7 +38939,7 @@ class MeasurementUnitEnum(MatterIntEnum): # 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 = 8, + kUnknownEnumValue = 8 class Bitmaps: class Feature(IntFlag): @@ -39280,7 +39280,7 @@ class LevelValueEnum(MatterIntEnum): # 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 = 5, + kUnknownEnumValue = 5 class MeasurementMediumEnum(MatterIntEnum): kAir = 0x00 @@ -39290,7 +39290,7 @@ class MeasurementMediumEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class MeasurementUnitEnum(MatterIntEnum): kPpm = 0x00 @@ -39305,7 +39305,7 @@ class MeasurementUnitEnum(MatterIntEnum): # 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 = 8, + kUnknownEnumValue = 8 class Bitmaps: class Feature(IntFlag): @@ -39646,7 +39646,7 @@ class LevelValueEnum(MatterIntEnum): # 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 = 5, + kUnknownEnumValue = 5 class MeasurementMediumEnum(MatterIntEnum): kAir = 0x00 @@ -39656,7 +39656,7 @@ class MeasurementMediumEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class MeasurementUnitEnum(MatterIntEnum): kPpm = 0x00 @@ -39671,7 +39671,7 @@ class MeasurementUnitEnum(MatterIntEnum): # 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 = 8, + kUnknownEnumValue = 8 class Bitmaps: class Feature(IntFlag): @@ -40012,7 +40012,7 @@ class LevelValueEnum(MatterIntEnum): # 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 = 5, + kUnknownEnumValue = 5 class MeasurementMediumEnum(MatterIntEnum): kAir = 0x00 @@ -40022,7 +40022,7 @@ class MeasurementMediumEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class MeasurementUnitEnum(MatterIntEnum): kPpm = 0x00 @@ -40037,7 +40037,7 @@ class MeasurementUnitEnum(MatterIntEnum): # 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 = 8, + kUnknownEnumValue = 8 class Bitmaps: class Feature(IntFlag): @@ -40378,7 +40378,7 @@ class LevelValueEnum(MatterIntEnum): # 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 = 5, + kUnknownEnumValue = 5 class MeasurementMediumEnum(MatterIntEnum): kAir = 0x00 @@ -40388,7 +40388,7 @@ class MeasurementMediumEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class MeasurementUnitEnum(MatterIntEnum): kPpm = 0x00 @@ -40403,7 +40403,7 @@ class MeasurementUnitEnum(MatterIntEnum): # 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 = 8, + kUnknownEnumValue = 8 class Bitmaps: class Feature(IntFlag): @@ -40744,7 +40744,7 @@ class LevelValueEnum(MatterIntEnum): # 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 = 5, + kUnknownEnumValue = 5 class MeasurementMediumEnum(MatterIntEnum): kAir = 0x00 @@ -40754,7 +40754,7 @@ class MeasurementMediumEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class MeasurementUnitEnum(MatterIntEnum): kPpm = 0x00 @@ -40769,7 +40769,7 @@ class MeasurementUnitEnum(MatterIntEnum): # 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 = 8, + kUnknownEnumValue = 8 class Bitmaps: class Feature(IntFlag): @@ -41110,7 +41110,7 @@ class LevelValueEnum(MatterIntEnum): # 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 = 5, + kUnknownEnumValue = 5 class MeasurementMediumEnum(MatterIntEnum): kAir = 0x00 @@ -41120,7 +41120,7 @@ class MeasurementMediumEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class MeasurementUnitEnum(MatterIntEnum): kPpm = 0x00 @@ -41135,7 +41135,7 @@ class MeasurementUnitEnum(MatterIntEnum): # 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 = 8, + kUnknownEnumValue = 8 class Bitmaps: class Feature(IntFlag): @@ -42379,7 +42379,7 @@ class ChannelTypeEnum(MatterIntEnum): # 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 = 4, + kUnknownEnumValue = 4 class LineupInfoTypeEnum(MatterIntEnum): kMso = 0x00 @@ -42387,7 +42387,7 @@ class LineupInfoTypeEnum(MatterIntEnum): # 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 = 1, + kUnknownEnumValue = 1 class StatusEnum(MatterIntEnum): kSuccess = 0x00 @@ -42397,7 +42397,7 @@ class StatusEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class Bitmaps: class Feature(IntFlag): @@ -42920,7 +42920,7 @@ class StatusEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class Structs: @dataclass @@ -43196,7 +43196,7 @@ class CharacteristicEnum(MatterIntEnum): # 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 = 18, + kUnknownEnumValue = 18 class PlaybackStateEnum(MatterIntEnum): kPlaying = 0x00 @@ -43207,7 +43207,7 @@ class PlaybackStateEnum(MatterIntEnum): # 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 = 4, + kUnknownEnumValue = 4 class StatusEnum(MatterIntEnum): kSuccess = 0x00 @@ -43220,7 +43220,7 @@ class StatusEnum(MatterIntEnum): # 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 = 6, + kUnknownEnumValue = 6 class Bitmaps: class Feature(IntFlag): @@ -43849,7 +43849,7 @@ class InputTypeEnum(MatterIntEnum): # 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 = 12, + kUnknownEnumValue = 12 class Bitmaps: class Feature(IntFlag): @@ -44314,7 +44314,7 @@ class CECKeyCodeEnum(MatterIntEnum): # 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 = 14, + kUnknownEnumValue = 14 class StatusEnum(MatterIntEnum): kSuccess = 0x00 @@ -44324,7 +44324,7 @@ class StatusEnum(MatterIntEnum): # 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, + kUnknownEnumValue = 3 class Bitmaps: class Feature(IntFlag): @@ -44514,7 +44514,7 @@ class CharacteristicEnum(MatterIntEnum): # 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 = 18, + kUnknownEnumValue = 18 class MetricTypeEnum(MatterIntEnum): kPixels = 0x00 @@ -44523,7 +44523,7 @@ class MetricTypeEnum(MatterIntEnum): # 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 = 2 class ParameterEnum(MatterIntEnum): kActor = 0x00 @@ -44547,7 +44547,7 @@ class ParameterEnum(MatterIntEnum): # 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 = 17, + kUnknownEnumValue = 17 class StatusEnum(MatterIntEnum): kSuccess = 0x00 @@ -44559,7 +44559,7 @@ class StatusEnum(MatterIntEnum): # 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 = 5, + kUnknownEnumValue = 5 class Bitmaps: class Feature(IntFlag): @@ -44926,7 +44926,7 @@ class OutputTypeEnum(MatterIntEnum): # 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 = 6, + kUnknownEnumValue = 6 class Bitmaps: class Feature(IntFlag): @@ -45152,7 +45152,7 @@ class StatusEnum(MatterIntEnum): # 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 = 6, + kUnknownEnumValue = 6 class Bitmaps: class Feature(IntFlag): @@ -45433,7 +45433,7 @@ class ApplicationStatusEnum(MatterIntEnum): # 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 = 4, + kUnknownEnumValue = 4 class Structs: @dataclass @@ -46398,7 +46398,7 @@ class StatusEnum(MatterIntEnum): # 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 = 2 class Commands: @dataclass @@ -46572,7 +46572,7 @@ class StreamTypeEnum(MatterIntEnum): # 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 = 4, + kUnknownEnumValue = 4 class WebRTCEndReasonEnum(MatterIntEnum): kIceFailed = 0x00 @@ -46591,7 +46591,7 @@ class WebRTCEndReasonEnum(MatterIntEnum): # 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 = 12, + kUnknownEnumValue = 12 class Bitmaps: class WebRTCMetadataOptions(IntFlag): @@ -46940,7 +46940,7 @@ class StreamTypeEnum(MatterIntEnum): # 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 = 4, + kUnknownEnumValue = 4 class WebRTCEndReasonEnum(MatterIntEnum): kIceFailed = 0x00 @@ -46959,7 +46959,7 @@ class WebRTCEndReasonEnum(MatterIntEnum): # 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 = 12, + kUnknownEnumValue = 12 class Bitmaps: class WebRTCMetadataOptions(IntFlag): @@ -48058,7 +48058,7 @@ class SimpleEnum(MatterIntEnum): # 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 = 4, + kUnknownEnumValue = 4 class Bitmaps: class Bitmap16MaskMap(IntFlag): @@ -50672,7 +50672,7 @@ class FaultType(MatterIntEnum): # 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 = 5, + kUnknownEnumValue = 5 class Commands: @dataclass diff --git a/src/controller/python/templates/partials/enum_def.zapt b/src/controller/python/templates/partials/enum_def.zapt index d8063739e1..01fbc62e6e 100644 --- a/src/controller/python/templates/partials/enum_def.zapt +++ b/src/controller/python/templates/partials/enum_def.zapt @@ -8,7 +8,7 @@ # 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 = {{first_unused_enum_value mode="first_unused"}}, + kUnknownEnumValue = {{first_unused_enum_value mode="first_unused"}} {{else}} # kUnknownEnumValue intentionally not defined. This enum never goes # through DataModel::Decode, likely because it is a part of a derived From af3727badd0fcdf9540d8e8b36eef2cfdf87f14b Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Wed, 9 Oct 2024 02:20:27 +0200 Subject: [PATCH 047/127] =?UTF-8?q?[Matter.framework]=20Prevent=20a=20leak?= =?UTF-8?q?=20when=20using=20the=20=5FsubscriptionPoolWor=E2=80=A6=20(#359?= =?UTF-8?q?78)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/darwin/Framework/CHIP/MTRDevice_Concrete.mm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm index 125ced558e..947e7a3967 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm +++ b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm @@ -757,7 +757,9 @@ - (void)_ensureSubscriptionForExistingDelegates:(NSString *)reason } if ([self _deviceUsesThread]) { MTR_LOG(" => %@ - device is a thread device, scheduling in pool", self); + mtr_weakify(self); [self _scheduleSubscriptionPoolWork:^{ + mtr_strongify(self); [self->_deviceController asyncDispatchToMatterQueue:^{ std::lock_guard lock(self->_lock); [self _setupSubscriptionWithReason:[NSString stringWithFormat:@"%@ and scheduled subscription is happening", reason]]; @@ -1165,10 +1167,13 @@ - (void)_scheduleSubscriptionPoolWork:(dispatch_block_t)workBlock inNanoseconds: return; } + mtr_weakify(self); dispatch_block_t workBlockToQueue = ^{ + mtr_strongify(self); // 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_strongify(self); MTR_LOG("%@ - work item is ready to attempt pooled subscription", self); os_unfair_lock_lock(&self->_lock); #ifdef DEBUG @@ -1246,7 +1251,9 @@ - (void)_handleResubscriptionNeededWithDelayOnDeviceQueue:(NSNumber *)resubscrip // 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. + mtr_weakify(self); auto resubscriptionBlock = ^{ + mtr_strongify(self); [self->_deviceController asyncDispatchToMatterQueue:^{ [self _triggerResubscribeWithReason:@"ResubscriptionNeeded timer fired" nodeLikelyReachable:NO]; } errorHandler:^(NSError * _Nonnull error) { @@ -1357,7 +1364,9 @@ - (void)_doHandleSubscriptionReset:(NSNumber * _Nullable)retryDelay // Call _reattemptSubscriptionNowIfNeededWithReason when timer fires - if subscription is // in a better state at that time this will be a no-op. + mtr_weakify(self); auto resubscriptionBlock = ^{ + mtr_strongify(self); [self->_deviceController asyncDispatchToMatterQueue:^{ std::lock_guard lock(self->_lock); [self _reattemptSubscriptionNowIfNeededWithReason:@"got subscription reset"]; From a6292046cb9129ad2085cdd7860ff7ab66dbce32 Mon Sep 17 00:00:00 2001 From: Justin Wood Date: Tue, 8 Oct 2024 20:05:24 -0700 Subject: [PATCH 048/127] Fixing deadlock, and not cleaning up on purpose now (#35982) * Fixing deadlock, and not cleaning up on purpose now * Adding this log back * Restyled by clang-format --------- Co-authored-by: Restyled.io --- .../Framework/CHIP/MTRDeviceControllerFactory.mm | 11 +++-------- src/darwin/Framework/CHIP/MTRDevice_XPC.mm | 6 ++++-- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm index 23643d6a52..815d7ae2a9 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm @@ -73,12 +73,7 @@ static bool sExitHandlerRegistered = false; static void ShutdownOnExit() { - // Depending on the structure of the software, this code might execute *after* the main autorelease pool has exited. - // Therefore, it needs to be enclosed in its own autorelease pool. - @autoreleasepool { - MTR_LOG("ShutdownOnExit invoked on exit"); - [[MTRDeviceControllerFactory sharedInstance] stopControllerFactory]; - } + // Don't do anything here, period } @interface MTRDeviceControllerFactoryParams () @@ -441,8 +436,8 @@ - (void)stopControllerFactory { [self _assertCurrentQueueIsNotMatterQueue]; - while ([_controllers count] != 0) { - [_controllers[0] shutdown]; + for (MTRDeviceController * controller in [_controllers copy]) { + [controller shutdown]; } dispatch_sync(_chipWorkQueue, ^{ diff --git a/src/darwin/Framework/CHIP/MTRDevice_XPC.mm b/src/darwin/Framework/CHIP/MTRDevice_XPC.mm index 5165e3ad26..61aad70035 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_XPC.mm +++ b/src/darwin/Framework/CHIP/MTRDevice_XPC.mm @@ -250,7 +250,8 @@ - (void)_invokeCommandWithEndpointID:(NSNumber *)endpointID @try { [[xpcConnection remoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) { - MTR_LOG_ERROR("Error: %@", error); + MTR_LOG_ERROR("Invoke error: %@", error); + completion(nil, [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeGeneralError userInfo:nil]); }] deviceController:[[self deviceController] uniqueIdentifier] nodeID:[self nodeID] invokeCommandWithEndpointID:endpointID @@ -263,7 +264,8 @@ - (void)_invokeCommandWithEndpointID:(NSNumber *)endpointID serverSideProcessingTimeout:serverSideProcessingTimeout completion:completion]; } @catch (NSException * exception) { - MTR_LOG_ERROR("Exception sending XPC messsage: %@", exception); + MTR_LOG_ERROR("Exception sending XPC message: %@", exception); + completion(nil, [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeGeneralError userInfo:nil]); } } From e02f0f280bb46493acf3fb92f99c084f743f22c5 Mon Sep 17 00:00:00 2001 From: Junior Martinez <67972863+jmartinez-silabs@users.noreply.github.com> Date: Wed, 9 Oct 2024 08:39:44 -0400 Subject: [PATCH 049/127] [Silabs]Migrate some more freertos api to cmsisos (#35974) * Migrate some more freertos api to cmsisos * Address comments --- examples/platform/silabs/BaseApplication.cpp | 2 +- .../platform/silabs/SoftwareFaultReports.cpp | 4 +-- .../silabs/DiagnosticDataProviderImpl.cpp | 30 +++++++----------- src/test_driver/efr32/src/main.cpp | 31 ++++++++++--------- 4 files changed, 32 insertions(+), 35 deletions(-) diff --git a/examples/platform/silabs/BaseApplication.cpp b/examples/platform/silabs/BaseApplication.cpp index 37efb09fe5..b7ce3e9fed 100644 --- a/examples/platform/silabs/BaseApplication.cpp +++ b/examples/platform/silabs/BaseApplication.cpp @@ -259,7 +259,7 @@ CHIP_ERROR BaseApplication::Init() ChipLogProgress(AppServer, "APP: Wait WiFi Init"); while (!wfx_hw_ready()) { - vTaskDelay(pdMS_TO_TICKS(10)); + osDelay(pdMS_TO_TICKS(10)); } ChipLogProgress(AppServer, "APP: Done WiFi Init"); /* We will init server when we get IP */ diff --git a/examples/platform/silabs/SoftwareFaultReports.cpp b/examples/platform/silabs/SoftwareFaultReports.cpp index 8245b1bf45..37cbae1703 100644 --- a/examples/platform/silabs/SoftwareFaultReports.cpp +++ b/examples/platform/silabs/SoftwareFaultReports.cpp @@ -17,10 +17,10 @@ */ #include "SoftwareFaultReports.h" -#include "FreeRTOS.h" #include "silabs_utils.h" #include #include +#include #include #include #include @@ -75,7 +75,7 @@ void OnSoftwareFaultEventHandler(const char * faultRecordString) // Allow some time for the Fault event to be sent as the next action after exiting this function // is typically an assert or reboot. // Depending on the task at fault, it is possible the event can't be transmitted. - vTaskDelay(pdMS_TO_TICKS(1000)); + osDelay(pdMS_TO_TICKS(1000)); #endif // MATTER_DM_PLUGIN_SOFTWARE_DIAGNOSTICS_SERVER } diff --git a/src/platform/silabs/DiagnosticDataProviderImpl.cpp b/src/platform/silabs/DiagnosticDataProviderImpl.cpp index 4be7113bb6..0cb4c85d3d 100644 --- a/src/platform/silabs/DiagnosticDataProviderImpl.cpp +++ b/src/platform/silabs/DiagnosticDataProviderImpl.cpp @@ -28,10 +28,11 @@ #if CHIP_DEVICE_CONFIG_ENABLE_THREAD #include #endif -#include "FreeRTOS.h" #include "sl_memory_manager.h" +#include #include #include +#include using namespace ::chip::app::Clusters::GeneralDiagnostics; @@ -82,31 +83,24 @@ CHIP_ERROR DiagnosticDataProviderImpl::ResetWatermarks() CHIP_ERROR DiagnosticDataProviderImpl::GetThreadMetrics(ThreadMetrics ** threadMetricsOut) { - /* Obtain all available task information */ - TaskStatus_t * taskStatusArray; ThreadMetrics * head = nullptr; - uint32_t arraySize, x, dummy; - arraySize = uxTaskGetNumberOfTasks(); + uint32_t threadCount = osThreadGetCount(); + osThreadId_t * threadIdTable = static_cast(chip::Platform::MemoryCalloc(threadCount, sizeof(osThreadId_t))); - taskStatusArray = static_cast(chip::Platform::MemoryCalloc(arraySize, sizeof(TaskStatus_t))); - - if (taskStatusArray != NULL) + if (threadIdTable != nullptr) { - /* Generate raw status information about each task. */ - arraySize = uxTaskGetSystemState(taskStatusArray, arraySize, &dummy); - /* For each populated position in the taskStatusArray array, - format the raw data as human readable ASCII data. */ - - for (x = 0; x < arraySize; x++) + osThreadEnumerate(threadIdTable, threadCount); + for (uint8_t tIdIndex = 0; tIdIndex < threadCount; tIdIndex++) { + osThreadId_t tId = threadIdTable[tIdIndex]; ThreadMetrics * thread = new ThreadMetrics(); if (thread) { - Platform::CopyString(thread->NameBuf, taskStatusArray[x].pcTaskName); + thread->id = tIdIndex; + thread->stackFreeMinimum.Emplace(osThreadGetStackSpace(tId)); + Platform::CopyString(thread->NameBuf, osThreadGetName(tId)); thread->name.Emplace(CharSpan::fromCharString(thread->NameBuf)); - thread->id = taskStatusArray[x].xTaskNumber; - thread->stackFreeMinimum.Emplace(taskStatusArray[x].usStackHighWaterMark); /* Unsupported metrics */ // thread->stackSize @@ -119,7 +113,7 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetThreadMetrics(ThreadMetrics ** threadM *threadMetricsOut = head; /* The array is no longer needed, free the memory it consumes. */ - chip::Platform::MemoryFree(taskStatusArray); + chip::Platform::MemoryFree(threadIdTable); } return CHIP_NO_ERROR; diff --git a/src/test_driver/efr32/src/main.cpp b/src/test_driver/efr32/src/main.cpp index 088dc4e870..a2a078c469 100644 --- a/src/test_driver/efr32/src/main.cpp +++ b/src/test_driver/efr32/src/main.cpp @@ -19,10 +19,10 @@ #include #include -#include #include #include #include +#include #include #include #include @@ -34,9 +34,9 @@ #include #include #include +#include #include #include -#include using namespace chip; using namespace chip::DeviceLayer; @@ -66,13 +66,17 @@ class NlTest : public pw_rpc::nanopb::NlTest::Service } // namespace chip::rpc namespace { - -#define TEST_TASK_STACK_SIZE 16 * 1024 -#define TEST_TASK_PRIORITY 1 - -static TaskHandle_t sTestTaskHandle; -StaticTask_t sTestTaskBuffer; -StackType_t sTestTaskStack[TEST_TASK_STACK_SIZE]; +osThreadId_t sTestTaskHandle; +osThread_t testTaskControlBlock; +constexpr uint32_t kTestTaskStackSize = 16 * 1024; +uint8_t testTaskStack[kTestTaskStackSize]; +constexpr osThreadAttr_t kTestTaskAttr = { .name = "TestDriver", + .attr_bits = osThreadDetached, + .cb_mem = &testTaskControlBlock, + .cb_size = osThreadCbSize, + .stack_mem = testTaskStack, + .stack_size = kTestTaskStackSize, + .priority = osPriorityNormal }; chip::rpc::NlTest nl_test_service; pw::unit_test::UnitTestService unit_test_service; @@ -105,15 +109,14 @@ int main(void) SetDeviceInstanceInfoProvider(&provision.GetStorage()); SetCommissionableDataProvider(&provision.GetStorage()); - SILABS_LOG("***** CHIP EFR32 device tests *****\r\n"); + ChipLogProgress(AppServer, "***** CHIP EFR32 device tests *****\r\n"); // Start RPC service which runs the tests. - sTestTaskHandle = xTaskCreateStatic(RunRpcService, "RPC_TEST_TASK", ArraySize(sTestTaskStack), nullptr, TEST_TASK_PRIORITY, - sTestTaskStack, &sTestTaskBuffer); - SILABS_LOG("Starting FreeRTOS scheduler"); + sTestTaskHandle = osThreadNew(RunRpcService, nullptr, &kTestTaskAttr); + ChipLogProgress(AppServer, "Starting Kernel"); sl_system_kernel_start(); // Should never get here. - SILABS_LOG("vTaskStartScheduler() failed"); + ChipLogProgress(AppServer, "sl_system_kernel_start() failed"); return -1; } From 5224cec13d97a8746a8d1a9da70bc16a859d8ee7 Mon Sep 17 00:00:00 2001 From: mkardous-silabs <84793247+mkardous-silabs@users.noreply.github.com> Date: Wed, 9 Oct 2024 08:44:38 -0400 Subject: [PATCH 050/127] [Silabs] Refactor Sensor code (#35979) * Refactor Sensor and LCD code * Address review comments --- examples/platform/silabs/Si70xxSensor.cpp | 67 +++++++++++++++++++ examples/platform/silabs/Si70xxSensor.h | 48 +++++++++++++ examples/platform/silabs/SiWx917/BUILD.gn | 7 ++ .../platform/silabs/TemperatureSensor.cpp | 62 ----------------- examples/platform/silabs/TemperatureSensor.h | 28 -------- examples/platform/silabs/display/demo-ui.c | 1 - examples/platform/silabs/display/lcd.h | 3 +- examples/platform/silabs/efr32/BUILD.gn | 7 ++ examples/thermostat/silabs/BUILD.gn | 28 -------- .../thermostat/silabs/src/SensorManager.cpp | 42 ++++++------ third_party/silabs/efr32_sdk.gni | 27 ++++++++ third_party/silabs/matter_support | 2 +- third_party/silabs/silabs_board.gni | 15 +++++ 13 files changed, 196 insertions(+), 141 deletions(-) create mode 100644 examples/platform/silabs/Si70xxSensor.cpp create mode 100644 examples/platform/silabs/Si70xxSensor.h delete mode 100644 examples/platform/silabs/TemperatureSensor.cpp delete mode 100644 examples/platform/silabs/TemperatureSensor.h diff --git a/examples/platform/silabs/Si70xxSensor.cpp b/examples/platform/silabs/Si70xxSensor.cpp new file mode 100644 index 0000000000..0b03ca040f --- /dev/null +++ b/examples/platform/silabs/Si70xxSensor.cpp @@ -0,0 +1,67 @@ +/* + * + * 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 "sl_board_control.h" +#include "sl_i2cspm_instances.h" +#include "sl_si70xx.h" +#include +#include + +namespace { + +constexpr uint16_t kSensorTemperatureOffset = 475; +bool initialized = false; + +} // namespace + +namespace Si70xxSensor { + +sl_status_t Init() +{ + sl_status_t status = SL_STATUS_OK; + + status = sl_board_enable_sensor(SL_BOARD_SENSOR_RHT); + VerifyOrReturnError(status == SL_STATUS_OK, status); + + status = sl_si70xx_init(sl_i2cspm_sensor, SI7021_ADDR); + VerifyOrReturnError(status == SL_STATUS_OK, status); + + initialized = true; + return status; +} + +sl_status_t GetSensorData(uint16_t & relativeHumidity, int16_t & temperature) +{ + VerifyOrReturnError(initialized, SL_STATUS_NOT_INITIALIZED); + + sl_status_t status = SL_STATUS_OK; + int32_t tempTemperature = 0; + uint32_t tempHumidity = 0; + + status = sl_si70xx_measure_rh_and_temp(sl_i2cspm_sensor, SI7021_ADDR, &tempHumidity, &tempTemperature); + VerifyOrReturnError(status == SL_STATUS_OK, status); + + // Sensor precision is milliX. We need to reduce to change the precision to centiX to fit with the cluster attributes presicion. + temperature = static_cast(tempTemperature / 10) - kSensorTemperatureOffset; + relativeHumidity = static_cast(tempHumidity / 10); + + return status; +} + +}; // namespace Si70xxSensor diff --git a/examples/platform/silabs/Si70xxSensor.h b/examples/platform/silabs/Si70xxSensor.h new file mode 100644 index 0000000000..8dc31a8daf --- /dev/null +++ b/examples/platform/silabs/Si70xxSensor.h @@ -0,0 +1,48 @@ +/* + * + * 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 "sl_status.h" +#include + +namespace Si70xxSensor { + +/** + * @brief Initialises the Si70xx Sensor. + * + * @return sl_status_t SL_STATUS_OK if there were no errors occured during initialisation. + * Error if an underlying platform error occured + */ +sl_status_t Init(); + +/** + * @brief Reads Humidity and temperature values from the Si70xx sensor. + * The init function must be called before calling the GetSensorData. + * + * @param[out] relativeHumidity Relative humidity percentage in centi-pourcentage (1000 == 10.00%) + * @param[out] temperature Ambiant temperature in centi-celsium (1000 == 10.00C) + * + * @return sl_status_t SL_STATUS_OK if there were no errors occured during initialisation. + * SL_STATUS_NOT_INITIALIZED if the sensor was not initialised + * Error if an underlying platform error occured + */ +sl_status_t GetSensorData(uint16_t & relativeHumidity, int16_t & temperature); + +}; // namespace Si70xxSensor diff --git a/examples/platform/silabs/SiWx917/BUILD.gn b/examples/platform/silabs/SiWx917/BUILD.gn index 156fb38e49..cf7b7aedbf 100644 --- a/examples/platform/silabs/SiWx917/BUILD.gn +++ b/examples/platform/silabs/SiWx917/BUILD.gn @@ -252,6 +252,13 @@ source_set("siwx917-common") { public_deps += [ ":test-event-trigger" ] } + if (sl_enable_si70xx_sensor) { + sources += [ + "${silabs_common_plat_dir}/Si70xxSensor.cpp", + "${silabs_common_plat_dir}/Si70xxSensor.h", + ] + } + if (app_data_model != "") { public_deps += [ app_data_model ] } diff --git a/examples/platform/silabs/TemperatureSensor.cpp b/examples/platform/silabs/TemperatureSensor.cpp deleted file mode 100644 index d7e13e1993..0000000000 --- a/examples/platform/silabs/TemperatureSensor.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/* - * - * 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 "TemperatureSensor.h" - -#include "sl_board_control.h" -#include "sl_i2cspm_instances.h" -#include "sl_si70xx.h" - -namespace TemperatureSensor { -constexpr uint16_t kSensorTemperatureOffset = 800; -static bool initialized = false; - -sl_status_t Init() -{ - sl_status_t status; - sl_i2cspm_t * rht_sensor = sl_i2cspm_sensor; - (void) sl_board_enable_sensor(SL_BOARD_SENSOR_RHT); - - status = sl_si70xx_init(rht_sensor, SI7021_ADDR); - initialized = (SL_STATUS_OK == status); - return status; -} - -sl_status_t GetTemp(uint32_t * relativeHumidity, int16_t * temperature) -{ - if (!initialized) - { - return SL_STATUS_NOT_INITIALIZED; - } - - // Sensor resolution 0.001 C - // DataModel resolution 0.01 C - sl_status_t status; - sl_i2cspm_t * rht_sensor = sl_i2cspm_sensor; - int32_t temp = 0; - status = sl_si70xx_measure_rh_and_temp(rht_sensor, SI7021_ADDR, relativeHumidity, &temp); - - if (temperature != nullptr) - { - *temperature = static_cast(temp / 10) - kSensorTemperatureOffset; - } - - return status; -} -}; // namespace TemperatureSensor diff --git a/examples/platform/silabs/TemperatureSensor.h b/examples/platform/silabs/TemperatureSensor.h deleted file mode 100644 index 116287e9a3..0000000000 --- a/examples/platform/silabs/TemperatureSensor.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * - * 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 "sl_status.h" -#include - -namespace TemperatureSensor { -sl_status_t Init(); -sl_status_t GetTemp(uint32_t * relativeHumidity, int16_t * temperature); -}; // namespace TemperatureSensor diff --git a/examples/platform/silabs/display/demo-ui.c b/examples/platform/silabs/display/demo-ui.c index e0fe37ec9c..d909cb1f88 100644 --- a/examples/platform/silabs/display/demo-ui.c +++ b/examples/platform/silabs/display/demo-ui.c @@ -167,6 +167,5 @@ void demoUIClearMainScreen(uint8_t * name) { GLIB_clear(&glibContext); demoUIDisplayHeader((char *) name); - demoUIDisplayApp(false); demoUIDisplayProtocols(); } diff --git a/examples/platform/silabs/display/lcd.h b/examples/platform/silabs/display/lcd.h index b62664c9b4..61fa816743 100644 --- a/examples/platform/silabs/display/lcd.h +++ b/examples/platform/silabs/display/lcd.h @@ -65,6 +65,7 @@ class SilabsLCD int DrawPixel(void * pContext, int32_t x, int32_t y); int Update(void); void WriteDemoUI(bool state); + void WriteDemoUI(); void SetCustomUI(customUICB cb); void GetScreen(Screen_e & screen); @@ -85,8 +86,6 @@ class SilabsLCD bool protocol1 = false; /* data */ } DemoState_t; - void WriteDemoUI(); - #ifdef QR_CODE_ENABLED void WriteQRCode(); void LCDFillRect(uint8_t x, uint8_t y, uint8_t w, uint8_t h); diff --git a/examples/platform/silabs/efr32/BUILD.gn b/examples/platform/silabs/efr32/BUILD.gn index 91cd2c1a0a..f5c79a2252 100644 --- a/examples/platform/silabs/efr32/BUILD.gn +++ b/examples/platform/silabs/efr32/BUILD.gn @@ -308,6 +308,13 @@ source_set("efr32-common") { public_deps += [ ":test-event-trigger" ] } + if (sl_enable_si70xx_sensor) { + sources += [ + "${silabs_common_plat_dir}/Si70xxSensor.cpp", + "${silabs_common_plat_dir}/Si70xxSensor.h", + ] + } + if (app_data_model != "") { public_deps += [ app_data_model ] } diff --git a/examples/thermostat/silabs/BUILD.gn b/examples/thermostat/silabs/BUILD.gn index 75b2f75c15..f51ee14825 100644 --- a/examples/thermostat/silabs/BUILD.gn +++ b/examples/thermostat/silabs/BUILD.gn @@ -47,10 +47,6 @@ import("${examples_common_plat_dir}/args.gni") declare_args() { # Dump memory usage at link time. chip_print_memory_usage = false - - # Enable the temperature sensor - # Some boards do not have a temperature sensor - use_temp_sensor = false } if (wifi_soc) { @@ -112,19 +108,6 @@ if (wifi_soc) { "PW_RPC_ENABLED", ] } - - if (use_temp_sensor) { - include_dirs += [ - "${efr32_sdk_root}/platform/driver/i2cspm/inc", - "${efr32_sdk_root}/app/bluetooth/common/sensor_rht", - "${efr32_sdk_root}/app/bluetooth/common/sensor_rht/config", - "${efr32_sdk_root}/hardware/driver/si70xx/inc", - "${efr32_sdk_root}/app/bluetooth/common/sensor_select", - "${efr32_sdk_root}/platform/common/config", - ] - - defines += [ "USE_TEMP_SENSOR" ] - } } } @@ -141,17 +124,6 @@ silabs_executable("thermostat_app") { "src/ZclCallbacks.cpp", ] - if (use_temp_sensor) { - sources += [ - "${efr32_sdk_root}/hardware/driver/si70xx/src/sl_si70xx.c", - "${efr32_sdk_root}/platform/common/src/sl_status.c", - "${efr32_sdk_root}/platform/driver/i2cspm/src/sl_i2cspm.c", - "${efr32_sdk_root}/platform/emlib/src/em_i2c.c", - "${examples_common_plat_dir}/TemperatureSensor.cpp", - "${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}/autogen/sl_i2cspm_init.c", - ] - } - if (!disable_lcd) { sources += [ "src/ThermostatUI.cpp" ] } diff --git a/examples/thermostat/silabs/src/SensorManager.cpp b/examples/thermostat/silabs/src/SensorManager.cpp index abecd899d5..3522e9f5a3 100644 --- a/examples/thermostat/silabs/src/SensorManager.cpp +++ b/examples/thermostat/silabs/src/SensorManager.cpp @@ -26,14 +26,15 @@ #include "AppEvent.h" #include "AppTask.h" -#ifdef USE_TEMP_SENSOR -#include "TemperatureSensor.h" -#endif +#if defined(SL_MATTER_USE_SI70XX_SENSOR) && SL_MATTER_USE_SI70XX_SENSOR +#include "Si70xxSensor.h" +#endif // defined(SL_MATTER_USE_SI70XX_SENSOR) && SL_MATTER_USE_SI70XX_SENSOR /********************************************************** * Defines and Constants *********************************************************/ using namespace chip; +using namespace chip::app; using namespace ::chip::DeviceLayer; constexpr EndpointId kThermostatEndpoint = 1; @@ -45,10 +46,10 @@ constexpr uint16_t kMinTemperatureDelta = 50; // 0.5 degree Celcius *********************************************************/ SensorManager SensorManager::sSensorManager; -#ifndef USE_TEMP_SENSOR +#if !(defined(SL_MATTER_USE_SI70XX_SENSOR) && (SL_MATTER_USE_SI70XX_SENSOR)) constexpr uint16_t kSimulatedReadingFrequency = (60000 / kSensorTImerPeriodMs); // Change Simulated number at each minutes static int16_t mSimulatedTemp[] = { 2300, 2400, 2800, 2550, 2200, 2125, 2100, 2600, 1800, 2700 }; -#endif +#endif // !(defined(SL_MATTER_USE_SI70XX_SENSOR) && (SL_MATTER_USE_SI70XX_SENSOR)) CHIP_ERROR SensorManager::Init() { @@ -61,13 +62,13 @@ CHIP_ERROR SensorManager::Init() return APP_ERROR_CREATE_TIMER_FAILED; } -#ifdef USE_TEMP_SENSOR - if (SL_STATUS_OK != TemperatureSensor::Init()) +#if defined(SL_MATTER_USE_SI70XX_SENSOR) && SL_MATTER_USE_SI70XX_SENSOR + if (SL_STATUS_OK != Si70xxSensor::Init()) { SILABS_LOG("Failed to Init Sensor"); return CHIP_ERROR_INTERNAL; } -#endif +#endif // defined(SL_MATTER_USE_SI70XX_SENSOR) && SL_MATTER_USE_SI70XX_SENSOR // Update Temp immediatly at bootup SensorTimerEventHandler(nullptr); @@ -81,19 +82,20 @@ void SensorManager::SensorTimerEventHandler(void * arg) int16_t temperature = 0; static int16_t lastTemperature = 0; -#ifdef USE_TEMP_SENSOR +#if defined(SL_MATTER_USE_SI70XX_SENSOR) && SL_MATTER_USE_SI70XX_SENSOR int32_t tempSum = 0; - uint32_t humidity = 0; + uint16_t humidity = 0; for (uint8_t i = 0; i < 100; i++) { - if (SL_STATUS_OK != TemperatureSensor::GetTemp(&humidity, &temperature)) + if (SL_STATUS_OK != Si70xxSensor::GetSensorData(humidity, temperature)) { SILABS_LOG("Failed to read Temperature !!!"); } tempSum += temperature; } temperature = static_cast(tempSum / 100); + #else static uint8_t nbOfRepetition = 0; static uint8_t simulatedIndex = 0; @@ -109,18 +111,20 @@ void SensorManager::SensorTimerEventHandler(void * arg) simulatedIndex++; nbOfRepetition = 0; } -#endif // USE_TEMP_SENSOR +#endif // defined(SL_MATTER_USE_SI70XX_SENSOR) && SL_MATTER_USE_SI70XX_SENSOR SILABS_LOG("Sensor Temp is : %d", temperature); + MarkAttributeDirty reportState = MarkAttributeDirty::kNo; if ((temperature >= (lastTemperature + kMinTemperatureDelta)) || temperature <= (lastTemperature - kMinTemperatureDelta)) { - lastTemperature = temperature; - PlatformMgr().LockChipStack(); - // The SensorMagager shouldn't be aware of the Endpoint ID TODO Fix this. - // TODO Per Spec we should also apply the Offset stored in the same cluster before saving the temp - - app::Clusters::Thermostat::Attributes::LocalTemperature::Set(kThermostatEndpoint, temperature); - PlatformMgr().UnlockChipStack(); + reportState = MarkAttributeDirty::kIfChanged; } + + lastTemperature = temperature; + PlatformMgr().LockChipStack(); + // The SensorMagager shouldn't be aware of the Endpoint ID TODO Fix this. + // TODO Per Spec we should also apply the Offset stored in the same cluster before saving the temp + app::Clusters::Thermostat::Attributes::LocalTemperature::Set(kThermostatEndpoint, temperature, reportState); + PlatformMgr().UnlockChipStack(); } diff --git a/third_party/silabs/efr32_sdk.gni b/third_party/silabs/efr32_sdk.gni index 470c812505..146077372f 100644 --- a/third_party/silabs/efr32_sdk.gni +++ b/third_party/silabs/efr32_sdk.gni @@ -415,6 +415,17 @@ template("efr32_sdk") { _include_dirs += [ "${chip_root}/third_party/silabs/mqtt/stack" ] } + if (sl_enable_si70xx_sensor) { + _include_dirs += [ + "${efr32_sdk_root}/platform/driver/i2cspm/inc", + "${efr32_sdk_root}/app/bluetooth/common/sensor_rht", + "${efr32_sdk_root}/app/bluetooth/common/sensor_rht/config", + "${efr32_sdk_root}/hardware/driver/si70xx/inc", + "${efr32_sdk_root}/app/bluetooth/common/sensor_select", + "${efr32_sdk_root}/platform/common/config", + ] + } + # Note that we're setting the mbedTLS and PSA configuration files through a # define. This means the build system by default does not pick up changes in # the content of these, only when changing the filename itself. @@ -672,6 +683,12 @@ template("efr32_sdk") { defines += [ "CHIP_CONFIG_SYNCHRONOUS_REPORTS_ENABLED=1" ] } + if (sl_enable_si70xx_sensor) { + defines += [ "SL_MATTER_USE_SI70XX_SENSOR=1" ] + } else { + defines += [ "SL_MATTER_USE_SI70XX_SENSOR=0" ] + } + cflags = [] foreach(include_dir, _include_dirs) { cflags += [ "-isystem" + rebase_path(include_dir, root_build_dir) ] @@ -1068,6 +1085,16 @@ template("efr32_sdk") { ] } + if (sl_enable_si70xx_sensor) { + sources += [ + "${efr32_sdk_root}/hardware/driver/si70xx/src/sl_si70xx.c", + "${efr32_sdk_root}/platform/common/src/sl_status.c", + "${efr32_sdk_root}/platform/driver/i2cspm/src/sl_i2cspm.c", + "${efr32_sdk_root}/platform/emlib/src/em_i2c.c", + "${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}/autogen/sl_i2cspm_init.c", + ] + } + public_deps = [ ":efr32_mbedtls_config", "${segger_rtt_root}:segger_rtt", diff --git a/third_party/silabs/matter_support b/third_party/silabs/matter_support index c3e993cea4..841d43db7e 160000 --- a/third_party/silabs/matter_support +++ b/third_party/silabs/matter_support @@ -1 +1 @@ -Subproject commit c3e993cea4aad32adc178fe487afb66822f0b42d +Subproject commit 841d43db7e86877636cd73b5244da4c34d38d544 diff --git a/third_party/silabs/silabs_board.gni b/third_party/silabs/silabs_board.gni index 213417976d..03b2ea7cb6 100644 --- a/third_party/silabs/silabs_board.gni +++ b/third_party/silabs/silabs_board.gni @@ -53,6 +53,9 @@ declare_args() { # Self-provision enabled use_provision_channel = false + + # Temperature Sensor support + sl_enable_si70xx_sensor = false } declare_args() { @@ -75,6 +78,9 @@ if (silabs_board == "BRD4338A" || silabs_board == "BRD2605A") { silabs_mcu = "SiWG917M111MGTBA" wifi_soc = true + assert(!sl_enable_si70xx_sensor, + "${silabs_board} does not support the si90xx sensor!") + # EFR32 MG24 series ---------- } else if (silabs_board == "BRD4186A" || silabs_board == "BRD4187A") { variant = string_replace(silabs_board, "A", "C") @@ -104,6 +110,9 @@ if (silabs_board == "BRD4338A" || silabs_board == "BRD2605A") { show_qr_code = false disable_lcd = true + assert(!sl_enable_si70xx_sensor, + "${silabs_board} does not support the si90xx sensor!") + # EFR32 MG24 Modules series ---------- } else if (silabs_board == "BRD4316A") { silabs_family = "mgm24" @@ -128,6 +137,9 @@ if (silabs_board == "BRD4338A" || silabs_board == "BRD2605A") { use_external_flash = false show_qr_code = false disable_lcd = true + + assert(!sl_enable_si70xx_sensor, + "${silabs_board} does not support the si90xx sensor!") } else if (silabs_board == "BRD2704A") { silabs_family = "mgm24" silabs_mcu = "MGM240PB32VNA" @@ -137,6 +149,9 @@ if (silabs_board == "BRD4338A" || silabs_board == "BRD2605A") { use_external_flash = false show_qr_code = false disable_lcd = true + + assert(!sl_enable_si70xx_sensor, + "${silabs_board} does not support the si90xx sensor!") } else if (silabs_board == "BRD4318A") { silabs_family = "mgm24" silabs_mcu = "MGM240SD22VNA" From 6621548327a42939f4f1ea04fb2ddd3809902d0f Mon Sep 17 00:00:00 2001 From: C Freeman Date: Wed, 9 Oct 2024 09:50:31 -0400 Subject: [PATCH 051/127] TC-VALCC-4.2: unconditionally write open duration (#35852) * TC-VALCC-4.2: unconditionally write open duration This way we can ensure the open duration is writeable. Also add a cleanup step. * linter * Update src/python_testing/TC_VALCC_4_2.py Co-authored-by: fesseha-eve <88329315+fessehaeve@users.noreply.github.com> * Update src/python_testing/TC_VALCC_4_2.py Co-authored-by: fesseha-eve <88329315+fessehaeve@users.noreply.github.com> --------- Co-authored-by: Andrei Litvin Co-authored-by: fesseha-eve <88329315+fessehaeve@users.noreply.github.com> --- src/python_testing/TC_VALCC_4_2.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/python_testing/TC_VALCC_4_2.py b/src/python_testing/TC_VALCC_4_2.py index 7e331f5f0f..1114f034ca 100644 --- a/src/python_testing/TC_VALCC_4_2.py +++ b/src/python_testing/TC_VALCC_4_2.py @@ -24,7 +24,6 @@ # test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto # === END CI TEST ARGUMENTS === -import logging import time import chip.clusters as Clusters @@ -55,6 +54,7 @@ def steps_TC_VALCC_4_2(self) -> list[TestStep]: TestStep(8, "Send Close command"), TestStep(9, "Read OpenDuration attribute"), TestStep(10, "Read RemainingDuration attribute"), + TestStep(11, "Write DefaultOpenDuration back to original value") ] return steps @@ -73,16 +73,11 @@ async def test_TC_VALCC_4_2(self): attributes = Clusters.ValveConfigurationAndControl.Attributes self.step("2a") - defaultOpenDuration = await self.read_valcc_attribute_expect_success(endpoint=endpoint, attribute=attributes.DefaultOpenDuration) + originalDefaultOpenDuration = await self.read_valcc_attribute_expect_success(endpoint=endpoint, attribute=attributes.DefaultOpenDuration) self.step("2b") - if defaultOpenDuration is NullValue: - defaultOpenDuration = 60 - - result = await self.default_controller.WriteAttribute(self.dut_node_id, [(endpoint, attributes.DefaultOpenDuration(defaultOpenDuration))]) - asserts.assert_equal(result[0].Status, Status.Success, "DefaultOpenDuration write failed") - else: - logging.info("Test step skipped") + defaultOpenDuration = 60 + await self.write_single_attribute(attributes.DefaultOpenDuration(defaultOpenDuration), endpoint_id=endpoint) self.step(3) try: @@ -129,6 +124,9 @@ async def test_TC_VALCC_4_2(self): remaining_duration_dut = await self.read_valcc_attribute_expect_success(endpoint=endpoint, attribute=attributes.RemainingDuration) asserts.assert_true(remaining_duration_dut is NullValue, "RemainingDuration is not null") + self.step(11) + await self.write_single_attribute(attributes.DefaultOpenDuration(originalDefaultOpenDuration), endpoint_id=endpoint) + if __name__ == "__main__": default_matter_test_main() From b8a0e76b8078aebddc5ad37abe57df622823571a Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Wed, 9 Oct 2024 16:31:25 +0200 Subject: [PATCH 052/127] =?UTF-8?q?[Matter.framework]=20When=20the=20devic?= =?UTF-8?q?e=20is=20entering=20suspended=20state=20and=20at=E2=80=A6=20(#3?= =?UTF-8?q?5973)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/darwin/Framework/CHIP/MTRDevice_Concrete.mm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm index 947e7a3967..869f8b692a 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm +++ b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm @@ -2404,8 +2404,10 @@ - (void)_setupSubscriptionWithReason:(NSString *)reason NSNumber * _Nullable retryDelay) { if (error != nil) { MTR_LOG_ERROR("%@ getSessionForNode error %@", self, error); - [self _handleSubscriptionError:error]; - [self _handleSubscriptionReset:retryDelay]; + [self->_deviceController asyncDispatchToMatterQueue:^{ + [self _handleSubscriptionError:error]; + [self _handleSubscriptionReset:retryDelay]; + } errorHandler:nil]; return; } From 81101573126bd1a98b2d972647c0bd155523b512 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Wed, 9 Oct 2024 16:35:09 +0200 Subject: [PATCH 053/127] [Matter.framework] MTRAsyncWorkItem::initWithQueue will assert when the delayed scheduleSubscriptionPool fires after the deallocation of the MTRDevice (#35987) --- src/darwin/Framework/CHIP/MTRDevice_Concrete.mm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm index 869f8b692a..539754d236 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm +++ b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm @@ -1170,6 +1170,12 @@ - (void)_scheduleSubscriptionPoolWork:(dispatch_block_t)workBlock inNanoseconds: mtr_weakify(self); dispatch_block_t workBlockToQueue = ^{ mtr_strongify(self); + if (nil == self) { + // This block may be delayed by a specified number of nanoseconds, potentially running after the device is deallocated. + // If so, MTRAsyncWorkItem::initWithQueue will assert on a nil queue, which will cause a crash. + return; + } + // 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) { From 59f7615586053b73632739392ca5374680a34d2b Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Wed, 9 Oct 2024 11:02:27 -0400 Subject: [PATCH 054/127] Remove python_lib build&test out of darwin build steps (#35980) * Remove python_lib build step completely. After #34892 this build is a noop so we do not benefit from running the build a 2nd time. This should save some CI time. * Update .github/workflows/build.yaml Co-authored-by: Boris Zbarsky * Add back comments --------- Co-authored-by: Andrei Litvin Co-authored-by: Boris Zbarsky --- .github/workflows/build.yaml | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f14a16f5e0..4495a499c5 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -375,7 +375,7 @@ jobs: scripts/build_python_device.sh --chip_detail_logging true build_darwin: - name: Build on Darwin (clang, python_lib, simulated) + name: Build on Darwin (clang, simulated) runs-on: macos-13 if: github.actor != 'restyled-io[bot]' @@ -402,27 +402,20 @@ jobs: CHIP_ROOT_PATH=examples/placeholder/linux CHIP_ROOT_PATH="$CHIP_ROOT_PATH" BUILD_TYPE="$BUILD_TYPE" scripts/build/gn_gen.sh --args="$GN_ARGS" scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE" - - name: Setup Build, Run Build and Run Tests + - name: Setup Build, Run Build and Run Tests (asan + target_os=all) # We can't enable leak checking here in LSAN_OPTIONS, because on # Darwin that's only supported with a new enough clang, and we're # not building with the pigweed clang here. + env: + BUILD_TYPE: default run: | - for BUILD_TYPE in default python_lib; do - case $BUILD_TYPE in - # We want to build various standalone example apps - # (similar to what examples-linux-standalone.yaml - # does), so use target_os="all" to get those picked - # up as part of the "unified" build. But then to - # save CI resources we want to exclude the - # "host clang" build, which uses the pigweed - # clang. - "default") GN_ARGS='target_os="all" is_asan=true enable_host_clang_build=false';; - esac - BUILD_TYPE=$BUILD_TYPE scripts/build/gn_gen.sh --args="$GN_ARGS chip_data_model_check_die_on_failure=true" --export-compile-commands - scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE" - BUILD_TYPE=$BUILD_TYPE scripts/tests/gn_tests.sh - done - - name: Ensure codegen is done for sanitize + # We want to build various standalone example apps similar to what examples-linux-standalone.yaml + # does), so use target_os="all" to get those picked up as part of the "unified" build. But then + # to save CI resources we want to exclude the "host clang" build, which uses the pigweed clang. + scripts/build/gn_gen.sh --args='target_os="all" is_asan=true enable_host_clang_build=false chip_data_model_check_die_on_failure=true' --export-compile-commands + scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE" + scripts/tests/gn_tests.sh + - name: Ensure codegen is done for default run: | ./scripts/run_in_build_env.sh "./scripts/run_codegen_targets.sh out/default" - name: Clang-tidy validation From 50b5dfb1d62e21540ada8a7d9528fb8f18121b05 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 9 Oct 2024 11:48:40 -0400 Subject: [PATCH 055/127] Make MTRBaseDevice be explicit about when it's assuming a concrete controller. (#35957) * Make MTRBaseDevice be explicit about when it's assuming a concrete controller. This allows us to move several selectors from MTRDeviceController_Internal to MTRDeviceController_Concrete, and get rid of the never-actually-set _cppCommissioner ivar on MTRDeviceController. * Address review comment: add logs. --- src/darwin/Framework/CHIP/MTRBaseDevice.mm | 308 +++++++++++------- .../Framework/CHIP/MTRCallbackBridgeBase.h | 5 + .../Framework/CHIP/MTRDeviceController.mm | 59 +--- .../CHIP/MTRDeviceController_Concrete.h | 38 +++ .../CHIP/MTRDeviceController_Concrete.mm | 4 +- .../CHIP/MTRDeviceController_Internal.h | 37 --- 6 files changed, 235 insertions(+), 216 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRBaseDevice.mm b/src/darwin/Framework/CHIP/MTRBaseDevice.mm index f00c57a61b..89f7aab425 100644 --- a/src/darwin/Framework/CHIP/MTRBaseDevice.mm +++ b/src/darwin/Framework/CHIP/MTRBaseDevice.mm @@ -232,6 +232,11 @@ - (void)onDone @end +@interface MTRBaseDevice () +// Will return nil if our controller is not in fact a concrete controller. +@property (nullable, nonatomic, strong, readonly) MTRDeviceController_Concrete * concreteController; +@end + @implementation MTRBaseDevice - (instancetype)initWithPASEDevice:(chip::DeviceProxy *)device controller:(MTRDeviceController *)controller @@ -261,9 +266,24 @@ + (MTRBaseDevice *)deviceWithNodeID:(NSNumber *)nodeID controller:(MTRDeviceCont return [controller baseDeviceForNodeID:nodeID]; } +- (nullable MTRDeviceController_Concrete *)concreteController +{ + auto * controller = self.deviceController; + if ([controller isKindOfClass:MTRDeviceController_Concrete.class]) { + return static_cast(controller); + } + + return nil; +} + - (MTRTransportType)sessionTransportType { - return [self.deviceController sessionTransportTypeForDevice:self]; + auto * concreteController = self.concreteController; + if (concreteController == nil) { + MTR_LOG_ERROR("Unable to determine session transport type for MTRBaseDevice created with an XPC controller"); + return MTRTransportTypeUndefined; + } + return [concreteController sessionTransportTypeForDevice:self]; } - (void)invalidateCASESession @@ -272,7 +292,14 @@ - (void)invalidateCASESession return; } - [self.deviceController invalidateCASESessionForNode:self.nodeID]; + auto * concreteController = self.concreteController; + if (concreteController == nil) { + // Nothing we can do here. + MTR_LOG_ERROR("Unable invalidate CASE session for MTRBaseDevice created with an XPC controller"); + return; + } + + [concreteController invalidateCASESessionForNode:@(self.nodeID)]; } namespace { @@ -311,121 +338,131 @@ - (void)subscribeWithQueue:(dispatch_queue_t)queue return; } + auto * concreteController = self.concreteController; + if (concreteController == nil) { + // No subscriptions (or really any MTRBaseDevice use) with XPC controllers. + MTR_LOG_ERROR("Unable to create subscription for MTRBaseDevice created with an XPC controller"); + dispatch_async(queue, ^{ + errorHandler([MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]); + }); + return; + } + // Copy params before going async. params = [params copy]; - [self.deviceController getSessionForNode:self.nodeID - completion:^(ExchangeManager * _Nullable exchangeManager, const Optional & session, - NSError * _Nullable error, NSNumber * _Nullable retryDelay) { - if (error != nil) { - dispatch_async(queue, ^{ - errorHandler(error); - }); - return; - } - - // Wildcard endpoint, cluster, attribute, event. - auto attributePath = std::make_unique(); - auto eventPath = std::make_unique(); - eventPath->mIsUrgentEvent = params.reportEventsUrgently; - ReadPrepareParams readParams(session.Value()); - [params toReadPrepareParams:readParams]; - readParams.mpAttributePathParamsList = attributePath.get(); - readParams.mAttributePathParamsListSize = 1; - readParams.mpEventPathParamsList = eventPath.get(); - readParams.mEventPathParamsListSize = 1; - - std::unique_ptr clusterStateCache; - ReadClient::Callback * callbackForReadClient = nullptr; - OnDoneHandler onDoneHandler = nil; - - if (clusterStateCacheContainer) { - __weak MTRClusterStateCacheContainer * weakPtr = clusterStateCacheContainer; - onDoneHandler = ^{ - // This, like all manipulation of cppClusterStateCache, needs to run on the Matter - // queue. - MTRClusterStateCacheContainer * container = weakPtr; - if (container) { - container.cppClusterStateCache = nullptr; - container.baseDevice = nil; - } - }; - } - - auto callback = std::make_unique( - ^(NSArray * value) { - dispatch_async(queue, ^{ - if (attributeReportHandler != nil) { - attributeReportHandler(value); - } - }); - }, - ^(NSArray * value) { - dispatch_async(queue, ^{ - if (eventReportHandler != nil) { - eventReportHandler(value); - } - }); - }, - ^(NSError * error) { - dispatch_async(queue, ^{ - errorHandler(error); - }); - }, - ^(NSError * error, NSNumber * resubscriptionDelay) { - dispatch_async(queue, ^{ - if (resubscriptionScheduled != nil) { - resubscriptionScheduled(error, resubscriptionDelay); - } - }); - }, - ^(void) { - dispatch_async(queue, ^{ - if (subscriptionEstablished != nil) { - subscriptionEstablished(); - } - }); - }, - onDoneHandler); - - if (clusterStateCacheContainer) { - clusterStateCache = std::make_unique(*callback.get()); - callbackForReadClient = &clusterStateCache->GetBufferedCallback(); - } else { - callbackForReadClient = &callback->GetBufferedCallback(); - } - - auto readClient = std::make_unique(InteractionModelEngine::GetInstance(), - exchangeManager, *callbackForReadClient, ReadClient::InteractionType::Subscribe); - - CHIP_ERROR err; - if (!params.resubscribeAutomatically) { - err = readClient->SendRequest(readParams); - } else { - // SendAutoResubscribeRequest cleans up the params, even on failure. - attributePath.release(); - eventPath.release(); - err = readClient->SendAutoResubscribeRequest(std::move(readParams)); - } - - if (err != CHIP_NO_ERROR) { - dispatch_async(queue, ^{ - errorHandler([MTRError errorForCHIPErrorCode:err]); - }); - - return; - } - - if (clusterStateCacheContainer) { - clusterStateCacheContainer.cppClusterStateCache = clusterStateCache.get(); - // ClusterStateCache will be deleted when OnDone is called. - callback->AdoptClusterStateCache(std::move(clusterStateCache)); - clusterStateCacheContainer.baseDevice = self; - } - // Callback and ReadClient will be deleted when OnDone is called. - callback->AdoptReadClient(std::move(readClient)); - callback.release(); - }]; + [concreteController getSessionForNode:self.nodeID + completion:^(ExchangeManager * _Nullable exchangeManager, const Optional & session, + NSError * _Nullable error, NSNumber * _Nullable retryDelay) { + if (error != nil) { + dispatch_async(queue, ^{ + errorHandler(error); + }); + return; + } + + // Wildcard endpoint, cluster, attribute, event. + auto attributePath = std::make_unique(); + auto eventPath = std::make_unique(); + eventPath->mIsUrgentEvent = params.reportEventsUrgently; + ReadPrepareParams readParams(session.Value()); + [params toReadPrepareParams:readParams]; + readParams.mpAttributePathParamsList = attributePath.get(); + readParams.mAttributePathParamsListSize = 1; + readParams.mpEventPathParamsList = eventPath.get(); + readParams.mEventPathParamsListSize = 1; + + std::unique_ptr clusterStateCache; + ReadClient::Callback * callbackForReadClient = nullptr; + OnDoneHandler onDoneHandler = nil; + + if (clusterStateCacheContainer) { + __weak MTRClusterStateCacheContainer * weakPtr = clusterStateCacheContainer; + onDoneHandler = ^{ + // This, like all manipulation of cppClusterStateCache, needs to run on the Matter + // queue. + MTRClusterStateCacheContainer * container = weakPtr; + if (container) { + container.cppClusterStateCache = nullptr; + container.baseDevice = nil; + } + }; + } + + auto callback = std::make_unique( + ^(NSArray * value) { + dispatch_async(queue, ^{ + if (attributeReportHandler != nil) { + attributeReportHandler(value); + } + }); + }, + ^(NSArray * value) { + dispatch_async(queue, ^{ + if (eventReportHandler != nil) { + eventReportHandler(value); + } + }); + }, + ^(NSError * error) { + dispatch_async(queue, ^{ + errorHandler(error); + }); + }, + ^(NSError * error, NSNumber * resubscriptionDelay) { + dispatch_async(queue, ^{ + if (resubscriptionScheduled != nil) { + resubscriptionScheduled(error, resubscriptionDelay); + } + }); + }, + ^(void) { + dispatch_async(queue, ^{ + if (subscriptionEstablished != nil) { + subscriptionEstablished(); + } + }); + }, + onDoneHandler); + + if (clusterStateCacheContainer) { + clusterStateCache = std::make_unique(*callback.get()); + callbackForReadClient = &clusterStateCache->GetBufferedCallback(); + } else { + callbackForReadClient = &callback->GetBufferedCallback(); + } + + auto readClient = std::make_unique(InteractionModelEngine::GetInstance(), + exchangeManager, *callbackForReadClient, ReadClient::InteractionType::Subscribe); + + CHIP_ERROR err; + if (!params.resubscribeAutomatically) { + err = readClient->SendRequest(readParams); + } else { + // SendAutoResubscribeRequest cleans up the params, even on failure. + attributePath.release(); + eventPath.release(); + err = readClient->SendAutoResubscribeRequest(std::move(readParams)); + } + + if (err != CHIP_NO_ERROR) { + dispatch_async(queue, ^{ + errorHandler([MTRError errorForCHIPErrorCode:err]); + }); + + return; + } + + if (clusterStateCacheContainer) { + clusterStateCacheContainer.cppClusterStateCache = clusterStateCache.get(); + // ClusterStateCache will be deleted when OnDone is called. + callback->AdoptClusterStateCache(std::move(clusterStateCache)); + clusterStateCacheContainer.baseDevice = self; + } + // Callback and ReadClient will be deleted when OnDone is called. + callback->AdoptReadClient(std::move(readClient)); + callback.release(); + }]; } static NSDictionary * _MakeDataValueDictionary(NSString * type, id _Nullable value, NSNumber * _Nullable dataVersion) @@ -1616,6 +1653,16 @@ - (void)subscribeToAttributePaths:(NSArray * _Nullabl return; } + auto * concreteController = self.concreteController; + if (concreteController == nil) { + // No subscriptions (or really any MTRBaseDevice use) with XPC controllers. + MTR_LOG_ERROR("Unable to create subscription for MTRBaseDevice created with an XPC controller"); + dispatch_async(queue, ^{ + reportHandler(nil, [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]); + }); + return; + } + // Copy params before going async. NSArray * attributes = nil; if (attributePaths != nil) { @@ -1629,7 +1676,7 @@ - (void)subscribeToAttributePaths:(NSArray * _Nullabl params = (params == nil) ? nil : [params copy]; - [self.deviceController + [concreteController getSessionForNode:self.nodeID completion:^(ExchangeManager * _Nullable exchangeManager, const Optional & session, NSError * _Nullable error, NSNumber * _Nullable retryDelay) { @@ -1890,6 +1937,16 @@ - (void)_openCommissioningWindowWithSetupPasscode:(nullable NSNumber *)setupPass return; } + auto * concreteController = self.concreteController; + if (concreteController == nil) { + MTR_LOG_ERROR("Can't open a commissioning window via MTRBaseDevice created with an XPC controller"); + dispatch_async(queue, ^{ + MATTER_LOG_METRIC_END(kMetricOpenPairingWindow, CHIP_ERROR_INCORRECT_STATE); + completion(nil, [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]); + }); + return; + } + unsigned long long durationVal = [duration unsignedLongLongValue]; if (!CanCastTo(durationVal)) { MTR_LOG_ERROR("Error: Duration %llu is too large.", durationVal); @@ -1925,7 +1982,7 @@ - (void)_openCommissioningWindowWithSetupPasscode:(nullable NSNumber *)setupPass passcode.Emplace(static_cast(passcodeVal)); } - [self.deviceController + [concreteController asyncGetCommissionerOnMatterQueue:^(Controller::DeviceCommissioner * commissioner) { auto resultCallback = ^(CHIP_ERROR status, const SetupPayload & payload) { if (status != CHIP_NO_ERROR) { @@ -2175,11 +2232,20 @@ - (void)downloadLogOfType:(MTRDiagnosticLogType)type queue:(dispatch_queue_t)queue completion:(void (^)(NSURL * _Nullable url, NSError * _Nullable error))completion { - [_deviceController downloadLogFromNodeWithID:@(_nodeID) - type:type - timeout:timeout - queue:queue - completion:completion]; + auto * concreteController = self.concreteController; + if (concreteController == nil) { + MTR_LOG_ERROR("Can't download logs via MTRBaseDevice created with an XPC controller"); + dispatch_async(queue, ^{ + completion(nil, [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]); + }); + return; + } + + [concreteController downloadLogFromNodeWithID:@(_nodeID) + type:type + timeout:timeout + queue:queue + completion:completion]; } - (NSString *)description diff --git a/src/darwin/Framework/CHIP/MTRCallbackBridgeBase.h b/src/darwin/Framework/CHIP/MTRCallbackBridgeBase.h index 6631e2d132..d9c98157c2 100644 --- a/src/darwin/Framework/CHIP/MTRCallbackBridgeBase.h +++ b/src/darwin/Framework/CHIP/MTRCallbackBridgeBase.h @@ -81,6 +81,9 @@ class MTRCallbackBridgeBase { { LogRequestStart(); + // TODO: Figure out whether we can usefully get an MTRDeviceController_Concrete in here, so + // we can move getSessionForCommissioneeDevice off of MTRDeviceController_Internal. Ideally + // without bloating this inline method too much. [device.deviceController getSessionForCommissioneeDevice:device.nodeID completion:^(chip::Messaging::ExchangeManager * exchangeManager, const chip::Optional & session, NSError * _Nullable error, NSNumber * _Nullable retryDelay) { @@ -92,6 +95,8 @@ class MTRCallbackBridgeBase { { LogRequestStart(); + // TODO: Figure out whether we can usefully get an MTRDeviceController_Concrete in here, so + // we can move getSessionForNode off of MTRDeviceController_Internal. [controller getSessionForNode:nodeID completion:^(chip::Messaging::ExchangeManager * _Nullable exchangeManager, const chip::Optional & session, NSError * _Nullable error, NSNumber * _Nullable retryDelay) { diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm index fb13db9b00..013e892873 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm @@ -119,7 +119,6 @@ - (instancetype)initWithDelegate:(id)delegate queue @end @implementation MTRDeviceController { - chip::Controller::DeviceCommissioner * _cppCommissioner; chip::Credentials::PartialDACVerifier * _partialDACVerifier; chip::Credentials::DefaultDACVerifier * _defaultDACVerifier; MTRDeviceControllerDelegateBridge * _deviceControllerDelegateBridge; @@ -206,7 +205,8 @@ - (NSString *)description - (BOOL)isRunning { - return _cppCommissioner != nullptr; + MTR_ABSTRACT_METHOD(); + return NO; } #pragma mark - Suspend/resume support @@ -547,37 +547,9 @@ - (void)getSessionForCommissioneeDevice:(chip::NodeId)deviceID completion:(MTRIn completion(nullptr, chip::NullOptional, [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); } -- (MTRTransportType)sessionTransportTypeForDevice:(MTRBaseDevice *)device -{ - VerifyOrReturnValue([self checkIsRunning], MTRTransportTypeUndefined); - - __block MTRTransportType result = MTRTransportTypeUndefined; - dispatch_sync(_chipWorkQueue, ^{ - VerifyOrReturn([self checkIsRunning]); - - if (device.isPASEDevice) { - chip::CommissioneeDeviceProxy * deviceProxy; - VerifyOrReturn(CHIP_NO_ERROR == self->_cppCommissioner->GetDeviceBeingCommissioned(device.nodeID, &deviceProxy)); - result = MTRMakeTransportType(deviceProxy->GetDeviceTransportType()); - } else { - auto scopedNodeID = self->_cppCommissioner->GetPeerScopedId(device.nodeID); - auto sessionHandle = self->_cppCommissioner->SessionMgr()->FindSecureSessionForNode(scopedNodeID); - VerifyOrReturn(sessionHandle.HasValue()); - result = MTRMakeTransportType(sessionHandle.Value()->AsSecureSession()->GetPeerAddress().GetTransportType()); - } - }); - return result; -} - -- (void)asyncGetCommissionerOnMatterQueue:(void (^)(chip::Controller::DeviceCommissioner *))block - errorHandler:(nullable MTRDeviceErrorHandler)errorHandler -{ - MTR_ABSTRACT_METHOD(); - errorHandler([MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]); -} - - (void)asyncDispatchToMatterQueue:(dispatch_block_t)block errorHandler:(nullable MTRDeviceErrorHandler)errorHandler { + // TODO: Figure out how to get callsites to have an MTRDeviceController_Concrete. MTR_ABSTRACT_METHOD(); errorHandler([MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]); } @@ -627,31 +599,6 @@ - (nullable NSNumber *)compressedFabricID return storedValue.has_value() ? @(storedValue.value()) : nil; } -- (void)invalidateCASESessionForNode:(chip::NodeId)nodeID; -{ - auto block = ^{ - auto sessionMgr = self->_cppCommissioner->SessionMgr(); - VerifyOrDie(sessionMgr != nullptr); - - sessionMgr->MarkSessionsAsDefunct( - self->_cppCommissioner->GetPeerScopedId(nodeID), chip::MakeOptional(chip::Transport::SecureSession::Type::kCASE)); - }; - - [self syncRunOnWorkQueue:block error:nil]; -} - -- (void)downloadLogFromNodeWithID:(NSNumber *)nodeID - type:(MTRDiagnosticLogType)type - timeout:(NSTimeInterval)timeout - queue:(dispatch_queue_t)queue - completion:(void (^)(NSURL * _Nullable url, NSError * _Nullable error))completion -{ - MTR_ABSTRACT_METHOD(); - dispatch_async(queue, ^{ - completion(nil, [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]); - }); -} - #ifdef DEBUG + (void)forceLocalhostAdvertisingOnly { diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.h b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.h index 5df5f501b1..0cfb25f494 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.h +++ b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.h @@ -18,6 +18,7 @@ #import #import +#import #import #import #import @@ -149,6 +150,43 @@ NS_ASSUME_NONNULL_BEGIN */ - (nullable NSNumber *)neededReadPrivilegeForClusterID:(NSNumber *)clusterID attributeID:(NSNumber *)attributeID; +/** + * Try to asynchronously dispatch the given block on the Matter queue. If the + * controller is not running either at call time or when the block would be + * about to run, the provided error handler will be called with an error. Note + * that this means the error handler might be called on an arbitrary queue, and + * might be called before this function returns or after it returns. + * + * The DeviceCommissioner pointer passed to the callback should only be used + * synchronously during the callback invocation. + * + * If the error handler is nil, failure to run the block will be silent. + */ +- (void)asyncGetCommissionerOnMatterQueue:(void (^)(chip::Controller::DeviceCommissioner *))block + errorHandler:(nullable MTRDeviceErrorHandler)errorHandler; + +/** + * Returns the transport used by the current session with the given device, + * or `MTRTransportTypeUndefined` if no session is currently active. + */ +- (MTRTransportType)sessionTransportTypeForDevice:(MTRBaseDevice *)device; + +/** + * Invalidate the CASE session for the given node ID. This is a temporary thing + * just to support MTRBaseDevice's invalidateCASESession. Must not be called on + * the Matter event queue. + */ +- (void)invalidateCASESessionForNode:(NSNumber *)nodeID; + +/** + * Download log of the desired type from the device. + */ +- (void)downloadLogFromNodeWithID:(NSNumber *)nodeID + type:(MTRDiagnosticLogType)type + timeout:(NSTimeInterval)timeout + queue:(dispatch_queue_t)queue + completion:(void (^)(NSURL * _Nullable url, NSError * _Nullable error))completion; + @end NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm index 47c373ac88..42ee83d523 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm @@ -1586,14 +1586,14 @@ - (CHIP_ERROR)isRunningOnFabric:(chip::FabricTable *)fabricTable return CHIP_NO_ERROR; } -- (void)invalidateCASESessionForNode:(chip::NodeId)nodeID; +- (void)invalidateCASESessionForNode:(NSNumber *)nodeID; { auto block = ^{ auto sessionMgr = self->_cppCommissioner->SessionMgr(); VerifyOrDie(sessionMgr != nullptr); sessionMgr->MarkSessionsAsDefunct( - self->_cppCommissioner->GetPeerScopedId(nodeID), chip::MakeOptional(chip::Transport::SecureSession::Type::kCASE)); + self->_cppCommissioner->GetPeerScopedId(nodeID.unsignedLongLongValue), chip::MakeOptional(chip::Transport::SecureSession::Type::kCASE)); }; [self syncRunOnWorkQueue:block error:nil]; diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h b/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h index 84a8b536ec..8fd6e4cb4b 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h @@ -154,34 +154,6 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)getSessionForCommissioneeDevice:(chip::NodeId)deviceID completion:(MTRInternalDeviceConnectionCallback)completion; -/** - * Returns the transport used by the current session with the given device, - * or `MTRTransportTypeUndefined` if no session is currently active. - */ -- (MTRTransportType)sessionTransportTypeForDevice:(MTRBaseDevice *)device; - -/** - * Invalidate the CASE session for the given node ID. This is a temporary thing - * just to support MTRBaseDevice's invalidateCASESession. Must not be called on - * the Matter event queue. - */ -- (void)invalidateCASESessionForNode:(chip::NodeId)nodeID; - -/** - * Try to asynchronously dispatch the given block on the Matter queue. If the - * controller is not running either at call time or when the block would be - * about to run, the provided error handler will be called with an error. Note - * that this means the error handler might be called on an arbitrary queue, and - * might be called before this function returns or after it returns. - * - * The DeviceCommissioner pointer passed to the callback should only be used - * synchronously during the callback invocation. - * - * If the error handler is nil, failure to run the block will be silent. - */ -- (void)asyncGetCommissionerOnMatterQueue:(void (^)(chip::Controller::DeviceCommissioner *))block - errorHandler:(nullable MTRDeviceErrorHandler)errorHandler; - /** * Try to asynchronously dispatch the given block on the Matter queue. If the * controller is not running either at call time or when the block would be @@ -200,15 +172,6 @@ NS_ASSUME_NONNULL_BEGIN */ - (MTRBaseDevice *)baseDeviceForNodeID:(NSNumber *)nodeID; -/** - * Download log of the desired type from the device. - */ -- (void)downloadLogFromNodeWithID:(NSNumber *)nodeID - type:(MTRDiagnosticLogType)type - timeout:(NSTimeInterval)timeout - queue:(dispatch_queue_t)queue - completion:(void (^)(NSURL * _Nullable url, NSError * _Nullable error))completion; - #pragma mark - Device-specific data and SDK access // DeviceController will act as a central repository for this opaque dictionary that MTRDevice manages - (MTRDevice *)deviceForNodeID:(NSNumber *)nodeID; From d4c2eaf197839478c10fd81016cd017a873d04c4 Mon Sep 17 00:00:00 2001 From: andrei-menzopol <96489227+andrei-menzopol@users.noreply.github.com> Date: Wed, 9 Oct 2024 19:10:14 +0300 Subject: [PATCH 056/127] [NXP][common][mcxw71_k32w1] Update ButtonApp::HandleLongPress and PlatformManagerImpl (#35989) * [nxp][examples][common] Schedule ButtonApp::HandleLongPress on Matter task * Remove CleanReset call * Schedule button work on matter task. This code is run from interrupt and Reset might call some functions (e.g. LogEvent) that must be run from matter task. See PlatformMgr().HandleServerShuttingDown() from PlatformManagerImpl::_Shutdown. Signed-off-by: Andrei Menzopol * [nxp][platform][mcxw71_k32w1] Update PlatformManagerImpl.cpp * Add .HandleServerShuttingDown PlatformManagerImpl::_Shutdown() * Use NVIC_SystemReset instead of HAL_ResetMCU * Rename CleanReset to Reset Signed-off-by: Andrei Menzopol * Restyled by clang-format --------- Signed-off-by: Andrei Menzopol Co-authored-by: Restyled.io --- .../nxp/common/matter_button/source/ButtonApp.cpp | 9 ++++++++- .../nxp/mcxw71_k32w1/PlatformManagerImpl.cpp | 15 ++++++++++----- .../nxp/mcxw71_k32w1/PlatformManagerImpl.h | 2 +- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/examples/platform/nxp/common/matter_button/source/ButtonApp.cpp b/examples/platform/nxp/common/matter_button/source/ButtonApp.cpp index 3b03b413ec..c380319a1d 100644 --- a/examples/platform/nxp/common/matter_button/source/ButtonApp.cpp +++ b/examples/platform/nxp/common/matter_button/source/ButtonApp.cpp @@ -48,7 +48,14 @@ void chip::NXP::App::ButtonApp::HandleShortPress() void chip::NXP::App::ButtonApp::HandleLongPress() { - chip::DeviceLayer::PlatformMgrImpl().CleanReset(); + // Execute "clean" reset + chip::DeviceLayer::PlatformMgr().ScheduleWork( + [](intptr_t arg) { + chip::DeviceLayer::PlatformMgr().StopEventLoopTask(); + chip::DeviceLayer::PlatformMgr().Shutdown(); + chip::DeviceLayer::PlatformMgrImpl().Reset(); + }, + (intptr_t) nullptr); } void chip::NXP::App::ButtonApp::HandleDoubleClick() diff --git a/src/platform/nxp/mcxw71_k32w1/PlatformManagerImpl.cpp b/src/platform/nxp/mcxw71_k32w1/PlatformManagerImpl.cpp index 3c1e39b041..e0ec11a747 100644 --- a/src/platform/nxp/mcxw71_k32w1/PlatformManagerImpl.cpp +++ b/src/platform/nxp/mcxw71_k32w1/PlatformManagerImpl.cpp @@ -48,7 +48,6 @@ #include -extern "C" void HAL_ResetMCU(void); extern "C" void freertos_mbedtls_mutex_init(void); extern uint8_t __data_end__[], m_data0_end[]; @@ -93,14 +92,16 @@ CHIP_ERROR PlatformManagerImpl::ServiceInit(void) return CHIP_NO_ERROR; } -void PlatformManagerImpl::CleanReset() +void PlatformManagerImpl::Reset() { - StopEventLoopTask(); - Shutdown(); #if (CHIP_PLAT_NVM_SUPPORT == 1) NvCompletePendingOperations(); #endif - HAL_ResetMCU(); + // Restart the system. + NVIC_SystemReset(); + while (1) + { + } } void PlatformManagerImpl::ScheduleResetInIdle(void) @@ -200,6 +201,10 @@ void PlatformManagerImpl::_Shutdown() ChipLogError(DeviceLayer, "Failed to get current uptime since the Node’s last reboot"); } + /* Handle the server shutting down & emit the ShutDown event */ + /* Make sure to call this function from Matter Task */ + PlatformMgr().HandleServerShuttingDown(); + /* Shutdown all layers */ Internal::GenericPlatformManagerImpl_FreeRTOS::_Shutdown(); } diff --git a/src/platform/nxp/mcxw71_k32w1/PlatformManagerImpl.h b/src/platform/nxp/mcxw71_k32w1/PlatformManagerImpl.h index 588790823c..935efaa555 100644 --- a/src/platform/nxp/mcxw71_k32w1/PlatformManagerImpl.h +++ b/src/platform/nxp/mcxw71_k32w1/PlatformManagerImpl.h @@ -51,7 +51,7 @@ class PlatformManagerImpl final : public PlatformManager, public Internal::Gener System::Clock::Timestamp GetStartTime() { return mStartTime; } void HardwareInit(void); CHIP_ERROR ServiceInit(void); - void CleanReset(); + void Reset(); void StopBLEConnectivity() {} void ScheduleResetInIdle(void); bool GetResetInIdleValue(void); From b3aeb677f5cac4cd0b7df53db68d62555e577a1d Mon Sep 17 00:00:00 2001 From: Arkadiusz Bokowy Date: Wed, 9 Oct 2024 18:51:02 +0200 Subject: [PATCH 057/127] Convert CI python test arguments to YAML format (#35988) * Convert CI python test arguments to YAML format * Drop support for non-YAML CI arguments format Fixes #35787 * Rename factoryreset to factory-reset --- .github/workflows/tests.yaml | 2 +- docs/guides/matter-repl.md | 10 +- docs/testing/python.md | 10 +- .../TestTimeSyncTrustedTimeSourceRunner.py | 4 +- .../test/test_scripts/mobile-device-test.py | 2 +- src/python_testing/TCP_Tests.py | 2 +- src/python_testing/TC_ACE_1_2.py | 2 +- src/python_testing/TC_ACE_1_3.py | 2 +- src/python_testing/TC_ACE_1_4.py | 2 +- src/python_testing/TC_ACE_1_5.py | 2 +- src/python_testing/TC_ACL_2_11.py | 2 +- src/python_testing/TC_ACL_2_2.py | 2 +- src/python_testing/TC_AccessChecker.py | 2 +- src/python_testing/TC_BOOLCFG_2_1.py | 19 +- src/python_testing/TC_BOOLCFG_3_1.py | 19 +- src/python_testing/TC_BOOLCFG_4_1.py | 19 +- src/python_testing/TC_BOOLCFG_4_2.py | 24 +- src/python_testing/TC_BOOLCFG_4_3.py | 24 +- src/python_testing/TC_BOOLCFG_4_4.py | 24 +- src/python_testing/TC_BOOLCFG_5_1.py | 24 +- src/python_testing/TC_BOOLCFG_5_2.py | 24 +- src/python_testing/TC_BRBINFO_4_1.py | 2 +- src/python_testing/TC_CADMIN_1_9.py | 20 +- src/python_testing/TC_CCTRL_2_1.py | 2 +- src/python_testing/TC_CCTRL_2_2.py | 2 +- src/python_testing/TC_CCTRL_2_3.py | 2 +- src/python_testing/TC_CC_10_1.py | 21 +- src/python_testing/TC_CC_2_2.py | 21 +- src/python_testing/TC_CGEN_2_4.py | 19 +- src/python_testing/TC_CNET_1_4.py | 20 +- src/python_testing/TC_DA_1_2.py | 20 +- src/python_testing/TC_DA_1_5.py | 20 +- src/python_testing/TC_DA_1_7.py | 20 +- src/python_testing/TC_DEM_2_1.py | 27 +- src/python_testing/TC_DEM_2_10.py | 26 +- src/python_testing/TC_DEM_2_2.py | 27 +- src/python_testing/TC_DEM_2_3.py | 27 +- src/python_testing/TC_DEM_2_4.py | 27 +- src/python_testing/TC_DEM_2_5.py | 27 +- src/python_testing/TC_DEM_2_6.py | 27 +- src/python_testing/TC_DEM_2_7.py | 27 +- src/python_testing/TC_DEM_2_8.py | 27 +- src/python_testing/TC_DEM_2_9.py | 27 +- src/python_testing/TC_DGGEN_2_4.py | 19 +- src/python_testing/TC_DGSW_2_1.py | 19 +- src/python_testing/TC_DRLK_2_12.py | 20 +- src/python_testing/TC_DRLK_2_13.py | 21 +- src/python_testing/TC_DRLK_2_2.py | 20 +- src/python_testing/TC_DRLK_2_3.py | 20 +- src/python_testing/TC_DRLK_2_5.py | 20 +- src/python_testing/TC_DRLK_2_9.py | 20 +- .../TC_DeviceBasicComposition.py | 115 +++-- src/python_testing/TC_DeviceConformance.py | 20 +- src/python_testing/TC_ECOINFO_2_1.py | 2 +- src/python_testing/TC_ECOINFO_2_2.py | 2 +- src/python_testing/TC_EEM_2_1.py | 25 +- src/python_testing/TC_EEM_2_2.py | 25 +- src/python_testing/TC_EEM_2_3.py | 25 +- src/python_testing/TC_EEM_2_4.py | 25 +- src/python_testing/TC_EEM_2_5.py | 25 +- src/python_testing/TC_EEVSE_2_2.py | 26 +- src/python_testing/TC_EEVSE_2_3.py | 26 +- src/python_testing/TC_EEVSE_2_4.py | 26 +- src/python_testing/TC_EEVSE_2_5.py | 26 +- src/python_testing/TC_EEVSE_2_6.py | 26 +- src/python_testing/TC_EPM_2_1.py | 25 +- src/python_testing/TC_EPM_2_2.py | 25 +- src/python_testing/TC_EWATERHTR_2_1.py | 2 +- src/python_testing/TC_EWATERHTR_2_2.py | 27 +- src/python_testing/TC_EWATERHTR_2_3.py | 27 +- src/python_testing/TC_FAN_3_1.py | 19 +- src/python_testing/TC_FAN_3_2.py | 19 +- src/python_testing/TC_FAN_3_3.py | 19 +- src/python_testing/TC_FAN_3_4.py | 21 +- src/python_testing/TC_FAN_3_5.py | 19 +- src/python_testing/TC_ICDM_2_1.py | 20 +- src/python_testing/TC_ICDM_3_1.py | 20 +- src/python_testing/TC_ICDM_3_2.py | 20 +- src/python_testing/TC_ICDM_3_3.py | 20 +- src/python_testing/TC_ICDM_3_4.py | 20 +- src/python_testing/TC_ICDM_5_1.py | 20 +- src/python_testing/TC_ICDManagementCluster.py | 24 +- src/python_testing/TC_IDM_1_2.py | 19 +- src/python_testing/TC_IDM_1_4.py | 24 +- src/python_testing/TC_IDM_4_2.py | 19 +- src/python_testing/TC_LVL_2_3.py | 21 +- src/python_testing/TC_MCORE_FS_1_1.py | 2 +- src/python_testing/TC_MCORE_FS_1_2.py | 2 +- src/python_testing/TC_MCORE_FS_1_3.py | 2 +- src/python_testing/TC_MCORE_FS_1_4.py | 2 +- src/python_testing/TC_MCORE_FS_1_5.py | 2 +- src/python_testing/TC_MWOCTRL_2_1.py | 20 +- src/python_testing/TC_MWOCTRL_2_2.py | 20 +- src/python_testing/TC_MWOCTRL_2_4.py | 20 +- src/python_testing/TC_MWOM_1_2.py | 19 +- src/python_testing/TC_OCC_2_1.py | 21 +- src/python_testing/TC_OCC_2_2.py | 21 +- src/python_testing/TC_OCC_2_3.py | 21 +- src/python_testing/TC_OCC_3_1.py | 416 +++++++++--------- src/python_testing/TC_OCC_3_2.py | 405 ++++++++--------- src/python_testing/TC_OPCREDS_3_1.py | 20 +- src/python_testing/TC_OPCREDS_3_2.py | 20 +- src/python_testing/TC_OPSTATE_2_1.py | 21 +- src/python_testing/TC_OPSTATE_2_2.py | 22 +- src/python_testing/TC_OPSTATE_2_3.py | 22 +- src/python_testing/TC_OPSTATE_2_4.py | 22 +- src/python_testing/TC_OPSTATE_2_5.py | 22 +- src/python_testing/TC_OPSTATE_2_6.py | 22 +- src/python_testing/TC_OVENOPSTATE_2_1.py | 21 +- src/python_testing/TC_OVENOPSTATE_2_2.py | 22 +- src/python_testing/TC_OVENOPSTATE_2_3.py | 22 +- src/python_testing/TC_OVENOPSTATE_2_4.py | 22 +- src/python_testing/TC_OVENOPSTATE_2_5.py | 22 +- src/python_testing/TC_OVENOPSTATE_2_6.py | 22 +- src/python_testing/TC_PS_2_3.py | 19 +- src/python_testing/TC_PWRTL_2_1.py | 19 +- src/python_testing/TC_RR_1_1.py | 19 +- src/python_testing/TC_RVCCLEANM_1_2.py | 21 +- src/python_testing/TC_RVCCLEANM_2_1.py | 2 +- src/python_testing/TC_RVCCLEANM_2_2.py | 21 +- src/python_testing/TC_RVCOPSTATE_2_1.py | 21 +- src/python_testing/TC_RVCOPSTATE_2_3.py | 21 +- src/python_testing/TC_RVCOPSTATE_2_4.py | 21 +- src/python_testing/TC_RVCRUNM_1_2.py | 21 +- src/python_testing/TC_RVCRUNM_2_1.py | 2 +- src/python_testing/TC_RVCRUNM_2_2.py | 2 +- src/python_testing/TC_SC_3_6.py | 19 +- src/python_testing/TC_SC_7_1.py | 18 +- src/python_testing/TC_SEAR_1_2.py | 21 +- src/python_testing/TC_SEAR_1_3.py | 22 +- src/python_testing/TC_SEAR_1_4.py | 21 +- src/python_testing/TC_SEAR_1_5.py | 21 +- src/python_testing/TC_SEAR_1_6.py | 21 +- src/python_testing/TC_SWTCH.py | 83 ++-- src/python_testing/TC_TIMESYNC_2_1.py | 21 +- src/python_testing/TC_TIMESYNC_2_10.py | 20 +- src/python_testing/TC_TIMESYNC_2_11.py | 20 +- src/python_testing/TC_TIMESYNC_2_12.py | 20 +- src/python_testing/TC_TIMESYNC_2_13.py | 20 +- src/python_testing/TC_TIMESYNC_2_2.py | 20 +- src/python_testing/TC_TIMESYNC_2_4.py | 20 +- src/python_testing/TC_TIMESYNC_2_5.py | 20 +- src/python_testing/TC_TIMESYNC_2_6.py | 20 +- src/python_testing/TC_TIMESYNC_2_7.py | 20 +- src/python_testing/TC_TIMESYNC_2_8.py | 20 +- src/python_testing/TC_TIMESYNC_2_9.py | 20 +- src/python_testing/TC_TIMESYNC_3_1.py | 19 +- src/python_testing/TC_TSTAT_4_2.py | 20 +- src/python_testing/TC_TestEventTrigger.py | 24 +- src/python_testing/TC_VALCC_2_1.py | 19 +- src/python_testing/TC_VALCC_3_1.py | 19 +- src/python_testing/TC_VALCC_3_2.py | 19 +- src/python_testing/TC_VALCC_3_3.py | 19 +- src/python_testing/TC_VALCC_3_4.py | 19 +- src/python_testing/TC_VALCC_4_1.py | 19 +- src/python_testing/TC_VALCC_4_2.py | 19 +- src/python_testing/TC_VALCC_4_3.py | 19 +- src/python_testing/TC_VALCC_4_4.py | 19 +- src/python_testing/TC_VALCC_4_5.py | 19 +- src/python_testing/TC_WHM_1_2.py | 26 +- src/python_testing/TC_WHM_2_1.py | 24 +- src/python_testing/TestBatchInvoke.py | 2 +- src/python_testing/TestGroupTableReports.py | 2 +- .../TestUnitTestingErrorPath.py | 2 +- src/python_testing/hello_test.py | 2 +- .../chip/testing/metadata.py | 45 +- .../chip/testing/test_metadata.py | 24 +- .../test_testing/test_TC_DA_1_2.py | 2 +- .../test_testing/test_TC_DA_1_5.py | 2 +- 169 files changed, 2603 insertions(+), 1354 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index c96c4ea023..d11f9f7323 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -595,7 +595,7 @@ jobs: " - name: Run Tests run: | - scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/darwin-x64-all-clusters-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --quiet --app-args "--discriminator 3840 --interface-id -1" --script-args "-t 3600 --disable-test ClusterObjectTests.TestTimedRequestTimeout"' + scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/darwin-x64-all-clusters-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factory-reset --quiet --app-args "--discriminator 3840 --interface-id -1" --script-args "-t 3600 --disable-test ClusterObjectTests.TestTimedRequestTimeout"' - name: Uploading core files uses: actions/upload-artifact@v4 if: ${{ failure() && !env.ACT }} diff --git a/docs/guides/matter-repl.md b/docs/guides/matter-repl.md index e7ebba5b3e..9bb3e60916 100644 --- a/docs/guides/matter-repl.md +++ b/docs/guides/matter-repl.md @@ -244,8 +244,8 @@ Some tests provides the option to exclude them. For example, you can use It is recommended to use the test wrapper to run mobile-device-test.py, for example, you can run: -``` -./scripts/tests/run_python_test.py --app chip-all-clusters-app --factoryreset +```shell +./scripts/tests/run_python_test.py --app chip-all-clusters-app --factory-reset ``` It provides some extra options, for example: @@ -254,7 +254,7 @@ It provides some extra options, for example: optional arguments: -h, --help show this help message and exit --app APP Path to local application to use, omit to use external apps. - --factoryreset Remove app config and repl configs (/tmp/chip* and /tmp/repl*) before running the tests. + --factory-reset Remove app config and repl configs (/tmp/chip* and /tmp/repl*) before running the tests. --app-args APP_ARGS The extra parameters passed to the device side app. --script SCRIPT Path to the test script to use, omit to use the default test script (mobile-device-test.py). --script-args SCRIPT_ARGS Arguments for the REPL test script @@ -263,8 +263,8 @@ optional arguments: You can pass your own flags for mobile-device-test.py by appending them to the command line with two dashes, for example: -``` -./scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-no-ble-no-wifi-tsan-clang/chip-all-clusters-app --factoryreset --script-args "-t 90 --disable-test ClusterObjectTests.TestTimedRequestTimeout" +```shell +./scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-no-ble-no-wifi-tsan-clang/chip-all-clusters-app --factory-reset --script-args "-t 90 --disable-test ClusterObjectTests.TestTimedRequestTimeout" ``` will pass `-t 90 --disable-test ClusterObjectTests.TestTimedRequestTimeout` to diff --git a/docs/testing/python.md b/docs/testing/python.md index 00a9c3fc31..a957074e3c 100644 --- a/docs/testing/python.md +++ b/docs/testing/python.md @@ -61,7 +61,7 @@ Python tests located in src/python_testing # --passcode 20202021 # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto -# factoryreset: true +# factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === @@ -627,7 +627,9 @@ for the CI). These arguments can be passed as sets of key/value pairs using the `./scripts/tests/run_python_test.py` is a convenient script that starts an example DUT on the host and includes factory reset support -`./scripts/tests/run_python_test.py --factoryreset --app --app-args "whatever" --script --script-args "whatever"` +```shell +./scripts/tests/run_python_test.py --factory-reset --app --app-args "whatever" --script --script-args "whatever" +``` # Running tests in CI @@ -678,7 +680,7 @@ for that run, e.g.: # app: ${TYPE_OF_APP} # app-args: # script-args: -# factoryreset: +# factory-reset: # quiet: # === END CI TEST ARGUMENTS === ``` @@ -692,7 +694,7 @@ for that run, e.g.: - Example: `${TYPE_OF_APP}` -- `factoryreset`: Determines whether a factory reset should be performed +- `factory-reset`: Determines whether a factory reset should be performed before the test. - Example: `true` diff --git a/scripts/tests/TestTimeSyncTrustedTimeSourceRunner.py b/scripts/tests/TestTimeSyncTrustedTimeSourceRunner.py index 567bf146c7..0753c7aed1 100755 --- a/scripts/tests/TestTimeSyncTrustedTimeSourceRunner.py +++ b/scripts/tests/TestTimeSyncTrustedTimeSourceRunner.py @@ -57,9 +57,9 @@ def run_test_section(self, app_args: str, script_args: str, factory_reset_all: b cmd = self.get_base_run_python_cmd(self.run_python_test_path, self.app_path, app_args, self.script_path, script_args) if factory_reset_all: - cmd = cmd + ' --factoryreset' + cmd = cmd + ' --factory-reset' if factory_reset_app: - cmd = cmd + ' --factoryreset-app-only' + cmd = cmd + ' --factory-reset-app-only' logging.info(f'Running cmd {cmd}') diff --git a/src/controller/python/test/test_scripts/mobile-device-test.py b/src/controller/python/test/test_scripts/mobile-device-test.py index 5515fa1ba0..cb032bc3ac 100755 --- a/src/controller/python/test/test_scripts/mobile-device-test.py +++ b/src/controller/python/test/test_scripts/mobile-device-test.py @@ -33,7 +33,7 @@ # --disable-test ClusterObjectTests.TestTimedRequestTimeout # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto -# factoryreset: true +# factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === diff --git a/src/python_testing/TCP_Tests.py b/src/python_testing/TCP_Tests.py index 41e5c2c356..849b3a9c07 100644 --- a/src/python_testing/TCP_Tests.py +++ b/src/python_testing/TCP_Tests.py @@ -26,7 +26,7 @@ # --passcode 20202021 # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto -# factoryreset: true +# factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === # diff --git a/src/python_testing/TC_ACE_1_2.py b/src/python_testing/TC_ACE_1_2.py index 7d227f5a5c..4955cbd3ff 100644 --- a/src/python_testing/TC_ACE_1_2.py +++ b/src/python_testing/TC_ACE_1_2.py @@ -22,7 +22,7 @@ # test-runner-runs: # run1: # app: ${ALL_CLUSTERS_APP} -# factoryreset: true +# factory-reset: true # quiet: true # app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json # script-args: > diff --git a/src/python_testing/TC_ACE_1_3.py b/src/python_testing/TC_ACE_1_3.py index 9fb5227c69..9e2108896d 100644 --- a/src/python_testing/TC_ACE_1_3.py +++ b/src/python_testing/TC_ACE_1_3.py @@ -22,7 +22,7 @@ # test-runner-runs: # run1: # app: ${ALL_CLUSTERS_APP} -# factoryreset: true +# factory-reset: true # quiet: true # app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json # script-args: > diff --git a/src/python_testing/TC_ACE_1_4.py b/src/python_testing/TC_ACE_1_4.py index 4d6e00ec1c..0afdf03ede 100644 --- a/src/python_testing/TC_ACE_1_4.py +++ b/src/python_testing/TC_ACE_1_4.py @@ -34,7 +34,7 @@ # --string-arg PIXIT.ACE.APPATTRIBUTE:OnOff # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto -# factoryreset: true +# factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === diff --git a/src/python_testing/TC_ACE_1_5.py b/src/python_testing/TC_ACE_1_5.py index cda418737a..9766e9a0c6 100644 --- a/src/python_testing/TC_ACE_1_5.py +++ b/src/python_testing/TC_ACE_1_5.py @@ -22,7 +22,7 @@ # test-runner-runs: # run1: # app: ${ALL_CLUSTERS_APP} -# factoryreset: true +# factory-reset: true # quiet: true # app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json # script-args: > diff --git a/src/python_testing/TC_ACL_2_11.py b/src/python_testing/TC_ACL_2_11.py index 88ef1d26ce..9f4aea3218 100644 --- a/src/python_testing/TC_ACL_2_11.py +++ b/src/python_testing/TC_ACL_2_11.py @@ -22,7 +22,7 @@ # test-runner-runs: # run1: # app: ${NETWORK_MANAGEMENT_APP} -# factoryreset: true +# factory-reset: true # quiet: true # app-args: > # --discriminator 1234 --KVS kvs1 diff --git a/src/python_testing/TC_ACL_2_2.py b/src/python_testing/TC_ACL_2_2.py index b0880b096b..219be92b35 100644 --- a/src/python_testing/TC_ACL_2_2.py +++ b/src/python_testing/TC_ACL_2_2.py @@ -19,7 +19,7 @@ # test-runner-runs: # run1: # app: ${ALL_CLUSTERS_APP} -# factoryreset: true +# factory-reset: true # quiet: true # app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json # script-args: > diff --git a/src/python_testing/TC_AccessChecker.py b/src/python_testing/TC_AccessChecker.py index a2429ee354..23e8535f51 100644 --- a/src/python_testing/TC_AccessChecker.py +++ b/src/python_testing/TC_AccessChecker.py @@ -5,7 +5,7 @@ # test-runner-runs: # run1: # app: ${ALL_CLUSTERS_APP} -# factoryreset: true +# factory-reset: true # quiet: true # app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json # script-args: > diff --git a/src/python_testing/TC_BOOLCFG_2_1.py b/src/python_testing/TC_BOOLCFG_2_1.py index 1eae9fc5de..27e016da52 100644 --- a/src/python_testing/TC_BOOLCFG_2_1.py +++ b/src/python_testing/TC_BOOLCFG_2_1.py @@ -16,12 +16,19 @@ # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import functools diff --git a/src/python_testing/TC_BOOLCFG_3_1.py b/src/python_testing/TC_BOOLCFG_3_1.py index 7446afd4b4..4b3156bbe9 100644 --- a/src/python_testing/TC_BOOLCFG_3_1.py +++ b/src/python_testing/TC_BOOLCFG_3_1.py @@ -16,12 +16,19 @@ # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_BOOLCFG_4_1.py b/src/python_testing/TC_BOOLCFG_4_1.py index 3240c27ea2..3cd7f3a9b2 100644 --- a/src/python_testing/TC_BOOLCFG_4_1.py +++ b/src/python_testing/TC_BOOLCFG_4_1.py @@ -16,12 +16,19 @@ # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_BOOLCFG_4_2.py b/src/python_testing/TC_BOOLCFG_4_2.py index b1496c4987..7897847acc 100644 --- a/src/python_testing/TC_BOOLCFG_4_2.py +++ b/src/python_testing/TC_BOOLCFG_4_2.py @@ -16,12 +16,24 @@ # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --enable-key 000102030405060708090a0b0c0d0e0f --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 --hex-arg PIXIT.BOOLCFG.TEST_EVENT_TRIGGER_KEY:000102030405060708090a0b0c0d0e0f --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --enable-key 000102030405060708090a0b0c0d0e0f +# --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg PIXIT.BOOLCFG.TEST_EVENT_TRIGGER_KEY:000102030405060708090a0b0c0d0e0f +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_BOOLCFG_4_3.py b/src/python_testing/TC_BOOLCFG_4_3.py index ea7ba2cac5..aeb245a9be 100644 --- a/src/python_testing/TC_BOOLCFG_4_3.py +++ b/src/python_testing/TC_BOOLCFG_4_3.py @@ -16,12 +16,24 @@ # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --enable-key 000102030405060708090a0b0c0d0e0f --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 --hex-arg PIXIT.BOOLCFG.TEST_EVENT_TRIGGER_KEY:000102030405060708090a0b0c0d0e0f --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --enable-key 000102030405060708090a0b0c0d0e0f +# --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg PIXIT.BOOLCFG.TEST_EVENT_TRIGGER_KEY:000102030405060708090a0b0c0d0e0f +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_BOOLCFG_4_4.py b/src/python_testing/TC_BOOLCFG_4_4.py index 2ae6dae2c7..66a1d06c05 100644 --- a/src/python_testing/TC_BOOLCFG_4_4.py +++ b/src/python_testing/TC_BOOLCFG_4_4.py @@ -16,12 +16,24 @@ # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --enable-key 000102030405060708090a0b0c0d0e0f --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 --hex-arg PIXIT.BOOLCFG.TEST_EVENT_TRIGGER_KEY:000102030405060708090a0b0c0d0e0f --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --enable-key 000102030405060708090a0b0c0d0e0f +# --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg PIXIT.BOOLCFG.TEST_EVENT_TRIGGER_KEY:000102030405060708090a0b0c0d0e0f +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_BOOLCFG_5_1.py b/src/python_testing/TC_BOOLCFG_5_1.py index f99fb3d8e4..cef0eae01b 100644 --- a/src/python_testing/TC_BOOLCFG_5_1.py +++ b/src/python_testing/TC_BOOLCFG_5_1.py @@ -16,12 +16,24 @@ # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --enable-key 000102030405060708090a0b0c0d0e0f --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 --hex-arg PIXIT.BOOLCFG.TEST_EVENT_TRIGGER_KEY:000102030405060708090a0b0c0d0e0f --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --enable-key 000102030405060708090a0b0c0d0e0f +# --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg PIXIT.BOOLCFG.TEST_EVENT_TRIGGER_KEY:000102030405060708090a0b0c0d0e0f +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_BOOLCFG_5_2.py b/src/python_testing/TC_BOOLCFG_5_2.py index cd176faf60..6ab8c82be6 100644 --- a/src/python_testing/TC_BOOLCFG_5_2.py +++ b/src/python_testing/TC_BOOLCFG_5_2.py @@ -16,12 +16,24 @@ # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --enable-key 000102030405060708090a0b0c0d0e0f --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 --hex-arg PIXIT.BOOLCFG.TEST_EVENT_TRIGGER_KEY:000102030405060708090a0b0c0d0e0f --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --enable-key 000102030405060708090a0b0c0d0e0f +# --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg PIXIT.BOOLCFG.TEST_EVENT_TRIGGER_KEY:000102030405060708090a0b0c0d0e0f +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_BRBINFO_4_1.py b/src/python_testing/TC_BRBINFO_4_1.py index f0c194ac2b..07b6fc2745 100644 --- a/src/python_testing/TC_BRBINFO_4_1.py +++ b/src/python_testing/TC_BRBINFO_4_1.py @@ -33,7 +33,7 @@ # --string-arg th_icd_server_app_path:${LIT_ICD_APP} dut_fsa_stdin_pipe:dut-fsa-stdin # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto -# factoryreset: true +# factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === diff --git a/src/python_testing/TC_CADMIN_1_9.py b/src/python_testing/TC_CADMIN_1_9.py index c3d67b9bf6..060a540017 100644 --- a/src/python_testing/TC_CADMIN_1_9.py +++ b/src/python_testing/TC_CADMIN_1_9.py @@ -15,12 +15,20 @@ # limitations under the License. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto --PICS src/app/tests/suites/certification/ci-pics-values +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# --PICS src/app/tests/suites/certification/ci-pics-values +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_CCTRL_2_1.py b/src/python_testing/TC_CCTRL_2_1.py index dfc6859815..c689dd649b 100644 --- a/src/python_testing/TC_CCTRL_2_1.py +++ b/src/python_testing/TC_CCTRL_2_1.py @@ -33,7 +33,7 @@ # --endpoint 0 # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto -# factoryreset: true +# factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === diff --git a/src/python_testing/TC_CCTRL_2_2.py b/src/python_testing/TC_CCTRL_2_2.py index ea2918fcc0..9ccb50b387 100644 --- a/src/python_testing/TC_CCTRL_2_2.py +++ b/src/python_testing/TC_CCTRL_2_2.py @@ -34,7 +34,7 @@ # --string-arg th_server_app_path:${ALL_CLUSTERS_APP} # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto -# factoryreset: true +# factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === diff --git a/src/python_testing/TC_CCTRL_2_3.py b/src/python_testing/TC_CCTRL_2_3.py index c5ccaa8377..07d5706a22 100644 --- a/src/python_testing/TC_CCTRL_2_3.py +++ b/src/python_testing/TC_CCTRL_2_3.py @@ -34,7 +34,7 @@ # --string-arg th_server_app_path:${ALL_CLUSTERS_APP} # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto -# factoryreset: true +# factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === diff --git a/src/python_testing/TC_CC_10_1.py b/src/python_testing/TC_CC_10_1.py index dee2dfad44..2cbbf0fe9a 100644 --- a/src/python_testing/TC_CC_10_1.py +++ b/src/python_testing/TC_CC_10_1.py @@ -19,12 +19,21 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 --endpoint 1 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --endpoint 1 +# --PICS src/app/tests/suites/certification/ci-pics-values +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import asyncio diff --git a/src/python_testing/TC_CC_2_2.py b/src/python_testing/TC_CC_2_2.py index c575ae81f5..647bee1528 100644 --- a/src/python_testing/TC_CC_2_2.py +++ b/src/python_testing/TC_CC_2_2.py @@ -19,12 +19,21 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --PICS src/app/tests/suites/certification/ci-pics-values +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_CGEN_2_4.py b/src/python_testing/TC_CGEN_2_4.py index 09fbc6d593..1cf2f7e8a0 100644 --- a/src/python_testing/TC_CGEN_2_4.py +++ b/src/python_testing/TC_CGEN_2_4.py @@ -19,12 +19,19 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_CNET_1_4.py b/src/python_testing/TC_CNET_1_4.py index 58f885c9d5..7e19f8dee9 100644 --- a/src/python_testing/TC_CNET_1_4.py +++ b/src/python_testing/TC_CNET_1_4.py @@ -19,12 +19,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_DA_1_2.py b/src/python_testing/TC_DA_1_2.py index a8b9dbf3cd..9fa60cd8bf 100644 --- a/src/python_testing/TC_DA_1_2.py +++ b/src/python_testing/TC_DA_1_2.py @@ -19,12 +19,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import os diff --git a/src/python_testing/TC_DA_1_5.py b/src/python_testing/TC_DA_1_5.py index d37f236a9f..c08f4eb4ef 100644 --- a/src/python_testing/TC_DA_1_5.py +++ b/src/python_testing/TC_DA_1_5.py @@ -19,12 +19,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import random diff --git a/src/python_testing/TC_DA_1_7.py b/src/python_testing/TC_DA_1_7.py index be1e466002..1130a7b423 100644 --- a/src/python_testing/TC_DA_1_7.py +++ b/src/python_testing/TC_DA_1_7.py @@ -19,12 +19,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 --bool-arg allow_sdk_dac:true --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --bool-arg allow_sdk_dac:true +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_DEM_2_1.py b/src/python_testing/TC_DEM_2_1.py index 1cad8aca0c..4975d3ae29 100644 --- a/src/python_testing/TC_DEM_2_1.py +++ b/src/python_testing/TC_DEM_2_1.py @@ -19,12 +19,27 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_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 --enable-key 000102030405060708090a0b0c0d0e0f --featureSet 0x7e -# 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 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# --featureSet 0x7e +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --PICS src/app/tests/suites/certification/ci-pics-values +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === """Define Matter test case TC_DEM_2_1.""" diff --git a/src/python_testing/TC_DEM_2_10.py b/src/python_testing/TC_DEM_2_10.py index fb837adf57..8f2e0baf35 100644 --- a/src/python_testing/TC_DEM_2_10.py +++ b/src/python_testing/TC_DEM_2_10.py @@ -19,12 +19,26 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_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 --enable-key 000102030405060708090a0b0c0d0e0f --featureSet 0x7b -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# --featureSet 0x7b +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === """Define Matter test case TC_DEM_2_10.""" diff --git a/src/python_testing/TC_DEM_2_2.py b/src/python_testing/TC_DEM_2_2.py index b180da13d2..b5e26e4336 100644 --- a/src/python_testing/TC_DEM_2_2.py +++ b/src/python_testing/TC_DEM_2_2.py @@ -19,12 +19,27 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_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 --enable-key 000102030405060708090a0b0c0d0e0f --featureSet 0x01 --application evse -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# --featureSet 0x01 +# --application evse +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === """Define Matter test case TC_DEM_2_2.""" diff --git a/src/python_testing/TC_DEM_2_3.py b/src/python_testing/TC_DEM_2_3.py index 69b44cc730..25398b41ea 100644 --- a/src/python_testing/TC_DEM_2_3.py +++ b/src/python_testing/TC_DEM_2_3.py @@ -18,12 +18,27 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_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 --enable-key 000102030405060708090a0b0c0d0e0f --featureSet 0xa --application evse -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# --featureSet 0xa +# --application evse +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_DEM_2_4.py b/src/python_testing/TC_DEM_2_4.py index d611172cb9..6a396fc3a3 100644 --- a/src/python_testing/TC_DEM_2_4.py +++ b/src/python_testing/TC_DEM_2_4.py @@ -18,12 +18,27 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_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 --enable-key 000102030405060708090a0b0c0d0e0f --featureSet 0x12 --application evse -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# --featureSet 0x12 +# --application evse +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_DEM_2_5.py b/src/python_testing/TC_DEM_2_5.py index 0a5547fd4a..f7f7d75d53 100644 --- a/src/python_testing/TC_DEM_2_5.py +++ b/src/python_testing/TC_DEM_2_5.py @@ -19,12 +19,27 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_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 --enable-key 000102030405060708090a0b0c0d0e0f --featureSet 0x22 --application evse -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# --featureSet 0x22 +# --application evse +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === """Define Matter test case TC_DEM_2_5.""" diff --git a/src/python_testing/TC_DEM_2_6.py b/src/python_testing/TC_DEM_2_6.py index 012ff88d26..2e2a96f92b 100644 --- a/src/python_testing/TC_DEM_2_6.py +++ b/src/python_testing/TC_DEM_2_6.py @@ -19,12 +19,27 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_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 --enable-key 000102030405060708090a0b0c0d0e0f --featureSet 0x7c --application evse -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# --featureSet 0x7c +# --application evse +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === """Define Matter test case TC_DEM_2_6.""" diff --git a/src/python_testing/TC_DEM_2_7.py b/src/python_testing/TC_DEM_2_7.py index b693f6e646..36e7ab984a 100644 --- a/src/python_testing/TC_DEM_2_7.py +++ b/src/python_testing/TC_DEM_2_7.py @@ -19,12 +19,27 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_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 --enable-key 000102030405060708090a0b0c0d0e0f --featureSet 0x7a --application evse -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# --featureSet 0x7a +# --application evse +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === """Define Matter test case TC_DEM_2_7.""" diff --git a/src/python_testing/TC_DEM_2_8.py b/src/python_testing/TC_DEM_2_8.py index a54baca2e2..1f3d240b22 100644 --- a/src/python_testing/TC_DEM_2_8.py +++ b/src/python_testing/TC_DEM_2_8.py @@ -19,12 +19,27 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_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 --enable-key 000102030405060708090a0b0c0d0e0f --featureSet 0x7c --application evse -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# --featureSet 0x7c +# --application evse +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === """Define Matter test case TC_DEM_2_8.""" diff --git a/src/python_testing/TC_DEM_2_9.py b/src/python_testing/TC_DEM_2_9.py index 935a04064d..4541b9cc6e 100644 --- a/src/python_testing/TC_DEM_2_9.py +++ b/src/python_testing/TC_DEM_2_9.py @@ -19,12 +19,27 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_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 --enable-key 000102030405060708090a0b0c0d0e0f --featureSet 0x7c --application evse -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# --featureSet 0x7c +# --application evse +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === """Define Matter test case TC_DEM_2_9.""" diff --git a/src/python_testing/TC_DGGEN_2_4.py b/src/python_testing/TC_DGGEN_2_4.py index ee80d927a9..27542e651d 100644 --- a/src/python_testing/TC_DGGEN_2_4.py +++ b/src/python_testing/TC_DGGEN_2_4.py @@ -19,12 +19,19 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import asyncio diff --git a/src/python_testing/TC_DGSW_2_1.py b/src/python_testing/TC_DGSW_2_1.py index c9411611e0..46ed696da9 100644 --- a/src/python_testing/TC_DGSW_2_1.py +++ b/src/python_testing/TC_DGSW_2_1.py @@ -19,12 +19,19 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === # diff --git a/src/python_testing/TC_DRLK_2_12.py b/src/python_testing/TC_DRLK_2_12.py index 3321ea303b..cf63bd810a 100644 --- a/src/python_testing/TC_DRLK_2_12.py +++ b/src/python_testing/TC_DRLK_2_12.py @@ -19,12 +19,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_LOCK_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 +# test-runner-runs: +# run1: +# app: ${CHIP_LOCK_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === from drlk_2_x_common import DRLK_COMMON diff --git a/src/python_testing/TC_DRLK_2_13.py b/src/python_testing/TC_DRLK_2_13.py index a26297d5c1..dc1b69da22 100644 --- a/src/python_testing/TC_DRLK_2_13.py +++ b/src/python_testing/TC_DRLK_2_13.py @@ -18,12 +18,21 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_LOCK_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 --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${CHIP_LOCK_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --PICS src/app/tests/suites/certification/ci-pics-values +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_DRLK_2_2.py b/src/python_testing/TC_DRLK_2_2.py index 9a04e9d5fd..84a511b98d 100644 --- a/src/python_testing/TC_DRLK_2_2.py +++ b/src/python_testing/TC_DRLK_2_2.py @@ -19,12 +19,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_LOCK_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 +# test-runner-runs: +# run1: +# app: ${CHIP_LOCK_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === from drlk_2_x_common import DRLK_COMMON diff --git a/src/python_testing/TC_DRLK_2_3.py b/src/python_testing/TC_DRLK_2_3.py index 3171ed28b4..75690865cf 100644 --- a/src/python_testing/TC_DRLK_2_3.py +++ b/src/python_testing/TC_DRLK_2_3.py @@ -19,12 +19,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_LOCK_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 +# test-runner-runs: +# run1: +# app: ${CHIP_LOCK_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === from drlk_2_x_common import DRLK_COMMON diff --git a/src/python_testing/TC_DRLK_2_5.py b/src/python_testing/TC_DRLK_2_5.py index a43067b05b..defe78eafd 100644 --- a/src/python_testing/TC_DRLK_2_5.py +++ b/src/python_testing/TC_DRLK_2_5.py @@ -18,12 +18,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_LOCK_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 +# test-runner-runs: +# run1: +# app: ${CHIP_LOCK_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_DRLK_2_9.py b/src/python_testing/TC_DRLK_2_9.py index 954ca7dd7b..b92eaf42b5 100644 --- a/src/python_testing/TC_DRLK_2_9.py +++ b/src/python_testing/TC_DRLK_2_9.py @@ -18,12 +18,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_LOCK_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 +# test-runner-runs: +# run1: +# app: ${CHIP_LOCK_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_DeviceBasicComposition.py b/src/python_testing/TC_DeviceBasicComposition.py index 31d8bfb76c..9ff05d4ab0 100644 --- a/src/python_testing/TC_DeviceBasicComposition.py +++ b/src/python_testing/TC_DeviceBasicComposition.py @@ -19,54 +19,73 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 run2 run3 run4 run5 run6 run7 run8 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 --manual-code 10054912339 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto -# -# test-runner-run/run2/app: ${CHIP_LOCK_APP} -# test-runner-run/run2/factoryreset: True -# test-runner-run/run2/quiet: True -# test-runner-run/run2/app-args: --discriminator 1234 --KVS kvs1 -# test-runner-run/run2/script-args: --storage-path admin_storage.json --manual-code 10054912339 -# -# test-runner-run/run3/app: ${CHIP_LOCK_APP} -# test-runner-run/run3/factoryreset: True -# test-runner-run/run3/quiet: True -# test-runner-run/run3/app-args: --discriminator 1234 --KVS kvs1 -# test-runner-run/run3/script-args: --storage-path admin_storage.json --qr-code MT:-24J0Q1212-10648G00 -# -# test-runner-run/run4/app: ${CHIP_LOCK_APP} -# test-runner-run/run4/factoryreset: True -# test-runner-run/run4/quiet: True -# test-runner-run/run4/app-args: --discriminator 1234 --KVS kvs1 -# test-runner-run/run4/script-args: --storage-path admin_storage.json --discriminator 1234 --passcode 20202021 -# -# test-runner-run/run5/app: ${CHIP_LOCK_APP} -# test-runner-run/run5/factoryreset: True -# test-runner-run/run5/quiet: True -# test-runner-run/run5/app-args: --discriminator 1234 --KVS kvs1 -# test-runner-run/run5/script-args: --storage-path admin_storage.json --manual-code 10054912339 --commissioning-method on-network -# -# test-runner-run/run6/app: ${CHIP_LOCK_APP} -# test-runner-run/run6/factoryreset: True -# test-runner-run/run6/quiet: True -# test-runner-run/run6/app-args: --discriminator 1234 --KVS kvs1 -# test-runner-run/run6/script-args: --storage-path admin_storage.json --qr-code MT:-24J0Q1212-10648G00 --commissioning-method on-network -# -# test-runner-run/run7/app: ${CHIP_LOCK_APP} -# test-runner-run/run7/factoryreset: True -# test-runner-run/run7/quiet: True -# test-runner-run/run7/app-args: --discriminator 1234 --KVS kvs1 -# test-runner-run/run7/script-args: --storage-path admin_storage.json --discriminator 1234 --passcode 20202021 --commissioning-method on-network -# -# test-runner-run/run8/app: ${CHIP_LOCK_APP} -# test-runner-run/run8/factoryreset: False -# test-runner-run/run8/quiet: True -# test-runner-run/run8/app-args: --discriminator 1234 --KVS kvs1 -# test-runner-run/run8/script-args: --storage-path admin_storage.json +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --manual-code 10054912339 +# --PICS src/app/tests/suites/certification/ci-pics-values +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true +# run2: +# app: ${CHIP_LOCK_APP} +# app-args: --discriminator 1234 --KVS kvs1 +# script-args: --storage-path admin_storage.json --manual-code 10054912339 +# factory-reset: true +# quiet: true +# run3: +# app: ${CHIP_LOCK_APP} +# app-args: --discriminator 1234 --KVS kvs1 +# script-args: --storage-path admin_storage.json --qr-code MT:-24J0Q1212-10648G00 +# factory-reset: true +# quiet: true +# run4: +# app: ${CHIP_LOCK_APP} +# app-args: --discriminator 1234 --KVS kvs1 +# script-args: > +# --storage-path admin_storage.json +# --discriminator 1234 +# --passcode 20202021 +# factory-reset: true +# quiet: true +# run5: +# app: ${CHIP_LOCK_APP} +# app-args: --discriminator 1234 --KVS kvs1 +# script-args: > +# --storage-path admin_storage.json +# --manual-code 10054912339 +# --commissioning-method on-network +# factory-reset: true +# quiet: true +# run6: +# app: ${CHIP_LOCK_APP} +# app-args: --discriminator 1234 --KVS kvs1 +# script-args: > +# --storage-path admin_storage.json +# --qr-code MT:-24J0Q1212-10648G00 +# --commissioning-method on-network +# factory-reset: true +# quiet: true +# run7: +# app: ${CHIP_LOCK_APP} +# app-args: --discriminator 1234 --KVS kvs1 +# script-args: > +# --storage-path admin_storage.json +# --discriminator 1234 +# --passcode 20202021 +# --commissioning-method on-network +# factory-reset: true +# quiet: true +# run8: +# app: ${CHIP_LOCK_APP} +# app-args: --discriminator 1234 --KVS kvs1 +# script-args: --storage-path admin_storage.json +# factory-reset: false +# quiet: true # === END CI TEST ARGUMENTS === # Run 1: runs through all tests diff --git a/src/python_testing/TC_DeviceConformance.py b/src/python_testing/TC_DeviceConformance.py index 2d03e8f326..8e700b49ab 100644 --- a/src/python_testing/TC_DeviceConformance.py +++ b/src/python_testing/TC_DeviceConformance.py @@ -19,12 +19,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_LOCK_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 --manual-code 10054912339 --bool-arg ignore_in_progress:True allow_provisional:True --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto --tests test_TC_IDM_10_2 +# test-runner-runs: +# run1: +# app: ${CHIP_LOCK_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --manual-code 10054912339 +# --bool-arg ignore_in_progress:True allow_provisional:True +# --PICS src/app/tests/suites/certification/ci-pics-values +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# --tests test_TC_IDM_10_2 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === # TODO: Enable 10.5 in CI once the door lock OTA requestor problem is sorted. diff --git a/src/python_testing/TC_ECOINFO_2_1.py b/src/python_testing/TC_ECOINFO_2_1.py index cd966e4c14..1cb6ec203a 100644 --- a/src/python_testing/TC_ECOINFO_2_1.py +++ b/src/python_testing/TC_ECOINFO_2_1.py @@ -33,7 +33,7 @@ # --string-arg th_server_app_path:${ALL_CLUSTERS_APP} dut_fsa_stdin_pipe:dut-fsa-stdin # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto -# factoryreset: true +# factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === diff --git a/src/python_testing/TC_ECOINFO_2_2.py b/src/python_testing/TC_ECOINFO_2_2.py index 41d7fc0770..85868a9468 100644 --- a/src/python_testing/TC_ECOINFO_2_2.py +++ b/src/python_testing/TC_ECOINFO_2_2.py @@ -33,7 +33,7 @@ # --string-arg th_server_app_path:${ALL_CLUSTERS_APP} dut_fsa_stdin_pipe:dut-fsa-stdin # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto -# factoryreset: true +# factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === diff --git a/src/python_testing/TC_EEM_2_1.py b/src/python_testing/TC_EEM_2_1.py index d5a2c07511..0b6b4809a4 100644 --- a/src/python_testing/TC_EEM_2_1.py +++ b/src/python_testing/TC_EEM_2_1.py @@ -18,12 +18,25 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_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 --enable-key 000102030405060708090a0b0c0d0e0f -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_EEM_2_2.py b/src/python_testing/TC_EEM_2_2.py index fd2d5c828f..6058aa34c5 100644 --- a/src/python_testing/TC_EEM_2_2.py +++ b/src/python_testing/TC_EEM_2_2.py @@ -18,12 +18,25 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_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 --enable-key 000102030405060708090a0b0c0d0e0f -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import time diff --git a/src/python_testing/TC_EEM_2_3.py b/src/python_testing/TC_EEM_2_3.py index 927ec9aea2..6e8bd7d9f5 100644 --- a/src/python_testing/TC_EEM_2_3.py +++ b/src/python_testing/TC_EEM_2_3.py @@ -18,12 +18,25 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_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 --enable-key 000102030405060708090a0b0c0d0e0f -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import time diff --git a/src/python_testing/TC_EEM_2_4.py b/src/python_testing/TC_EEM_2_4.py index dbc89f1934..fb5d5f6b36 100644 --- a/src/python_testing/TC_EEM_2_4.py +++ b/src/python_testing/TC_EEM_2_4.py @@ -18,12 +18,25 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_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 --enable-key 000102030405060708090a0b0c0d0e0f -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import time diff --git a/src/python_testing/TC_EEM_2_5.py b/src/python_testing/TC_EEM_2_5.py index 95f01ebc15..1408e2b9f6 100644 --- a/src/python_testing/TC_EEM_2_5.py +++ b/src/python_testing/TC_EEM_2_5.py @@ -18,12 +18,25 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_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 --enable-key 000102030405060708090a0b0c0d0e0f -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import time diff --git a/src/python_testing/TC_EEVSE_2_2.py b/src/python_testing/TC_EEVSE_2_2.py index 152f08de26..61e52ed0be 100644 --- a/src/python_testing/TC_EEVSE_2_2.py +++ b/src/python_testing/TC_EEVSE_2_2.py @@ -18,12 +18,26 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_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 --enable-key 000102030405060708090a0b0c0d0e0f --application evse -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# --application evse +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_EEVSE_2_3.py b/src/python_testing/TC_EEVSE_2_3.py index d3c3c46ea2..92005f345b 100644 --- a/src/python_testing/TC_EEVSE_2_3.py +++ b/src/python_testing/TC_EEVSE_2_3.py @@ -18,12 +18,26 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_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 --enable-key 000102030405060708090a0b0c0d0e0f --application evse -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# --application evse +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_EEVSE_2_4.py b/src/python_testing/TC_EEVSE_2_4.py index c7e855bf23..aaebf642b1 100644 --- a/src/python_testing/TC_EEVSE_2_4.py +++ b/src/python_testing/TC_EEVSE_2_4.py @@ -18,12 +18,26 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_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 --enable-key 000102030405060708090a0b0c0d0e0f --application evse -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# --application evse +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_EEVSE_2_5.py b/src/python_testing/TC_EEVSE_2_5.py index 5e057f7808..b25cfe16ce 100644 --- a/src/python_testing/TC_EEVSE_2_5.py +++ b/src/python_testing/TC_EEVSE_2_5.py @@ -18,12 +18,26 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_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 --enable-key 000102030405060708090a0b0c0d0e0f --application evse -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# --application evse +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_EEVSE_2_6.py b/src/python_testing/TC_EEVSE_2_6.py index 575d64cd3c..8f809b4ada 100644 --- a/src/python_testing/TC_EEVSE_2_6.py +++ b/src/python_testing/TC_EEVSE_2_6.py @@ -18,12 +18,26 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_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 --enable-key 000102030405060708090a0b0c0d0e0f --application evse -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# --application evse +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_EPM_2_1.py b/src/python_testing/TC_EPM_2_1.py index 81f0406a18..f12cafea66 100644 --- a/src/python_testing/TC_EPM_2_1.py +++ b/src/python_testing/TC_EPM_2_1.py @@ -18,12 +18,25 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_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 --enable-key 000102030405060708090a0b0c0d0e0f -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_EPM_2_2.py b/src/python_testing/TC_EPM_2_2.py index 1ca497f4fa..97e9e047d2 100644 --- a/src/python_testing/TC_EPM_2_2.py +++ b/src/python_testing/TC_EPM_2_2.py @@ -18,12 +18,25 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_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 --enable-key 000102030405060708090a0b0c0d0e0f -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_EWATERHTR_2_1.py b/src/python_testing/TC_EWATERHTR_2_1.py index 8ee466a547..ced3b16b3d 100644 --- a/src/python_testing/TC_EWATERHTR_2_1.py +++ b/src/python_testing/TC_EWATERHTR_2_1.py @@ -38,7 +38,7 @@ # --endpoint 1 # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto -# factoryreset: true +# factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === diff --git a/src/python_testing/TC_EWATERHTR_2_2.py b/src/python_testing/TC_EWATERHTR_2_2.py index 49c0fdc2de..11e8d545b5 100644 --- a/src/python_testing/TC_EWATERHTR_2_2.py +++ b/src/python_testing/TC_EWATERHTR_2_2.py @@ -19,12 +19,27 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_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 --enable-key 000102030405060708090a0b0c0d0e0f --featureSet 0x00 --application water-heater -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# --featureSet 0x00 +# --application water-heater +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === diff --git a/src/python_testing/TC_EWATERHTR_2_3.py b/src/python_testing/TC_EWATERHTR_2_3.py index f502dfac18..5f7df8c160 100644 --- a/src/python_testing/TC_EWATERHTR_2_3.py +++ b/src/python_testing/TC_EWATERHTR_2_3.py @@ -18,12 +18,27 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_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 --enable-key 000102030405060708090a0b0c0d0e0f --featureSet 0x03 --application water-heater -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# --featureSet 0x03 +# --application water-heater +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === diff --git a/src/python_testing/TC_FAN_3_1.py b/src/python_testing/TC_FAN_3_1.py index 9e4477e9a2..f8322506e6 100644 --- a/src/python_testing/TC_FAN_3_1.py +++ b/src/python_testing/TC_FAN_3_1.py @@ -19,12 +19,19 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_FAN_3_2.py b/src/python_testing/TC_FAN_3_2.py index e38706313d..736c97096e 100644 --- a/src/python_testing/TC_FAN_3_2.py +++ b/src/python_testing/TC_FAN_3_2.py @@ -19,12 +19,19 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_FAN_3_3.py b/src/python_testing/TC_FAN_3_3.py index a70c457aed..935811de21 100644 --- a/src/python_testing/TC_FAN_3_3.py +++ b/src/python_testing/TC_FAN_3_3.py @@ -19,12 +19,19 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_FAN_3_4.py b/src/python_testing/TC_FAN_3_4.py index 95a2240c4e..722339357b 100644 --- a/src/python_testing/TC_FAN_3_4.py +++ b/src/python_testing/TC_FAN_3_4.py @@ -19,12 +19,19 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging @@ -34,7 +41,7 @@ from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts -#import time +# import time logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_FAN_3_5.py b/src/python_testing/TC_FAN_3_5.py index a80e4b15aa..d03f99e55f 100644 --- a/src/python_testing/TC_FAN_3_5.py +++ b/src/python_testing/TC_FAN_3_5.py @@ -19,12 +19,19 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_ICDM_2_1.py b/src/python_testing/TC_ICDM_2_1.py index 25b7897aba..35d1cb62c0 100644 --- a/src/python_testing/TC_ICDM_2_1.py +++ b/src/python_testing/TC_ICDM_2_1.py @@ -19,12 +19,20 @@ # 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 +# test-runner-runs: +# run1: +# app: ${LIT_ICD_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_ICDM_3_1.py b/src/python_testing/TC_ICDM_3_1.py index f6f094698c..d46d72553d 100644 --- a/src/python_testing/TC_ICDM_3_1.py +++ b/src/python_testing/TC_ICDM_3_1.py @@ -20,12 +20,20 @@ # 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 +# test-runner-runs: +# run1: +# app: ${LIT_ICD_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_ICDM_3_2.py b/src/python_testing/TC_ICDM_3_2.py index 5a194420c3..924c6f4a01 100644 --- a/src/python_testing/TC_ICDM_3_2.py +++ b/src/python_testing/TC_ICDM_3_2.py @@ -20,12 +20,20 @@ # 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 +# test-runner-runs: +# run1: +# app: ${LIT_ICD_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_ICDM_3_3.py b/src/python_testing/TC_ICDM_3_3.py index cb8d1bd7bc..bc1d698071 100644 --- a/src/python_testing/TC_ICDM_3_3.py +++ b/src/python_testing/TC_ICDM_3_3.py @@ -20,12 +20,20 @@ # 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 +# test-runner-runs: +# run1: +# app: ${LIT_ICD_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_ICDM_3_4.py b/src/python_testing/TC_ICDM_3_4.py index b8d0693acb..4ebb32525c 100644 --- a/src/python_testing/TC_ICDM_3_4.py +++ b/src/python_testing/TC_ICDM_3_4.py @@ -20,12 +20,20 @@ # 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 +# test-runner-runs: +# run1: +# app: ${LIT_ICD_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_ICDM_5_1.py b/src/python_testing/TC_ICDM_5_1.py index f9c081b6fe..4b7222b690 100644 --- a/src/python_testing/TC_ICDM_5_1.py +++ b/src/python_testing/TC_ICDM_5_1.py @@ -19,12 +19,20 @@ # 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 +# test-runner-runs: +# run1: +# app: ${LIT_ICD_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_ICDManagementCluster.py b/src/python_testing/TC_ICDManagementCluster.py index 9f54e9b7dc..07c889a6ea 100644 --- a/src/python_testing/TC_ICDManagementCluster.py +++ b/src/python_testing/TC_ICDManagementCluster.py @@ -18,12 +18,24 @@ # 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 --enable-key 000102030405060708090a0b0c0d0e0f -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${LIT_ICD_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import ctypes diff --git a/src/python_testing/TC_IDM_1_2.py b/src/python_testing/TC_IDM_1_2.py index d5985c8ae9..7bfb97c22e 100644 --- a/src/python_testing/TC_IDM_1_2.py +++ b/src/python_testing/TC_IDM_1_2.py @@ -19,12 +19,19 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import inspect diff --git a/src/python_testing/TC_IDM_1_4.py b/src/python_testing/TC_IDM_1_4.py index fcfb5915ed..b00de41f37 100644 --- a/src/python_testing/TC_IDM_1_4.py +++ b/src/python_testing/TC_IDM_1_4.py @@ -19,12 +19,24 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 --enable-key 000102030405060708090a0b0c0d0e0f -# test-runner-run/run1/script-args: --hex-arg PIXIT.DGGEN.TEST_EVENT_TRIGGER_KEY:000102030405060708090a0b0c0d0e0f --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# script-args: > +# --hex-arg PIXIT.DGGEN.TEST_EVENT_TRIGGER_KEY:000102030405060708090a0b0c0d0e0f +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_IDM_4_2.py b/src/python_testing/TC_IDM_4_2.py index 8cd84011a4..d9e876bcd0 100644 --- a/src/python_testing/TC_IDM_4_2.py +++ b/src/python_testing/TC_IDM_4_2.py @@ -19,12 +19,19 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import copy diff --git a/src/python_testing/TC_LVL_2_3.py b/src/python_testing/TC_LVL_2_3.py index dcb2e8d65d..94c33d58c0 100644 --- a/src/python_testing/TC_LVL_2_3.py +++ b/src/python_testing/TC_LVL_2_3.py @@ -19,12 +19,21 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_MICROWAVE_OVEN_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 --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${CHIP_MICROWAVE_OVEN_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --PICS src/app/tests/suites/certification/ci-pics-values +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_MCORE_FS_1_1.py b/src/python_testing/TC_MCORE_FS_1_1.py index c30c1ec1b2..bd33e693dc 100755 --- a/src/python_testing/TC_MCORE_FS_1_1.py +++ b/src/python_testing/TC_MCORE_FS_1_1.py @@ -35,7 +35,7 @@ # --string-arg th_server_app_path:${ALL_CLUSTERS_APP} # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto -# factoryreset: true +# factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === diff --git a/src/python_testing/TC_MCORE_FS_1_2.py b/src/python_testing/TC_MCORE_FS_1_2.py index f7e88870dd..a7d318ca65 100644 --- a/src/python_testing/TC_MCORE_FS_1_2.py +++ b/src/python_testing/TC_MCORE_FS_1_2.py @@ -33,7 +33,7 @@ # --string-arg th_server_app_path:${ALL_CLUSTERS_APP} dut_fsa_stdin_pipe:dut-fsa-stdin # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto -# factoryreset: true +# factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === diff --git a/src/python_testing/TC_MCORE_FS_1_3.py b/src/python_testing/TC_MCORE_FS_1_3.py index 7dcca366a4..1b17aec1fd 100644 --- a/src/python_testing/TC_MCORE_FS_1_3.py +++ b/src/python_testing/TC_MCORE_FS_1_3.py @@ -37,7 +37,7 @@ # --string-arg th_server_no_uid_app_path:${LIGHTING_APP_NO_UNIQUE_ID} # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto -# factoryreset: true +# factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === diff --git a/src/python_testing/TC_MCORE_FS_1_4.py b/src/python_testing/TC_MCORE_FS_1_4.py index 90d1960649..74a8becdf7 100644 --- a/src/python_testing/TC_MCORE_FS_1_4.py +++ b/src/python_testing/TC_MCORE_FS_1_4.py @@ -36,7 +36,7 @@ # --string-arg th_fsa_app_path:examples/fabric-admin/scripts/fabric-sync-app.py th_fsa_admin_path:${FABRIC_ADMIN_APP} th_fsa_bridge_path:${FABRIC_BRIDGE_APP} th_server_no_uid_app_path:${LIGHTING_APP_NO_UNIQUE_ID} dut_fsa_stdin_pipe:dut-fsa-stdin # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto -# factoryreset: true +# factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === diff --git a/src/python_testing/TC_MCORE_FS_1_5.py b/src/python_testing/TC_MCORE_FS_1_5.py index 9b7e32b1d9..57ae214a5d 100755 --- a/src/python_testing/TC_MCORE_FS_1_5.py +++ b/src/python_testing/TC_MCORE_FS_1_5.py @@ -33,7 +33,7 @@ # --string-arg th_server_app_path:${ALL_CLUSTERS_APP} dut_fsa_stdin_pipe:dut-fsa-stdin # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto -# factoryreset: true +# factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === diff --git a/src/python_testing/TC_MWOCTRL_2_1.py b/src/python_testing/TC_MWOCTRL_2_1.py index 0de3bee72e..57c51fa98d 100644 --- a/src/python_testing/TC_MWOCTRL_2_1.py +++ b/src/python_testing/TC_MWOCTRL_2_1.py @@ -19,12 +19,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_MICROWAVE_OVEN_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 +# test-runner-runs: +# run1: +# app: ${CHIP_MICROWAVE_OVEN_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import chip.clusters as Clusters diff --git a/src/python_testing/TC_MWOCTRL_2_2.py b/src/python_testing/TC_MWOCTRL_2_2.py index 0edc2ac661..35eef081a9 100644 --- a/src/python_testing/TC_MWOCTRL_2_2.py +++ b/src/python_testing/TC_MWOCTRL_2_2.py @@ -19,12 +19,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_MICROWAVE_OVEN_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 +# test-runner-runs: +# run1: +# app: ${CHIP_MICROWAVE_OVEN_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_MWOCTRL_2_4.py b/src/python_testing/TC_MWOCTRL_2_4.py index fce17c4175..9e11724975 100644 --- a/src/python_testing/TC_MWOCTRL_2_4.py +++ b/src/python_testing/TC_MWOCTRL_2_4.py @@ -19,12 +19,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_MICROWAVE_OVEN_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 +# test-runner-runs: +# run1: +# app: ${CHIP_MICROWAVE_OVEN_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_MWOM_1_2.py b/src/python_testing/TC_MWOM_1_2.py index 7d29c3f43e..8a7762337e 100644 --- a/src/python_testing/TC_MWOM_1_2.py +++ b/src/python_testing/TC_MWOM_1_2.py @@ -19,12 +19,19 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_MICROWAVE_OVEN_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 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${CHIP_MICROWAVE_OVEN_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_OCC_2_1.py b/src/python_testing/TC_OCC_2_1.py index 6d135395d4..885ec6b16c 100644 --- a/src/python_testing/TC_OCC_2_1.py +++ b/src/python_testing/TC_OCC_2_1.py @@ -23,12 +23,21 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 --endpoint 1 +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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 +# --endpoint 1 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_OCC_2_2.py b/src/python_testing/TC_OCC_2_2.py index 9914452342..463b8136d5 100644 --- a/src/python_testing/TC_OCC_2_2.py +++ b/src/python_testing/TC_OCC_2_2.py @@ -19,12 +19,21 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 --endpoint 1 +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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 +# --endpoint 1 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import chip.clusters as Clusters diff --git a/src/python_testing/TC_OCC_2_3.py b/src/python_testing/TC_OCC_2_3.py index 384f5bf63f..9c6cb80d9a 100644 --- a/src/python_testing/TC_OCC_2_3.py +++ b/src/python_testing/TC_OCC_2_3.py @@ -15,12 +15,21 @@ # limitations under the License. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto --endpoint 1 --bool-arg simulate_occupancy:true +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# --endpoint 1 +# --bool-arg simulate_occupancy:true +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === # There are CI issues to be followed up for the test cases below that implements manually controlling sensor device for # the occupancy state ON/OFF change. diff --git a/src/python_testing/TC_OCC_3_1.py b/src/python_testing/TC_OCC_3_1.py index cfec9a8653..b6ba0ead01 100644 --- a/src/python_testing/TC_OCC_3_1.py +++ b/src/python_testing/TC_OCC_3_1.py @@ -1,203 +1,213 @@ -# -# 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. -# -# === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto --endpoint 1 --bool-arg simulate_occupancy:true -# === END CI TEST ARGUMENTS === -# There are CI issues to be followed up for the test cases below that implements manually controlling sensor device for -# the occupancy state ON/OFF change. -# [TC-OCC-3.1] test procedure step 3, 4 -# [TC-OCC-3.2] test precedure step 3a, 3c - -import logging -import time -from typing import Any, Optional - -import chip.clusters as Clusters -from chip.interaction_model import Status -from matter_testing_support import (ClusterAttributeChangeAccumulator, EventChangeCallback, MatterBaseTest, TestStep, - async_test_body, await_sequence_of_reports, default_matter_test_main) -from mobly import asserts - - -class TC_OCC_3_1(MatterBaseTest): - def setup_test(self): - super().setup_test() - self.is_ci = self.matter_test_config.global_test_params.get('simulate_occupancy', False) - - async def read_occ_attribute_expect_success(self, attribute): - cluster = Clusters.Objects.OccupancySensing - endpoint = self.matter_test_config.endpoint - return await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=attribute) - - async def write_hold_time(self, hold_time: Optional[Any]) -> Status: - dev_ctrl = self.default_controller - node_id = self.dut_node_id - endpoint = self.matter_test_config.endpoint - - cluster = Clusters.OccupancySensing - write_result = await dev_ctrl.WriteAttribute(node_id, [(endpoint, cluster.Attributes.HoldTime(hold_time))]) - return write_result[0].Status - - def desc_TC_OCC_3_1(self) -> str: - return "[TC-OCC-3.1] Primary functionality with server as DUT" - - def steps_TC_OCC_3_1(self) -> list[TestStep]: - steps = [ - TestStep(1, "Commission DUT to TH.", is_commissioning=True), - TestStep(2, "If HoldTime is supported, TH writes HoldTime attribute to 10 sec on DUT."), - TestStep(3, "Prompt operator to await until DUT occupancy changes to unoccupied state."), - TestStep(4, "TH subscribes to Occupancy sensor attributes and events."), - TestStep("5a", "Prompt operator to trigger occupancy change."), - TestStep("5b", "TH reads Occupancy attribute from DUT. Verify occupancy changed to occupied and Occupancy attribute was reported as occupied."), - TestStep("5c", "If supported, verify OccupancyChangedEvent was reported as occupied."), - TestStep(6, "If HoldTime is supported, wait for HoldTime, otherwise prompt operator to wait until no longer occupied."), - TestStep("7a", "TH reads Occupancy attribute from DUT. Verify occupancy changed to unoccupied and Occupancy attribute was reported as unoccupied."), - TestStep("7b", "If supported, verify OccupancyChangedEvent was reported as unoccupied."), - ] - return steps - - def pics_TC_OCC_3_1(self) -> list[str]: - pics = [ - "OCC.S", - ] - return pics - - # Sends and out-of-band command to the all-clusters-app - def write_to_app_pipe(self, command): - # CI app pipe id creation - self.app_pipe = "/tmp/chip_all_clusters_fifo_" - if self.is_ci: - app_pid = self.matter_test_config.app_pid - if app_pid == 0: - asserts.fail("The --app-pid flag must be set when using named pipe") - self.app_pipe = self.app_pipe + str(app_pid) - - with open(self.app_pipe, "w") as app_pipe: - app_pipe.write(command + "\n") - # Delay for pipe command to be processed (otherwise tests are flaky) - time.sleep(0.001) - - @async_test_body - async def test_TC_OCC_3_1(self): - hold_time = 10 if not self.is_ci else 1.0 # 10 seconds for occupancy state hold time - - self.step(1) # Commissioning already done - - self.step(2) - - cluster = Clusters.OccupancySensing - attributes = cluster.Attributes - attribute_list = await self.read_occ_attribute_expect_success(attribute=attributes.AttributeList) - - has_hold_time = attributes.HoldTime.attribute_id in attribute_list - occupancy_event_supported = self.check_pics("OCC.M.OccupancyChange") or self.is_ci - - if has_hold_time: - # write HoldTimeLimits HoldtimeMin to be 10 sec. - await self.write_single_attribute(cluster.Attributes.HoldTime(hold_time)) - holdtime_dut = await self.read_occ_attribute_expect_success(attribute=attributes.HoldTime) - asserts.assert_equal(holdtime_dut, hold_time, "Hold time read-back does not match hold time written") - else: - logging.info("No HoldTime attribute supports. Will test only occupancy attribute triggering functionality only.") - - self.step(3) - - if self.is_ci: - # CI call to trigger unoccupied. - self.write_to_app_pipe('{"Name":"SetOccupancy", "EndpointId": 1, "Occupancy": 0}') - else: - self.wait_for_user_input( - prompt_msg="Type any letter and press ENTER after the sensor occupancy is unoccupied state (occupancy attribute = 0)") - - # check sensor occupancy state is 0 for the next test step - occupancy_dut = await self.read_occ_attribute_expect_success(attribute=attributes.Occupancy) - asserts.assert_equal(occupancy_dut, 0, "Occupancy attribute is not unoccupied.") - - self.step(4) - # Setup Occupancy attribute subscription here - endpoint_id = self.matter_test_config.endpoint - node_id = self.dut_node_id - dev_ctrl = self.default_controller - attrib_listener = ClusterAttributeChangeAccumulator(cluster) - await attrib_listener.start(dev_ctrl, node_id, endpoint=endpoint_id, min_interval_sec=0, max_interval_sec=30) - - if occupancy_event_supported: - event_listener = EventChangeCallback(cluster) - await event_listener.start(dev_ctrl, node_id, endpoint=endpoint_id, min_interval_sec=0, max_interval_sec=30) - - self.step("5a") - # CI call to trigger on - if self.is_ci: - self.write_to_app_pipe('{"Name":"SetOccupancy", "EndpointId": 1, "Occupancy": 1}') - else: - # Trigger occupancy sensor to change Occupancy attribute value to 1 => TESTER ACTION on DUT - self.wait_for_user_input(prompt_msg="Type any letter and press ENTER after a sensor occupancy is triggered.") - - # And then check if Occupancy attribute has changed. - self.step("5b") - occupancy_dut = await self.read_occ_attribute_expect_success(attribute=attributes.Occupancy) - asserts.assert_equal(occupancy_dut, 1, "Occupancy state is not changed to 1") - - # subscription verification - post_prompt_settle_delay_seconds = 1.0 if self.is_ci else 10.0 - await_sequence_of_reports(report_queue=attrib_listener.attribute_queue, endpoint_id=endpoint_id, attribute=cluster.Attributes.Occupancy, sequence=[ - 1], timeout_sec=post_prompt_settle_delay_seconds) - - if occupancy_event_supported: - self.step("5c") - event = event_listener.wait_for_event_report( - cluster.Events.OccupancyChanged, timeout_sec=post_prompt_settle_delay_seconds) - asserts.assert_equal(event.occupancy, 1, "Unexpected occupancy on OccupancyChanged") - else: - self.skip_step("5c") - - self.step(6) - if self.is_ci: - # CI call to trigger unoccupied. - self.write_to_app_pipe('{"Name":"SetOccupancy", "EndpointId": 1, "Occupancy": 0}') - - if has_hold_time: - time.sleep(hold_time + 2.0) # add some extra 2 seconds to ensure hold time has passed. - else: - self.wait_for_user_input( - prompt_msg="Type any letter and press ENTER after the sensor occupancy is back to unoccupied state (occupancy attribute = 0)") - - # Check if Occupancy attribute is back to 0 after HoldTime attribute period - # Tester should not be triggering the sensor for this test step. - self.step("7a") - occupancy_dut = await self.read_occ_attribute_expect_success(attribute=attributes.Occupancy) - asserts.assert_equal(occupancy_dut, 0, "Occupancy state is not back to 0 after HoldTime period") - - await_sequence_of_reports(report_queue=attrib_listener.attribute_queue, endpoint_id=endpoint_id, attribute=cluster.Attributes.Occupancy, sequence=[ - 0], timeout_sec=post_prompt_settle_delay_seconds) - - if occupancy_event_supported: - self.step("7b") - event = event_listener.wait_for_event_report( - cluster.Events.OccupancyChanged, timeout_sec=post_prompt_settle_delay_seconds) - asserts.assert_equal(event.occupancy, 0, "Unexpected occupancy on OccupancyChanged") - else: - self.skip_step("7b") - - -if __name__ == "__main__": - default_matter_test_main() +# +# 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. +# +# === BEGIN CI TEST ARGUMENTS === +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# --endpoint 1 +# --bool-arg simulate_occupancy:true +# factory-reset: true +# quiet: true +# === END CI TEST ARGUMENTS === +# +# There are CI issues to be followed up for the test cases below that implements manually controlling sensor device for +# the occupancy state ON/OFF change. +# [TC-OCC-3.1] test procedure step 3, 4 +# [TC-OCC-3.2] test precedure step 3a, 3c + +import logging +import time +from typing import Any, Optional + +import chip.clusters as Clusters +from chip.interaction_model import Status +from matter_testing_support import (ClusterAttributeChangeAccumulator, EventChangeCallback, MatterBaseTest, TestStep, + async_test_body, await_sequence_of_reports, default_matter_test_main) +from mobly import asserts + + +class TC_OCC_3_1(MatterBaseTest): + def setup_test(self): + super().setup_test() + self.is_ci = self.matter_test_config.global_test_params.get('simulate_occupancy', False) + + async def read_occ_attribute_expect_success(self, attribute): + cluster = Clusters.Objects.OccupancySensing + endpoint = self.matter_test_config.endpoint + return await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=attribute) + + async def write_hold_time(self, hold_time: Optional[Any]) -> Status: + dev_ctrl = self.default_controller + node_id = self.dut_node_id + endpoint = self.matter_test_config.endpoint + + cluster = Clusters.OccupancySensing + write_result = await dev_ctrl.WriteAttribute(node_id, [(endpoint, cluster.Attributes.HoldTime(hold_time))]) + return write_result[0].Status + + def desc_TC_OCC_3_1(self) -> str: + return "[TC-OCC-3.1] Primary functionality with server as DUT" + + def steps_TC_OCC_3_1(self) -> list[TestStep]: + steps = [ + TestStep(1, "Commission DUT to TH.", is_commissioning=True), + TestStep(2, "If HoldTime is supported, TH writes HoldTime attribute to 10 sec on DUT."), + TestStep(3, "Prompt operator to await until DUT occupancy changes to unoccupied state."), + TestStep(4, "TH subscribes to Occupancy sensor attributes and events."), + TestStep("5a", "Prompt operator to trigger occupancy change."), + TestStep("5b", "TH reads Occupancy attribute from DUT. Verify occupancy changed to occupied and Occupancy attribute was reported as occupied."), + TestStep("5c", "If supported, verify OccupancyChangedEvent was reported as occupied."), + TestStep(6, "If HoldTime is supported, wait for HoldTime, otherwise prompt operator to wait until no longer occupied."), + TestStep("7a", "TH reads Occupancy attribute from DUT. Verify occupancy changed to unoccupied and Occupancy attribute was reported as unoccupied."), + TestStep("7b", "If supported, verify OccupancyChangedEvent was reported as unoccupied."), + ] + return steps + + def pics_TC_OCC_3_1(self) -> list[str]: + pics = [ + "OCC.S", + ] + return pics + + # Sends and out-of-band command to the all-clusters-app + def write_to_app_pipe(self, command): + # CI app pipe id creation + self.app_pipe = "/tmp/chip_all_clusters_fifo_" + if self.is_ci: + app_pid = self.matter_test_config.app_pid + if app_pid == 0: + asserts.fail("The --app-pid flag must be set when using named pipe") + self.app_pipe = self.app_pipe + str(app_pid) + + with open(self.app_pipe, "w") as app_pipe: + app_pipe.write(command + "\n") + # Delay for pipe command to be processed (otherwise tests are flaky) + time.sleep(0.001) + + @async_test_body + async def test_TC_OCC_3_1(self): + hold_time = 10 if not self.is_ci else 1.0 # 10 seconds for occupancy state hold time + + self.step(1) # Commissioning already done + + self.step(2) + + cluster = Clusters.OccupancySensing + attributes = cluster.Attributes + attribute_list = await self.read_occ_attribute_expect_success(attribute=attributes.AttributeList) + + has_hold_time = attributes.HoldTime.attribute_id in attribute_list + occupancy_event_supported = self.check_pics("OCC.M.OccupancyChange") or self.is_ci + + if has_hold_time: + # write HoldTimeLimits HoldtimeMin to be 10 sec. + await self.write_single_attribute(cluster.Attributes.HoldTime(hold_time)) + holdtime_dut = await self.read_occ_attribute_expect_success(attribute=attributes.HoldTime) + asserts.assert_equal(holdtime_dut, hold_time, "Hold time read-back does not match hold time written") + else: + logging.info("No HoldTime attribute supports. Will test only occupancy attribute triggering functionality only.") + + self.step(3) + + if self.is_ci: + # CI call to trigger unoccupied. + self.write_to_app_pipe('{"Name":"SetOccupancy", "EndpointId": 1, "Occupancy": 0}') + else: + self.wait_for_user_input( + prompt_msg="Type any letter and press ENTER after the sensor occupancy is unoccupied state (occupancy attribute = 0)") + + # check sensor occupancy state is 0 for the next test step + occupancy_dut = await self.read_occ_attribute_expect_success(attribute=attributes.Occupancy) + asserts.assert_equal(occupancy_dut, 0, "Occupancy attribute is not unoccupied.") + + self.step(4) + # Setup Occupancy attribute subscription here + endpoint_id = self.matter_test_config.endpoint + node_id = self.dut_node_id + dev_ctrl = self.default_controller + attrib_listener = ClusterAttributeChangeAccumulator(cluster) + await attrib_listener.start(dev_ctrl, node_id, endpoint=endpoint_id, min_interval_sec=0, max_interval_sec=30) + + if occupancy_event_supported: + event_listener = EventChangeCallback(cluster) + await event_listener.start(dev_ctrl, node_id, endpoint=endpoint_id, min_interval_sec=0, max_interval_sec=30) + + self.step("5a") + # CI call to trigger on + if self.is_ci: + self.write_to_app_pipe('{"Name":"SetOccupancy", "EndpointId": 1, "Occupancy": 1}') + else: + # Trigger occupancy sensor to change Occupancy attribute value to 1 => TESTER ACTION on DUT + self.wait_for_user_input(prompt_msg="Type any letter and press ENTER after a sensor occupancy is triggered.") + + # And then check if Occupancy attribute has changed. + self.step("5b") + occupancy_dut = await self.read_occ_attribute_expect_success(attribute=attributes.Occupancy) + asserts.assert_equal(occupancy_dut, 1, "Occupancy state is not changed to 1") + + # subscription verification + post_prompt_settle_delay_seconds = 1.0 if self.is_ci else 10.0 + await_sequence_of_reports(report_queue=attrib_listener.attribute_queue, endpoint_id=endpoint_id, attribute=cluster.Attributes.Occupancy, sequence=[ + 1], timeout_sec=post_prompt_settle_delay_seconds) + + if occupancy_event_supported: + self.step("5c") + event = event_listener.wait_for_event_report( + cluster.Events.OccupancyChanged, timeout_sec=post_prompt_settle_delay_seconds) + asserts.assert_equal(event.occupancy, 1, "Unexpected occupancy on OccupancyChanged") + else: + self.skip_step("5c") + + self.step(6) + if self.is_ci: + # CI call to trigger unoccupied. + self.write_to_app_pipe('{"Name":"SetOccupancy", "EndpointId": 1, "Occupancy": 0}') + + if has_hold_time: + time.sleep(hold_time + 2.0) # add some extra 2 seconds to ensure hold time has passed. + else: + self.wait_for_user_input( + prompt_msg="Type any letter and press ENTER after the sensor occupancy is back to unoccupied state (occupancy attribute = 0)") + + # Check if Occupancy attribute is back to 0 after HoldTime attribute period + # Tester should not be triggering the sensor for this test step. + self.step("7a") + occupancy_dut = await self.read_occ_attribute_expect_success(attribute=attributes.Occupancy) + asserts.assert_equal(occupancy_dut, 0, "Occupancy state is not back to 0 after HoldTime period") + + await_sequence_of_reports(report_queue=attrib_listener.attribute_queue, endpoint_id=endpoint_id, attribute=cluster.Attributes.Occupancy, sequence=[ + 0], timeout_sec=post_prompt_settle_delay_seconds) + + if occupancy_event_supported: + self.step("7b") + event = event_listener.wait_for_event_report( + cluster.Events.OccupancyChanged, timeout_sec=post_prompt_settle_delay_seconds) + asserts.assert_equal(event.occupancy, 0, "Unexpected occupancy on OccupancyChanged") + else: + self.skip_step("7b") + + +if __name__ == "__main__": + default_matter_test_main() diff --git a/src/python_testing/TC_OCC_3_2.py b/src/python_testing/TC_OCC_3_2.py index c4049104fe..d4e5f18662 100644 --- a/src/python_testing/TC_OCC_3_2.py +++ b/src/python_testing/TC_OCC_3_2.py @@ -1,198 +1,207 @@ -# -# Copyright (c) 2024 Project CHIP (Matter) 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: ${ALL_CLUSTERS_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 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto --endpoint 1 --bool-arg simulate_occupancy:true -# === END CI TEST ARGUMENTS === - -# There are CI integration for the test cases below that implements manually controlling sensor device for -# the occupancy state ON/OFF change. -# [TC-OCC-3.1] test procedure step 3, 4 -# [TC-OCC-3.2] test precedure step 3a, 3c - -import logging -import time - -import chip.clusters as Clusters -from matter_testing_support import (AttributeValue, ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, async_test_body, - await_sequence_of_reports, default_matter_test_main) -from mobly import asserts - - -class TC_OCC_3_2(MatterBaseTest): - def setup_test(self): - super().setup_test() - self.is_ci = self.matter_test_config.global_test_params.get('simulate_occupancy', False) - - async def read_occ_attribute_expect_success(self, attribute): - cluster = Clusters.Objects.OccupancySensing - endpoint_id = self.matter_test_config.endpoint - return await self.read_single_attribute_check_success(endpoint=endpoint_id, cluster=cluster, attribute=attribute) - - def desc_TC_OCC_3_2(self) -> str: - return "[TC-OCC-3.2] Subscription Report Verification with server as DUT" - - def steps_TC_OCC_3_2(self) -> list[TestStep]: - steps = [ - TestStep(1, "Commission DUT to TH if not already done", is_commissioning=True), - TestStep(2, "TH establishes a wildcard subscription to all attributes on Occupancy Sensing Cluster on the endpoint under test. Subscription min interval = 0 and max interval = 30 seconds."), - TestStep("3a", "Prepare DUT to be unoccupied state."), - TestStep("3b", "TH reads DUT Occupancy attribute."), - TestStep("3c", "Trigger DUT to change the occupancy state."), - TestStep("3d", "TH awaits a ReportDataMessage containing an attribute report for DUT Occupancy attribute."), - TestStep("4a", "Check if DUT supports HoldTime attribute, If not supported, then stop and skip the rest of test cases."), - TestStep("4b", "TH writes HoldTimeMin to HoldTime attribute."), - TestStep("4c", "TH clears its report history and writes HoldTimeMax to HoldTime attribute."), - TestStep("4d", "TH awaits a ReportDataMessage containing an attribute report for DUT HoldTime attribute and all legacy attributes supported."), - ] - return steps - - def pics_TC_OCC_3_2(self) -> list[str]: - pics = [ - "OCC.S", - ] - return pics - - # Sends and out-of-band command to the all-clusters-app - def write_to_app_pipe(self, command): - # CI app pipe id creation - self.app_pipe = "/tmp/chip_all_clusters_fifo_" - if self.is_ci: - app_pid = self.matter_test_config.app_pid - if app_pid == 0: - asserts.fail("The --app-pid flag must be set when using named pipe") - self.app_pipe = self.app_pipe + str(app_pid) - - with open(self.app_pipe, "w") as app_pipe: - app_pipe.write(command + "\n") - # Delay for pipe command to be processed (otherwise tests are flaky) - time.sleep(0.001) - - @async_test_body - async def test_TC_OCC_3_2(self): - endpoint_id = self.matter_test_config.endpoint - node_id = self.dut_node_id - dev_ctrl = self.default_controller - - post_prompt_settle_delay_seconds = 10.0 - cluster = Clusters.Objects.OccupancySensing - attributes = cluster.Attributes - - self.step(1) # Commissioning already done - - self.step(2) - feature_map = await self.read_occ_attribute_expect_success(attribute=attributes.FeatureMap) - has_feature_pir = (feature_map & cluster.Bitmaps.Feature.kPassiveInfrared) != 0 - has_feature_ultrasonic = (feature_map & cluster.Bitmaps.Feature.kUltrasonic) != 0 - has_feature_contact = (feature_map & cluster.Bitmaps.Feature.kPhysicalContact) != 0 - - logging.info( - f"Feature map: 0x{feature_map:x}. PIR: {has_feature_pir}, US:{has_feature_ultrasonic}, PHY:{has_feature_contact}") - - attribute_list = await self.read_occ_attribute_expect_success(attribute=attributes.AttributeList) - has_pir_timing_attrib = attributes.PIROccupiedToUnoccupiedDelay.attribute_id in attribute_list - has_ultrasonic_timing_attrib = attributes.UltrasonicOccupiedToUnoccupiedDelay.attribute_id in attribute_list - has_contact_timing_attrib = attributes.PhysicalContactOccupiedToUnoccupiedDelay.attribute_id in attribute_list - logging.info(f"Attribute list: {attribute_list}") - logging.info(f"--> Has PIROccupiedToUnoccupiedDelay: {has_pir_timing_attrib}") - logging.info(f"--> Has UltrasonicOccupiedToUnoccupiedDelay: {has_ultrasonic_timing_attrib}") - logging.info(f"--> Has PhysicalContactOccupiedToUnoccupiedDelay: {has_contact_timing_attrib}") - - # min interval = 0, and max interval = 30 seconds - attrib_listener = ClusterAttributeChangeAccumulator(Clusters.Objects.OccupancySensing) - await attrib_listener.start(dev_ctrl, node_id, endpoint=endpoint_id, min_interval_sec=0, max_interval_sec=30) - - # add Namepiped to assimilate the manual sensor untrigger here - self.step("3a") - # CI call to trigger off - if self.is_ci: - self.write_to_app_pipe('{"Name":"SetOccupancy", "EndpointId": 1, "Occupancy": 0}') - else: - self.wait_for_user_input(prompt_msg="Type any letter and press ENTER after DUT goes back to unoccupied state.") - - self.step("3b") - initial_dut = await self.read_occ_attribute_expect_success(attribute=attributes.Occupancy) - asserts.assert_equal(initial_dut, 0, "Occupancy attribute is still detected state") - - # add Namepiped to assimilate the manual sensor trigger here - self.step("3c") - attrib_listener.reset() - - # CI call to trigger on - if self.is_ci: - self.write_to_app_pipe('{"Name":"SetOccupancy", "EndpointId": 1, "Occupancy": 1}') - else: - self.wait_for_user_input( - prompt_msg="Type any letter and press ENTER after the sensor occupancy is triggered and its occupancy state changed.") - - self.step("3d") - await_sequence_of_reports(report_queue=attrib_listener.attribute_queue, endpoint_id=endpoint_id, attribute=cluster.Attributes.Occupancy, sequence=[ - 1], timeout_sec=post_prompt_settle_delay_seconds) - - self.step("4a") - if attributes.HoldTime.attribute_id not in attribute_list: - logging.info("No HoldTime attribute supports. Terminate this test case") - self.skip_all_remaining_steps("4b") - - self.step("4b") - hold_time_limits_dut = await self.read_occ_attribute_expect_success(attribute=attributes.HoldTimeLimits) - hold_time_min = hold_time_limits_dut.holdTimeMin - hold_time_max = hold_time_limits_dut.holdTimeMax - await self.write_single_attribute(attributes.HoldTime(hold_time_min)) - hold_time_dut = await self.read_occ_attribute_expect_success(attribute=attributes.HoldTime) - asserts.assert_equal(hold_time_dut, hold_time_min, "HoldTime did not match written HoldTimeMin") - - # HoldTime may already have been HoldTimeMin, or not. Make sure we look only at subsequent reports. - attrib_listener.reset() - - self.step("4c") - await self.write_single_attribute(attributes.HoldTime(hold_time_max)) - hold_time_dut = await self.read_occ_attribute_expect_success(attribute=attributes.HoldTime) - asserts.assert_equal(hold_time_dut, hold_time_max, "HoldTime did not match written HoldTimeMax") - - self.step("4d") - has_no_legacy_features = ((not has_feature_pir) and (not has_feature_ultrasonic) and (not has_feature_contact)) - - expect_legacy_pir_timing = has_pir_timing_attrib and (has_feature_pir or has_no_legacy_features) - expect_legacy_us_timing = has_ultrasonic_timing_attrib and has_feature_ultrasonic - expect_legacy_phy_timing = has_contact_timing_attrib and has_feature_contact - - # Build list of expectations based on attributes present. - all_expected_final_values = [AttributeValue(endpoint_id, attribute=cluster.Attributes.HoldTime, value=hold_time_max)] - if expect_legacy_pir_timing: - all_expected_final_values.append(AttributeValue( - endpoint_id, attribute=cluster.Attributes.PIROccupiedToUnoccupiedDelay, value=hold_time_max)) - if expect_legacy_us_timing: - all_expected_final_values.append(AttributeValue( - endpoint_id, attribute=cluster.Attributes.UltrasonicOccupiedToUnoccupiedDelay, value=hold_time_max)) - if expect_legacy_phy_timing: - all_expected_final_values.append(AttributeValue( - endpoint_id, attribute=cluster.Attributes.PhysicalContactOccupiedToUnoccupiedDelay, value=hold_time_max)) - - # Wait for the reports to come. - attrib_listener.await_all_final_values_reported(all_expected_final_values, timeout_sec=post_prompt_settle_delay_seconds) - - -if __name__ == "__main__": - default_matter_test_main() +# +# Copyright (c) 2024 Project CHIP (Matter) 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: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# --endpoint 1 +# --bool-arg simulate_occupancy:true +# factory-reset: true +# quiet: true +# === END CI TEST ARGUMENTS === + +# There are CI integration for the test cases below that implements manually controlling sensor device for +# the occupancy state ON/OFF change. +# [TC-OCC-3.1] test procedure step 3, 4 +# [TC-OCC-3.2] test precedure step 3a, 3c + +import logging +import time + +import chip.clusters as Clusters +from matter_testing_support import (AttributeValue, ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, async_test_body, + await_sequence_of_reports, default_matter_test_main) +from mobly import asserts + + +class TC_OCC_3_2(MatterBaseTest): + def setup_test(self): + super().setup_test() + self.is_ci = self.matter_test_config.global_test_params.get('simulate_occupancy', False) + + async def read_occ_attribute_expect_success(self, attribute): + cluster = Clusters.Objects.OccupancySensing + endpoint_id = self.matter_test_config.endpoint + return await self.read_single_attribute_check_success(endpoint=endpoint_id, cluster=cluster, attribute=attribute) + + def desc_TC_OCC_3_2(self) -> str: + return "[TC-OCC-3.2] Subscription Report Verification with server as DUT" + + def steps_TC_OCC_3_2(self) -> list[TestStep]: + steps = [ + TestStep(1, "Commission DUT to TH if not already done", is_commissioning=True), + TestStep(2, "TH establishes a wildcard subscription to all attributes on Occupancy Sensing Cluster on the endpoint under test. Subscription min interval = 0 and max interval = 30 seconds."), + TestStep("3a", "Prepare DUT to be unoccupied state."), + TestStep("3b", "TH reads DUT Occupancy attribute."), + TestStep("3c", "Trigger DUT to change the occupancy state."), + TestStep("3d", "TH awaits a ReportDataMessage containing an attribute report for DUT Occupancy attribute."), + TestStep("4a", "Check if DUT supports HoldTime attribute, If not supported, then stop and skip the rest of test cases."), + TestStep("4b", "TH writes HoldTimeMin to HoldTime attribute."), + TestStep("4c", "TH clears its report history and writes HoldTimeMax to HoldTime attribute."), + TestStep("4d", "TH awaits a ReportDataMessage containing an attribute report for DUT HoldTime attribute and all legacy attributes supported."), + ] + return steps + + def pics_TC_OCC_3_2(self) -> list[str]: + pics = [ + "OCC.S", + ] + return pics + + # Sends and out-of-band command to the all-clusters-app + def write_to_app_pipe(self, command): + # CI app pipe id creation + self.app_pipe = "/tmp/chip_all_clusters_fifo_" + if self.is_ci: + app_pid = self.matter_test_config.app_pid + if app_pid == 0: + asserts.fail("The --app-pid flag must be set when using named pipe") + self.app_pipe = self.app_pipe + str(app_pid) + + with open(self.app_pipe, "w") as app_pipe: + app_pipe.write(command + "\n") + # Delay for pipe command to be processed (otherwise tests are flaky) + time.sleep(0.001) + + @async_test_body + async def test_TC_OCC_3_2(self): + endpoint_id = self.matter_test_config.endpoint + node_id = self.dut_node_id + dev_ctrl = self.default_controller + + post_prompt_settle_delay_seconds = 10.0 + cluster = Clusters.Objects.OccupancySensing + attributes = cluster.Attributes + + self.step(1) # Commissioning already done + + self.step(2) + feature_map = await self.read_occ_attribute_expect_success(attribute=attributes.FeatureMap) + has_feature_pir = (feature_map & cluster.Bitmaps.Feature.kPassiveInfrared) != 0 + has_feature_ultrasonic = (feature_map & cluster.Bitmaps.Feature.kUltrasonic) != 0 + has_feature_contact = (feature_map & cluster.Bitmaps.Feature.kPhysicalContact) != 0 + + logging.info( + f"Feature map: 0x{feature_map:x}. PIR: {has_feature_pir}, US:{has_feature_ultrasonic}, PHY:{has_feature_contact}") + + attribute_list = await self.read_occ_attribute_expect_success(attribute=attributes.AttributeList) + has_pir_timing_attrib = attributes.PIROccupiedToUnoccupiedDelay.attribute_id in attribute_list + has_ultrasonic_timing_attrib = attributes.UltrasonicOccupiedToUnoccupiedDelay.attribute_id in attribute_list + has_contact_timing_attrib = attributes.PhysicalContactOccupiedToUnoccupiedDelay.attribute_id in attribute_list + logging.info(f"Attribute list: {attribute_list}") + logging.info(f"--> Has PIROccupiedToUnoccupiedDelay: {has_pir_timing_attrib}") + logging.info(f"--> Has UltrasonicOccupiedToUnoccupiedDelay: {has_ultrasonic_timing_attrib}") + logging.info(f"--> Has PhysicalContactOccupiedToUnoccupiedDelay: {has_contact_timing_attrib}") + + # min interval = 0, and max interval = 30 seconds + attrib_listener = ClusterAttributeChangeAccumulator(Clusters.Objects.OccupancySensing) + await attrib_listener.start(dev_ctrl, node_id, endpoint=endpoint_id, min_interval_sec=0, max_interval_sec=30) + + # add Namepiped to assimilate the manual sensor untrigger here + self.step("3a") + # CI call to trigger off + if self.is_ci: + self.write_to_app_pipe('{"Name":"SetOccupancy", "EndpointId": 1, "Occupancy": 0}') + else: + self.wait_for_user_input(prompt_msg="Type any letter and press ENTER after DUT goes back to unoccupied state.") + + self.step("3b") + initial_dut = await self.read_occ_attribute_expect_success(attribute=attributes.Occupancy) + asserts.assert_equal(initial_dut, 0, "Occupancy attribute is still detected state") + + # add Namepiped to assimilate the manual sensor trigger here + self.step("3c") + attrib_listener.reset() + + # CI call to trigger on + if self.is_ci: + self.write_to_app_pipe('{"Name":"SetOccupancy", "EndpointId": 1, "Occupancy": 1}') + else: + self.wait_for_user_input( + prompt_msg="Type any letter and press ENTER after the sensor occupancy is triggered and its occupancy state changed.") + + self.step("3d") + await_sequence_of_reports(report_queue=attrib_listener.attribute_queue, endpoint_id=endpoint_id, attribute=cluster.Attributes.Occupancy, sequence=[ + 1], timeout_sec=post_prompt_settle_delay_seconds) + + self.step("4a") + if attributes.HoldTime.attribute_id not in attribute_list: + logging.info("No HoldTime attribute supports. Terminate this test case") + self.skip_all_remaining_steps("4b") + + self.step("4b") + hold_time_limits_dut = await self.read_occ_attribute_expect_success(attribute=attributes.HoldTimeLimits) + hold_time_min = hold_time_limits_dut.holdTimeMin + hold_time_max = hold_time_limits_dut.holdTimeMax + await self.write_single_attribute(attributes.HoldTime(hold_time_min)) + hold_time_dut = await self.read_occ_attribute_expect_success(attribute=attributes.HoldTime) + asserts.assert_equal(hold_time_dut, hold_time_min, "HoldTime did not match written HoldTimeMin") + + # HoldTime may already have been HoldTimeMin, or not. Make sure we look only at subsequent reports. + attrib_listener.reset() + + self.step("4c") + await self.write_single_attribute(attributes.HoldTime(hold_time_max)) + hold_time_dut = await self.read_occ_attribute_expect_success(attribute=attributes.HoldTime) + asserts.assert_equal(hold_time_dut, hold_time_max, "HoldTime did not match written HoldTimeMax") + + self.step("4d") + has_no_legacy_features = ((not has_feature_pir) and (not has_feature_ultrasonic) and (not has_feature_contact)) + + expect_legacy_pir_timing = has_pir_timing_attrib and (has_feature_pir or has_no_legacy_features) + expect_legacy_us_timing = has_ultrasonic_timing_attrib and has_feature_ultrasonic + expect_legacy_phy_timing = has_contact_timing_attrib and has_feature_contact + + # Build list of expectations based on attributes present. + all_expected_final_values = [AttributeValue(endpoint_id, attribute=cluster.Attributes.HoldTime, value=hold_time_max)] + if expect_legacy_pir_timing: + all_expected_final_values.append(AttributeValue( + endpoint_id, attribute=cluster.Attributes.PIROccupiedToUnoccupiedDelay, value=hold_time_max)) + if expect_legacy_us_timing: + all_expected_final_values.append(AttributeValue( + endpoint_id, attribute=cluster.Attributes.UltrasonicOccupiedToUnoccupiedDelay, value=hold_time_max)) + if expect_legacy_phy_timing: + all_expected_final_values.append(AttributeValue( + endpoint_id, attribute=cluster.Attributes.PhysicalContactOccupiedToUnoccupiedDelay, value=hold_time_max)) + + # Wait for the reports to come. + attrib_listener.await_all_final_values_reported(all_expected_final_values, timeout_sec=post_prompt_settle_delay_seconds) + + +if __name__ == "__main__": + default_matter_test_main() diff --git a/src/python_testing/TC_OPCREDS_3_1.py b/src/python_testing/TC_OPCREDS_3_1.py index dd92fd7a2f..be21c6d7d4 100644 --- a/src/python_testing/TC_OPCREDS_3_1.py +++ b/src/python_testing/TC_OPCREDS_3_1.py @@ -18,12 +18,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import copy import logging diff --git a/src/python_testing/TC_OPCREDS_3_2.py b/src/python_testing/TC_OPCREDS_3_2.py index 3eab07bc9d..91e2958fb0 100644 --- a/src/python_testing/TC_OPCREDS_3_2.py +++ b/src/python_testing/TC_OPCREDS_3_2.py @@ -19,12 +19,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import chip.clusters as Clusters diff --git a/src/python_testing/TC_OPSTATE_2_1.py b/src/python_testing/TC_OPSTATE_2_1.py index c3be8a438c..1b6966a09a 100644 --- a/src/python_testing/TC_OPSTATE_2_1.py +++ b/src/python_testing/TC_OPSTATE_2_1.py @@ -19,12 +19,21 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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: --endpoint 1 --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 +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --endpoint 1 +# --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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import chip.clusters as Clusters diff --git a/src/python_testing/TC_OPSTATE_2_2.py b/src/python_testing/TC_OPSTATE_2_2.py index 09e4c65918..8617d3ddd6 100644 --- a/src/python_testing/TC_OPSTATE_2_2.py +++ b/src/python_testing/TC_OPSTATE_2_2.py @@ -19,12 +19,22 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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: --endpoint 1 --int-arg PIXIT.WAITTIME.COUNTDOWN:5 --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 +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --endpoint 1 +# --int-arg PIXIT.WAITTIME.COUNTDOWN:5 +# --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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import chip.clusters as Clusters diff --git a/src/python_testing/TC_OPSTATE_2_3.py b/src/python_testing/TC_OPSTATE_2_3.py index b9a62b275c..3671747dee 100644 --- a/src/python_testing/TC_OPSTATE_2_3.py +++ b/src/python_testing/TC_OPSTATE_2_3.py @@ -19,12 +19,22 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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: --endpoint 1 --int-arg PIXIT.WAITTIME.COUNTDOWN:5 --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 +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --endpoint 1 +# --int-arg PIXIT.WAITTIME.COUNTDOWN:5 +# --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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === diff --git a/src/python_testing/TC_OPSTATE_2_4.py b/src/python_testing/TC_OPSTATE_2_4.py index 512802467f..d468227781 100644 --- a/src/python_testing/TC_OPSTATE_2_4.py +++ b/src/python_testing/TC_OPSTATE_2_4.py @@ -19,12 +19,22 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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: --endpoint 1 --int-arg PIXIT.OPSTATE.ErrorEventGen:1 --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 +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --endpoint 1 +# --int-arg PIXIT.OPSTATE.ErrorEventGen:1 +# --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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === diff --git a/src/python_testing/TC_OPSTATE_2_5.py b/src/python_testing/TC_OPSTATE_2_5.py index ad79765e88..687f4d21b0 100644 --- a/src/python_testing/TC_OPSTATE_2_5.py +++ b/src/python_testing/TC_OPSTATE_2_5.py @@ -19,12 +19,22 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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: --endpoint 1 --int-arg PIXIT.WAITTIME.REBOOT:5 --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 +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --endpoint 1 +# --int-arg PIXIT.WAITTIME.REBOOT:5 +# --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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === diff --git a/src/python_testing/TC_OPSTATE_2_6.py b/src/python_testing/TC_OPSTATE_2_6.py index d13f8a1e7e..9441569c87 100644 --- a/src/python_testing/TC_OPSTATE_2_6.py +++ b/src/python_testing/TC_OPSTATE_2_6.py @@ -19,12 +19,22 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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: --endpoint 1 --int-arg PIXIT.WAITTIME.REBOOT:5 --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 +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --endpoint 1 +# --int-arg PIXIT.WAITTIME.REBOOT:5 +# --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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === diff --git a/src/python_testing/TC_OVENOPSTATE_2_1.py b/src/python_testing/TC_OVENOPSTATE_2_1.py index 1d1a289080..6bf7226986 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_1.py +++ b/src/python_testing/TC_OVENOPSTATE_2_1.py @@ -19,12 +19,21 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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: --endpoint 1 --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 +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --endpoint 1 +# --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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === diff --git a/src/python_testing/TC_OVENOPSTATE_2_2.py b/src/python_testing/TC_OVENOPSTATE_2_2.py index 254464eaa6..2fa1215bd1 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_2.py +++ b/src/python_testing/TC_OVENOPSTATE_2_2.py @@ -19,12 +19,22 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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: --endpoint 1 --int-arg PIXIT.WAITTIME.COUNTDOWN:5 --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 +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --endpoint 1 +# --int-arg PIXIT.WAITTIME.COUNTDOWN:5 +# --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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import chip.clusters as Clusters diff --git a/src/python_testing/TC_OVENOPSTATE_2_3.py b/src/python_testing/TC_OVENOPSTATE_2_3.py index 77d4358788..815fcef97b 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_3.py +++ b/src/python_testing/TC_OVENOPSTATE_2_3.py @@ -19,12 +19,22 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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: --endpoint 1 --int-arg PIXIT.WAITTIME.COUNTDOWN:5 --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 +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --endpoint 1 +# --int-arg PIXIT.WAITTIME.COUNTDOWN:5 +# --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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import chip.clusters as Clusters diff --git a/src/python_testing/TC_OVENOPSTATE_2_4.py b/src/python_testing/TC_OVENOPSTATE_2_4.py index 70a3a6f020..892bf28f0d 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_4.py +++ b/src/python_testing/TC_OVENOPSTATE_2_4.py @@ -19,12 +19,22 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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: --endpoint 1 --int-arg PIXIT.OVENOPSTATE.ErrorEventGen:1 --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 +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --endpoint 1 +# --int-arg PIXIT.OVENOPSTATE.ErrorEventGen:1 +# --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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import chip.clusters as Clusters diff --git a/src/python_testing/TC_OVENOPSTATE_2_5.py b/src/python_testing/TC_OVENOPSTATE_2_5.py index 39edb670ff..4fd9ef9271 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_5.py +++ b/src/python_testing/TC_OVENOPSTATE_2_5.py @@ -19,12 +19,22 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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: --endpoint 1 --int-arg PIXIT.WAITTIME.REBOOT:5 --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 +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --endpoint 1 +# --int-arg PIXIT.WAITTIME.REBOOT:5 +# --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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === diff --git a/src/python_testing/TC_OVENOPSTATE_2_6.py b/src/python_testing/TC_OVENOPSTATE_2_6.py index 09436f4e76..db4b390027 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_6.py +++ b/src/python_testing/TC_OVENOPSTATE_2_6.py @@ -19,12 +19,22 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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: --endpoint 1 --int-arg PIXIT.WAITTIME.REBOOT:5 --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 +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --endpoint 1 +# --int-arg PIXIT.WAITTIME.REBOOT:5 +# --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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === diff --git a/src/python_testing/TC_PS_2_3.py b/src/python_testing/TC_PS_2_3.py index 72b54877dc..dbff20e6f4 100644 --- a/src/python_testing/TC_PS_2_3.py +++ b/src/python_testing/TC_PS_2_3.py @@ -19,12 +19,19 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_PWRTL_2_1.py b/src/python_testing/TC_PWRTL_2_1.py index 579398642a..639bd3dd9a 100644 --- a/src/python_testing/TC_PWRTL_2_1.py +++ b/src/python_testing/TC_PWRTL_2_1.py @@ -19,12 +19,19 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_RR_1_1.py b/src/python_testing/TC_RR_1_1.py index 0cb53a4fb4..2785171f94 100644 --- a/src/python_testing/TC_RR_1_1.py +++ b/src/python_testing/TC_RR_1_1.py @@ -19,12 +19,19 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import asyncio diff --git a/src/python_testing/TC_RVCCLEANM_1_2.py b/src/python_testing/TC_RVCCLEANM_1_2.py index d1b3018772..9e4bca4762 100644 --- a/src/python_testing/TC_RVCCLEANM_1_2.py +++ b/src/python_testing/TC_RVCCLEANM_1_2.py @@ -19,12 +19,21 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_RVC_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 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 +# test-runner-runs: +# run1: +# app: ${CHIP_RVC_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_RVCCLEANM_2_1.py b/src/python_testing/TC_RVCCLEANM_2_1.py index c9b8362eb2..2c4ddd1dc7 100644 --- a/src/python_testing/TC_RVCCLEANM_2_1.py +++ b/src/python_testing/TC_RVCCLEANM_2_1.py @@ -34,7 +34,7 @@ # --endpoint 1 # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto -# factoryreset: true +# factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === diff --git a/src/python_testing/TC_RVCCLEANM_2_2.py b/src/python_testing/TC_RVCCLEANM_2_2.py index ed63dd09c3..5262465555 100644 --- a/src/python_testing/TC_RVCCLEANM_2_2.py +++ b/src/python_testing/TC_RVCCLEANM_2_2.py @@ -19,12 +19,21 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_RVC_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 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 +# test-runner-runs: +# run1: +# app: ${CHIP_RVC_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import enum diff --git a/src/python_testing/TC_RVCOPSTATE_2_1.py b/src/python_testing/TC_RVCOPSTATE_2_1.py index b15fc92743..ae3e6c3930 100644 --- a/src/python_testing/TC_RVCOPSTATE_2_1.py +++ b/src/python_testing/TC_RVCOPSTATE_2_1.py @@ -19,12 +19,21 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_RVC_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 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 +# test-runner-runs: +# run1: +# app: ${CHIP_RVC_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_RVCOPSTATE_2_3.py b/src/python_testing/TC_RVCOPSTATE_2_3.py index e9dc801cc1..60bbed18bd 100644 --- a/src/python_testing/TC_RVCOPSTATE_2_3.py +++ b/src/python_testing/TC_RVCOPSTATE_2_3.py @@ -19,12 +19,21 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_RVC_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 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 +# test-runner-runs: +# run1: +# app: ${CHIP_RVC_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_RVCOPSTATE_2_4.py b/src/python_testing/TC_RVCOPSTATE_2_4.py index c7186a80ee..458b3cf740 100644 --- a/src/python_testing/TC_RVCOPSTATE_2_4.py +++ b/src/python_testing/TC_RVCOPSTATE_2_4.py @@ -19,12 +19,21 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_RVC_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 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 +# test-runner-runs: +# run1: +# app: ${CHIP_RVC_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_RVCRUNM_1_2.py b/src/python_testing/TC_RVCRUNM_1_2.py index 308e79ab26..d3040fdb6b 100644 --- a/src/python_testing/TC_RVCRUNM_1_2.py +++ b/src/python_testing/TC_RVCRUNM_1_2.py @@ -19,12 +19,21 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_RVC_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 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 +# test-runner-runs: +# run1: +# app: ${CHIP_RVC_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_RVCRUNM_2_1.py b/src/python_testing/TC_RVCRUNM_2_1.py index d3da69a6fa..850faf052a 100644 --- a/src/python_testing/TC_RVCRUNM_2_1.py +++ b/src/python_testing/TC_RVCRUNM_2_1.py @@ -34,7 +34,7 @@ # --int-arg PIXIT.RVCRUNM.MODE_CHANGE_FAIL:2 # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto -# factoryreset: true +# factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === diff --git a/src/python_testing/TC_RVCRUNM_2_2.py b/src/python_testing/TC_RVCRUNM_2_2.py index 0eefcc20a9..f53a75503b 100644 --- a/src/python_testing/TC_RVCRUNM_2_2.py +++ b/src/python_testing/TC_RVCRUNM_2_2.py @@ -34,7 +34,7 @@ # --int-arg PIXIT.RVCRUNM.MODE_B:2 # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto -# factoryreset: true +# factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === diff --git a/src/python_testing/TC_SC_3_6.py b/src/python_testing/TC_SC_3_6.py index 53353ea85f..74c09e2b72 100644 --- a/src/python_testing/TC_SC_3_6.py +++ b/src/python_testing/TC_SC_3_6.py @@ -19,12 +19,19 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === diff --git a/src/python_testing/TC_SC_7_1.py b/src/python_testing/TC_SC_7_1.py index b702bf438f..19229b38ec 100644 --- a/src/python_testing/TC_SC_7_1.py +++ b/src/python_testing/TC_SC_7_1.py @@ -19,12 +19,18 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 2222 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --bool-arg post_cert_test:true --qr-code MT:-24J0KCZ16750648G00 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 2222 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --bool-arg post_cert_test:true +# --qr-code MT:-24J0KCZ16750648G00 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === # Note that in the CI we are using the post-cert test as we can only start one app from the current script. diff --git a/src/python_testing/TC_SEAR_1_2.py b/src/python_testing/TC_SEAR_1_2.py index 1bed2c8d12..41482be51c 100644 --- a/src/python_testing/TC_SEAR_1_2.py +++ b/src/python_testing/TC_SEAR_1_2.py @@ -20,12 +20,21 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_RVC_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 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 +# test-runner-runs: +# run1: +# app: ${CHIP_RVC_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_SEAR_1_3.py b/src/python_testing/TC_SEAR_1_3.py index df4a1ddb51..9592bce3fe 100644 --- a/src/python_testing/TC_SEAR_1_3.py +++ b/src/python_testing/TC_SEAR_1_3.py @@ -20,12 +20,22 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_RVC_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 examples/rvc-app/rvc-common/pics/rvc-app-pics-values --endpoint 1 --json-arg PIXIT.SEAR.VALID_AREAS:'[7, 1234567]' --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${CHIP_RVC_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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 +# --json-arg PIXIT.SEAR.VALID_AREAS:'[7, 1234567]' +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_SEAR_1_4.py b/src/python_testing/TC_SEAR_1_4.py index d31dcc2b13..3f3a84bdf2 100644 --- a/src/python_testing/TC_SEAR_1_4.py +++ b/src/python_testing/TC_SEAR_1_4.py @@ -20,12 +20,21 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_RVC_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 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 +# test-runner-runs: +# run1: +# app: ${CHIP_RVC_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_SEAR_1_5.py b/src/python_testing/TC_SEAR_1_5.py index d4704d686a..99da6da78b 100644 --- a/src/python_testing/TC_SEAR_1_5.py +++ b/src/python_testing/TC_SEAR_1_5.py @@ -20,12 +20,21 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_RVC_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 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 +# test-runner-runs: +# run1: +# app: ${CHIP_RVC_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_SEAR_1_6.py b/src/python_testing/TC_SEAR_1_6.py index 8e94971c8b..434da00258 100644 --- a/src/python_testing/TC_SEAR_1_6.py +++ b/src/python_testing/TC_SEAR_1_6.py @@ -20,12 +20,21 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_RVC_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 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 +# test-runner-runs: +# run1: +# app: ${CHIP_RVC_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_SWTCH.py b/src/python_testing/TC_SWTCH.py index 4609043a3e..7cafaa7b55 100644 --- a/src/python_testing/TC_SWTCH.py +++ b/src/python_testing/TC_SWTCH.py @@ -18,32 +18,63 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 run2 run3 run4 -# -# test-runner-run/run1/app: ${ALL_CLUSTERS_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: --endpoint 1 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto --PICS src/app/tests/suites/certification/ci-pics-values -# -# test-runner-run/run2/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run2/factoryreset: True -# test-runner-run/run2/quiet: True -# test-runner-run/run2/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run2/script-args: --endpoint 2 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto --PICS src/app/tests/suites/certification/ci-pics-values -# -# test-runner-run/run3/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run3/factoryreset: True -# test-runner-run/run3/quiet: True -# test-runner-run/run3/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run3/script-args: --endpoint 3 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto --PICS src/app/tests/suites/certification/ci-pics-values -# -# test-runner-run/run4/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run4/factoryreset: True -# test-runner-run/run4/quiet: True -# test-runner-run/run4/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run4/script-args: --endpoint 4 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto --PICS src/app/tests/suites/certification/ci-pics-values -# +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --endpoint 1 +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# --PICS src/app/tests/suites/certification/ci-pics-values +# factory-reset: true +# quiet: true +# run2: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --endpoint 2 +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# --PICS src/app/tests/suites/certification/ci-pics-values +# factory-reset: true +# quiet: true +# run3: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --endpoint 3 +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# --PICS src/app/tests/suites/certification/ci-pics-values +# factory-reset: true +# quiet: true +# run4: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --endpoint 4 +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# --PICS src/app/tests/suites/certification/ci-pics-values +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === # # These tests run on every endpoint regardless of whether a switch is present because they are set up to auto-select. diff --git a/src/python_testing/TC_TIMESYNC_2_1.py b/src/python_testing/TC_TIMESYNC_2_1.py index 0f2fdba4d6..9858976520 100644 --- a/src/python_testing/TC_TIMESYNC_2_1.py +++ b/src/python_testing/TC_TIMESYNC_2_1.py @@ -19,12 +19,21 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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: --endpoint 0 --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 +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --endpoint 0 +# --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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import ipaddress diff --git a/src/python_testing/TC_TIMESYNC_2_10.py b/src/python_testing/TC_TIMESYNC_2_10.py index c7eb9860b9..b9aa7dabb7 100644 --- a/src/python_testing/TC_TIMESYNC_2_10.py +++ b/src/python_testing/TC_TIMESYNC_2_10.py @@ -19,12 +19,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import queue diff --git a/src/python_testing/TC_TIMESYNC_2_11.py b/src/python_testing/TC_TIMESYNC_2_11.py index 5815baeaca..1aaed7a14e 100644 --- a/src/python_testing/TC_TIMESYNC_2_11.py +++ b/src/python_testing/TC_TIMESYNC_2_11.py @@ -19,12 +19,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import queue diff --git a/src/python_testing/TC_TIMESYNC_2_12.py b/src/python_testing/TC_TIMESYNC_2_12.py index f530554591..cd4378fcdc 100644 --- a/src/python_testing/TC_TIMESYNC_2_12.py +++ b/src/python_testing/TC_TIMESYNC_2_12.py @@ -19,12 +19,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import queue diff --git a/src/python_testing/TC_TIMESYNC_2_13.py b/src/python_testing/TC_TIMESYNC_2_13.py index c667b71eda..91c679e14b 100644 --- a/src/python_testing/TC_TIMESYNC_2_13.py +++ b/src/python_testing/TC_TIMESYNC_2_13.py @@ -19,12 +19,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import queue diff --git a/src/python_testing/TC_TIMESYNC_2_2.py b/src/python_testing/TC_TIMESYNC_2_2.py index 83c07355d6..dff4bd5f82 100644 --- a/src/python_testing/TC_TIMESYNC_2_2.py +++ b/src/python_testing/TC_TIMESYNC_2_2.py @@ -19,12 +19,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === from datetime import timedelta diff --git a/src/python_testing/TC_TIMESYNC_2_4.py b/src/python_testing/TC_TIMESYNC_2_4.py index 21d98fd8ca..a367dcad3d 100644 --- a/src/python_testing/TC_TIMESYNC_2_4.py +++ b/src/python_testing/TC_TIMESYNC_2_4.py @@ -19,12 +19,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import typing diff --git a/src/python_testing/TC_TIMESYNC_2_5.py b/src/python_testing/TC_TIMESYNC_2_5.py index 5c19e37229..d62797e91e 100644 --- a/src/python_testing/TC_TIMESYNC_2_5.py +++ b/src/python_testing/TC_TIMESYNC_2_5.py @@ -19,12 +19,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import typing diff --git a/src/python_testing/TC_TIMESYNC_2_6.py b/src/python_testing/TC_TIMESYNC_2_6.py index deae112321..f6fe8738f4 100644 --- a/src/python_testing/TC_TIMESYNC_2_6.py +++ b/src/python_testing/TC_TIMESYNC_2_6.py @@ -19,12 +19,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import typing diff --git a/src/python_testing/TC_TIMESYNC_2_7.py b/src/python_testing/TC_TIMESYNC_2_7.py index a405aae1f9..edc71545cf 100644 --- a/src/python_testing/TC_TIMESYNC_2_7.py +++ b/src/python_testing/TC_TIMESYNC_2_7.py @@ -19,12 +19,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import time diff --git a/src/python_testing/TC_TIMESYNC_2_8.py b/src/python_testing/TC_TIMESYNC_2_8.py index 418d6e8e41..07785346c7 100644 --- a/src/python_testing/TC_TIMESYNC_2_8.py +++ b/src/python_testing/TC_TIMESYNC_2_8.py @@ -19,12 +19,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import time diff --git a/src/python_testing/TC_TIMESYNC_2_9.py b/src/python_testing/TC_TIMESYNC_2_9.py index 0fd6872d70..1f439b84e6 100644 --- a/src/python_testing/TC_TIMESYNC_2_9.py +++ b/src/python_testing/TC_TIMESYNC_2_9.py @@ -19,12 +19,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import typing diff --git a/src/python_testing/TC_TIMESYNC_3_1.py b/src/python_testing/TC_TIMESYNC_3_1.py index ad972345db..3f292d0e85 100644 --- a/src/python_testing/TC_TIMESYNC_3_1.py +++ b/src/python_testing/TC_TIMESYNC_3_1.py @@ -19,12 +19,19 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import chip.clusters as Clusters diff --git a/src/python_testing/TC_TSTAT_4_2.py b/src/python_testing/TC_TSTAT_4_2.py index 387aeab6a8..fa77f94ae7 100644 --- a/src/python_testing/TC_TSTAT_4_2.py +++ b/src/python_testing/TC_TSTAT_4_2.py @@ -18,12 +18,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import copy diff --git a/src/python_testing/TC_TestEventTrigger.py b/src/python_testing/TC_TestEventTrigger.py index 373fabf704..38053540c6 100644 --- a/src/python_testing/TC_TestEventTrigger.py +++ b/src/python_testing/TC_TestEventTrigger.py @@ -19,12 +19,24 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 --enable-key 000102030405060708090a0b0c0d0e0f -# test-runner-run/run1/script-args: --storage-path admin_storage.json --bool-arg allow_sdk_dac:true --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# script-args: > +# --storage-path admin_storage.json +# --bool-arg allow_sdk_dac:true +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_VALCC_2_1.py b/src/python_testing/TC_VALCC_2_1.py index ba9e98e3db..a079c88c8b 100644 --- a/src/python_testing/TC_VALCC_2_1.py +++ b/src/python_testing/TC_VALCC_2_1.py @@ -16,12 +16,19 @@ # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_VALCC_3_1.py b/src/python_testing/TC_VALCC_3_1.py index e24c09db66..f4c6ebfa14 100644 --- a/src/python_testing/TC_VALCC_3_1.py +++ b/src/python_testing/TC_VALCC_3_1.py @@ -16,12 +16,19 @@ # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import time diff --git a/src/python_testing/TC_VALCC_3_2.py b/src/python_testing/TC_VALCC_3_2.py index 9ef0886d8b..0609051f4e 100644 --- a/src/python_testing/TC_VALCC_3_2.py +++ b/src/python_testing/TC_VALCC_3_2.py @@ -16,12 +16,19 @@ # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_VALCC_3_3.py b/src/python_testing/TC_VALCC_3_3.py index ddf3ba83d1..d90065d5bb 100644 --- a/src/python_testing/TC_VALCC_3_3.py +++ b/src/python_testing/TC_VALCC_3_3.py @@ -16,12 +16,19 @@ # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_VALCC_3_4.py b/src/python_testing/TC_VALCC_3_4.py index 906854011a..f1363a51f3 100644 --- a/src/python_testing/TC_VALCC_3_4.py +++ b/src/python_testing/TC_VALCC_3_4.py @@ -16,12 +16,19 @@ # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_VALCC_4_1.py b/src/python_testing/TC_VALCC_4_1.py index 183151af61..a103898567 100644 --- a/src/python_testing/TC_VALCC_4_1.py +++ b/src/python_testing/TC_VALCC_4_1.py @@ -16,12 +16,19 @@ # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import time diff --git a/src/python_testing/TC_VALCC_4_2.py b/src/python_testing/TC_VALCC_4_2.py index 1114f034ca..f2f0dd6631 100644 --- a/src/python_testing/TC_VALCC_4_2.py +++ b/src/python_testing/TC_VALCC_4_2.py @@ -16,12 +16,19 @@ # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import time diff --git a/src/python_testing/TC_VALCC_4_3.py b/src/python_testing/TC_VALCC_4_3.py index cdb8c38ca7..a66d4eafd4 100644 --- a/src/python_testing/TC_VALCC_4_3.py +++ b/src/python_testing/TC_VALCC_4_3.py @@ -16,12 +16,19 @@ # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_VALCC_4_4.py b/src/python_testing/TC_VALCC_4_4.py index 4fd1692da3..f6ad63d368 100644 --- a/src/python_testing/TC_VALCC_4_4.py +++ b/src/python_testing/TC_VALCC_4_4.py @@ -16,12 +16,19 @@ # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_VALCC_4_5.py b/src/python_testing/TC_VALCC_4_5.py index b07f4281d1..3b850c0804 100644 --- a/src/python_testing/TC_VALCC_4_5.py +++ b/src/python_testing/TC_VALCC_4_5.py @@ -16,12 +16,19 @@ # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_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 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import time diff --git a/src/python_testing/TC_WHM_1_2.py b/src/python_testing/TC_WHM_1_2.py index b8727671d1..9d7d9b2879 100644 --- a/src/python_testing/TC_WHM_1_2.py +++ b/src/python_testing/TC_WHM_1_2.py @@ -16,12 +16,26 @@ # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_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 --enable-key 000102030405060708090a0b0c0d0e0f --application water-heater -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# --application water-heater +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TC_WHM_2_1.py b/src/python_testing/TC_WHM_2_1.py index 3ed57876cd..6172ee013f 100644 --- a/src/python_testing/TC_WHM_2_1.py +++ b/src/python_testing/TC_WHM_2_1.py @@ -19,12 +19,24 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_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 --application evse -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --application evse +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging diff --git a/src/python_testing/TestBatchInvoke.py b/src/python_testing/TestBatchInvoke.py index cf10fbb227..a17f7b8be4 100644 --- a/src/python_testing/TestBatchInvoke.py +++ b/src/python_testing/TestBatchInvoke.py @@ -30,7 +30,7 @@ # --passcode 20202021 # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto -# factoryreset: true +# factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === diff --git a/src/python_testing/TestGroupTableReports.py b/src/python_testing/TestGroupTableReports.py index 738b2089a1..6e3980bcae 100644 --- a/src/python_testing/TestGroupTableReports.py +++ b/src/python_testing/TestGroupTableReports.py @@ -30,7 +30,7 @@ # --passcode 20202021 # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto -# factoryreset: true +# factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === diff --git a/src/python_testing/TestUnitTestingErrorPath.py b/src/python_testing/TestUnitTestingErrorPath.py index b49e8a656d..70d7b966ac 100644 --- a/src/python_testing/TestUnitTestingErrorPath.py +++ b/src/python_testing/TestUnitTestingErrorPath.py @@ -30,7 +30,7 @@ # --passcode 20202021 # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto -# factoryreset: true +# factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === diff --git a/src/python_testing/hello_test.py b/src/python_testing/hello_test.py index ef6bce8040..0793ee3b10 100644 --- a/src/python_testing/hello_test.py +++ b/src/python_testing/hello_test.py @@ -30,7 +30,7 @@ # --passcode 20202021 # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto -# factoryreset: true +# factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === diff --git a/src/python_testing/matter_testing_infrastructure/chip/testing/metadata.py b/src/python_testing/matter_testing_infrastructure/chip/testing/metadata.py index 03460c4d38..2d40d792ac 100644 --- a/src/python_testing/matter_testing_infrastructure/chip/testing/metadata.py +++ b/src/python_testing/matter_testing_infrastructure/chip/testing/metadata.py @@ -13,22 +13,13 @@ # limitations under the License. import logging -import re from dataclasses import dataclass from io import StringIO -from typing import Any, Dict, List, Optional +from typing import Dict, List, Optional import yaml -# TODO #35787: Remove support for non-YAML format -def cast_to_bool(value: Any) -> bool: - """Convert True/true/False/false strings to bool.""" - if isinstance(value, str): - return value.strip().lower() == "true" - return bool(value) - - @dataclass class Metadata: py_script_path: str @@ -53,52 +44,28 @@ def extract_runs_args(py_script_path: str) -> Dict[str, Dict[str, str]]: """Extract the run arguments from the CI test arguments blocks.""" found_ci_args_section = False - done_ci_args_section = False - - runs_def_ptrn = re.compile(r'^\s*#\s*test-runner-runs:\s*(?P.*)$') - arg_def_ptrn = re.compile( - r'^\s*#\s*test-runner-run/(?P[a-zA-Z0-9_]+)/(?P[a-zA-Z0-9_\-]+):\s*(?P.*)$') - runs_arg_lines: Dict[str, Dict[str, str]] = {} ci_args_section_lines = [] with open(py_script_path, 'r', encoding='utf8') as py_script: for line_idx, line in enumerate(py_script.readlines()): line = line.strip() - line_num = line_idx + 1 # Append empty line to the line capture, so during YAML parsing # line numbers will match the original file. ci_args_section_lines.append("") # Detect the single CI args section, to skip the lines otherwise. - if not done_ci_args_section and line.startswith("# === BEGIN CI TEST ARGUMENTS ==="): + if line.startswith("# === BEGIN CI TEST ARGUMENTS ==="): found_ci_args_section = True continue - elif found_ci_args_section and line.startswith("# === END CI TEST ARGUMENTS ==="): - done_ci_args_section = True - found_ci_args_section = False - continue + if line.startswith("# === END CI TEST ARGUMENTS ==="): + break if found_ci_args_section: # Update the last line in the line capture. ci_args_section_lines[-1] = " " + line.lstrip("#") - runs_match = runs_def_ptrn.match(line) - args_match = arg_def_ptrn.match(line) - - if not found_ci_args_section and (runs_match or args_match): - logging.warning(f"{py_script_path}:{line_num}: Found CI args outside of CI TEST ARGUMENTS block") - continue - - if runs_match: - for run in runs_match.group("run_id").strip().split(): - runs_arg_lines[run] = {} - runs_arg_lines[run]['run'] = run - - elif args_match: - runs_arg_lines[args_match.group("run_id")][args_match.group("arg_name")] = args_match.group("arg_val") - if not runs_arg_lines: try: runs = yaml.safe_load(NamedStringIO("\n".join(ci_args_section_lines), py_script_path)) @@ -182,8 +149,8 @@ def parse_script(self, py_script_path: str) -> List[Metadata]: app_args=attr.get("app-args"), app_ready_pattern=attr.get("app-ready-pattern"), script_args=attr.get("script-args"), - factory_reset=cast_to_bool(attr.get("factoryreset", False)), - quiet=cast_to_bool(attr.get("quiet", True)) + factory_reset=attr.get("factory-reset", False), + quiet=attr.get("quiet", True), )) return runs_metadata diff --git a/src/python_testing/matter_testing_infrastructure/chip/testing/test_metadata.py b/src/python_testing/matter_testing_infrastructure/chip/testing/test_metadata.py index 24ed6c62d4..384cd77db3 100644 --- a/src/python_testing/matter_testing_infrastructure/chip/testing/test_metadata.py +++ b/src/python_testing/matter_testing_infrastructure/chip/testing/test_metadata.py @@ -23,19 +23,6 @@ class TestMetadataReader(unittest.TestCase): test_file_content = ''' # === BEGIN CI TEST ARGUMENTS === - # test-runner-runs: run1 - # test-runner-run/run1/app: ${ALL_CLUSTERS_APP} - # test-runner-run/run1/app-args: --discriminator 1234 --trace-to json:${TRACE_APP}.json - # test-runner-run/run1/script-args: --commissioning-method on-network --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto - # test-runner-run/run1/factoryreset: True - # test-runner-run/run1/quiet: True - # === END CI TEST ARGUMENTS === - - # test-runner-run/run1/quiet: False - ''' - - test_file_content_yaml = ''' - # === BEGIN CI TEST ARGUMENTS === # test-runner-runs: # run1: # app: ${ALL_CLUSTERS_APP} @@ -44,7 +31,7 @@ class TestMetadataReader(unittest.TestCase): # --commissioning-method on-network # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto - # factoryreset: true + # factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === ''' @@ -83,15 +70,6 @@ def test_run_arg_generation(self): self.expected_metadata.py_script_path = test_file self.assertEqual(self.expected_metadata, reader.parse_script(test_file)[0]) - def test_run_arg_generation_yaml(self): - with tempfile.TemporaryDirectory() as temp_dir: - test_file = self.generate_temp_file(temp_dir, self.test_file_content_yaml) - env_file = self.generate_temp_file(temp_dir, self.env_file_content) - - reader = MetadataReader(env_file) - self.expected_metadata.py_script_path = test_file - self.assertEqual(self.expected_metadata, reader.parse_script(test_file)[0]) - if __name__ == "__main__": unittest.main() diff --git a/src/python_testing/test_testing/test_TC_DA_1_2.py b/src/python_testing/test_testing/test_TC_DA_1_2.py index 296508ba2f..290bac613a 100755 --- a/src/python_testing/test_testing/test_TC_DA_1_2.py +++ b/src/python_testing/test_testing/test_TC_DA_1_2.py @@ -30,7 +30,7 @@ def run_single_test(dac_provider: str, product_id: int, factory_reset: bool = Fa reset = "" if factory_reset: - reset = ' --factoryreset' + reset = ' --factory-reset' app = os.path.join( CHIP_ROOT, 'out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app') diff --git a/src/python_testing/test_testing/test_TC_DA_1_5.py b/src/python_testing/test_testing/test_TC_DA_1_5.py index 126814ca61..fbabfbf6cf 100755 --- a/src/python_testing/test_testing/test_TC_DA_1_5.py +++ b/src/python_testing/test_testing/test_TC_DA_1_5.py @@ -27,7 +27,7 @@ def run_single_test(flag: str, factory_reset: bool = False) -> int: reset = "" if factory_reset: - reset = ' --factoryreset' + reset = ' --factory-reset' app = os.path.join(CHIP_ROOT, 'out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app') From 12fe9df8d26485d1ba119b3a6925fc8ac75a4824 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Wed, 9 Oct 2024 13:25:45 -0400 Subject: [PATCH 058/127] Speed up linux and darwin CI (#35971) * Restrict clang-tidy * Move changed-files action forward * Update logic a bit to match tj-actions documentation * Restyled by autopep8 * Update logic to skip more tests for linux to make linux CI finish sooner on pull requests * Revert "Update logic to skip more tests for linux to make linux CI finish sooner on pull requests" This reverts commit a9bc97b2389a263d612de8667356a7262ac25b18. * Generate only for sanitizers * Make sure we checkout a bit of history and persist credentials * Fix up logic for tidy, should now be able to actually run based on github file diff * Restyle * Update .github/workflows/build.yaml Co-authored-by: Boris Zbarsky * Fix env * Code review update --------- Co-authored-by: Andrei Litvin Co-authored-by: Restyled.io Co-authored-by: Boris Zbarsky --- .github/workflows/build.yaml | 39 +++++++++++ scripts/run-clang-tidy-on-compile-commands.py | 69 ++++++++++++------- 2 files changed, 83 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 4495a499c5..e2763ec410 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -157,6 +157,9 @@ jobs: run: echo "$CONCURRENCY_CONTEXT" - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 2 + persist-credentials: true - name: Try to ensure the directories for core dumping exist and we can write them. run: | @@ -186,6 +189,10 @@ jobs: - name: Clean output run: rm -rf ./out - name: Run Tests with sanitizers + # Sanitizer tests are not likely to find extra issues so running the same tests + # as above repeatedly on every pull request seems extra time. Instead keep this run + # for master only + if: github.event.pull_request.number == null env: LSAN_OPTIONS: detect_leaks=1 run: | @@ -201,17 +208,34 @@ jobs: BUILD_TYPE=sanitizers scripts/build/gn_gen.sh --args="$GN_ARGS chip_data_model_check_die_on_failure=true" --export-compile-commands BUILD_TYPE=sanitizers scripts/tests/gn_tests.sh done + - name: Generate tests with sanitizers (for tidy) + if: github.event.pull_request.number != null + run: | + rm -rf ./out/sanitizers + BUILD_TYPE=sanitizers scripts/build/gn_gen.sh --args="is_clang=true is_asan=true chip_data_model_check_die_on_failure=true" --export-compile-commands - name: Ensure codegen is done for sanitize run: | ./scripts/run_in_build_env.sh "./scripts/run_codegen_targets.sh out/sanitizers" + - name: Find changed files + id: changed-files + uses: tj-actions/changed-files@v45 - name: Clang-tidy validation # NOTE: clang-tidy crashes on CodegenDataModel_Write due to Nullable/std::optional check. # See https://github.com/llvm/llvm-project/issues/97426 + env: + ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} run: | + touch out/changed_files.txt + for file in ${ALL_CHANGED_FILES}; do + echo "$file changed and will be considered for tidy" + echo "$file" >>out/changed_files.txt + done + ./scripts/run_in_build_env.sh \ "./scripts/run-clang-tidy-on-compile-commands.py \ --compile-database out/sanitizers/compile_commands.json \ --file-exclude-regex '/(repo|zzz_generated|lwip/standalone)/|-ReadImpl|-InvokeSubscribeImpl|CodegenDataModel_Write|QuieterReporting' \ + --file-list-file out/changed_files.txt \ check \ " - name: Clean output @@ -382,6 +406,9 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 2 + persist-credentials: true - name: Checkout submodules & Bootstrap uses: ./.github/actions/checkout-submodules-and-bootstrap with: @@ -418,14 +445,26 @@ jobs: - name: Ensure codegen is done for default run: | ./scripts/run_in_build_env.sh "./scripts/run_codegen_targets.sh out/default" + - name: Find changed files + id: changed-files + uses: tj-actions/changed-files@v45 - name: Clang-tidy validation # NOTE: clang-tidy crashes on CodegenDataModel_Write due to Nullable/std::optional check. # See https://github.com/llvm/llvm-project/issues/97426 + env: + ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} run: | + touch out/changed_files.txt + for file in ${ALL_CHANGED_FILES}; do + echo "$file changed and will be considered for tidy" + echo "$file" >>out/changed_files.txt + done + ./scripts/run_in_build_env.sh \ "./scripts/run-clang-tidy-on-compile-commands.py \ --compile-database out/default/compile_commands.json \ --file-exclude-regex '/(repo|zzz_generated|lwip/standalone)/|CodegenDataModel_Write|QuieterReporting' \ + --file-list-file out/changed_files.txt \ check \ " - name: Uploading diagnostic logs diff --git a/scripts/run-clang-tidy-on-compile-commands.py b/scripts/run-clang-tidy-on-compile-commands.py index 407caaa6f4..ee3bdc8f33 100755 --- a/scripts/run-clang-tidy-on-compile-commands.py +++ b/scripts/run-clang-tidy-on-compile-commands.py @@ -40,6 +40,7 @@ import tempfile import threading import traceback +from pathlib import Path import click import coloredlogs @@ -92,20 +93,19 @@ def __init__(self, json_entry, gcc_sysroot=None): # # However that seems to potentially disable a lot, so for now just filter out the # offending argument - command_items = [arg for arg in command_items if arg not in {'-c', '-S'}] + command_items = [arg for arg in command_items if arg not in {"-c", "-S"}] # Allow gcc/g++ invocations to also be tidied - arguments should be # compatible and on darwin gcc/g++ is actually a symlink to clang - if compiler in ['clang++', 'clang', 'gcc', 'g++']: + if compiler in ["clang++", "clang", "gcc", "g++"]: self.valid = True self.clang_arguments = command_items[1:] else: - logging.warning( - "Cannot tidy %s - not a clang compile command", self.file) + logging.warning("Cannot tidy %s - not a clang compile command", self.file) return - if compiler in ['gcc', 'g++'] and gcc_sysroot: - self.clang_arguments.insert(0, '--sysroot='+gcc_sysroot) + if compiler in ["gcc", "g++"] and gcc_sysroot: + self.clang_arguments.insert(0, "--sysroot=" + gcc_sysroot) @property def full_path(self): @@ -122,8 +122,12 @@ def SetChecks(self, checks: str): def Check(self): logging.debug("Running tidy on %s from %s", self.file, self.directory) try: - cmd = ["clang-tidy", self.file] + \ - self.tidy_arguments + ["--"] + self.clang_arguments + cmd = ( + ["clang-tidy", self.file] + + self.tidy_arguments + + ["--"] + + self.clang_arguments + ) logging.debug("Executing: %r" % cmd) proc = subprocess.Popen( @@ -156,7 +160,7 @@ def Check(self): "Use -system-headers to display errors from system headers as well.", ] - for line in err.decode('utf-8').split('\n'): + for line in err.decode("utf-8").split("\n"): line = line.strip() if any(map(lambda s: s in line, skip_strings)): @@ -165,7 +169,7 @@ def Check(self): if not line: continue # no empty lines - logging.warning('TIDY %s: %s', self.file, line) + logging.warning("TIDY %s: %s", self.file, line) if proc.returncode != 0: if proc.returncode < 0: @@ -203,18 +207,20 @@ def Failure(self, path: str): def find_darwin_gcc_sysroot(): - for line in subprocess.check_output('xcodebuild -sdk -version'.split()).decode('utf8').split('\n'): - if not line.startswith('Path: '): + for line in subprocess.check_output( + "xcodebuild -sdk -version".split(), text=True + ).splitlines(): + if not line.startswith("Path: "): continue - path = line[line.find(': ')+2:] - if '/MacOSX.platform/' not in path: + path = line[line.find(": ") + 2:] + if "/MacOSX.platform/" not in path: continue logging.info("Found %s" % path) return path # A hard-coded value that works on default installations logging.warning("Using default platform sdk path. This may be incorrect.") - return '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk' + return "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" class ClangTidyRunner: @@ -228,13 +234,12 @@ def __init__(self): self.gcc_sysroot = None self.file_names_to_check = set() - if sys.platform == 'darwin': + if sys.platform == "darwin": # Darwin gcc invocation will auto select a system root, however clang requires an explicit path since # we are using the built-in pigweed clang-tidy. - logging.info( - 'Searching for a MacOS system root for gcc invocations...') + logging.info("Searching for a MacOS system root for gcc invocations...") self.gcc_sysroot = find_darwin_gcc_sysroot() - logging.info(' Chose: %s' % self.gcc_sysroot) + logging.info(" Chose: %s" % self.gcc_sysroot) def AddDatabase(self, compile_commands_json): database = json.load(open(compile_commands_json)) @@ -245,7 +250,7 @@ def AddDatabase(self, compile_commands_json): continue if item.file in self.file_names_to_check: - logging.info('Ignoring additional request for checking %s', item.file) + logging.info("Ignoring additional request for checking %s", item.file) continue self.file_names_to_check.add(item.file) @@ -270,12 +275,12 @@ def Cleanup(self): # Allow all diagnostics for distinct paths to be applied # at once but never again for future paths for d in diagnostics: - if d['DiagnosticMessage']['FilePath'] not in already_seen: + if d["DiagnosticMessage"]["FilePath"] not in already_seen: all_diagnostics.append(d) # in the future assume these files were already processed for d in diagnostics: - already_seen.add(d['DiagnosticMessage']['FilePath']) + already_seen.add(d["DiagnosticMessage"]["FilePath"]) if all_diagnostics: with open(self.fixes_file, "w") as out: @@ -304,8 +309,7 @@ def ExportFixesTo(self, f): for idx, e in enumerate(self.entries): e.ExportFixesTo( os.path.join( - self.fixes_temporary_file_dir.name, "fixes%d.yaml" % ( - idx + 1,) + self.fixes_temporary_file_dir.name, "fixes%d.yaml" % (idx + 1,) ) ) @@ -407,6 +411,12 @@ def Check(self): type=str, help="Checks to run (passed in to clang-tidy). If not set the .clang-tidy file is used.", ) +@click.option( + "--file-list-file", + default=None, + type=click.Path(exists=True), + help="When provided, only tidy files that match files mentioned in this file.", +) @click.pass_context def main( context, @@ -417,6 +427,7 @@ def main( no_log_timestamps, export_fixes, checks, + file_list_file, ): log_fmt = "%(asctime)s %(levelname)-7s %(message)s" if no_log_timestamps: @@ -452,6 +463,14 @@ def cleanup(): r = re.compile(file_exclude_regex) runner.FilterEntries(lambda e: not r.search(e.file)) + if file_list_file: + acceptable = set() + with open(file_list_file, "rt") as f: + for file_name in f.readlines(): + acceptable.add(Path(file_name.strip()).resolve().as_posix()) + + runner.FilterEntries(lambda e: e.full_path in acceptable) + if export_fixes: runner.ExportFixesTo(export_fixes) @@ -492,4 +511,4 @@ def cmd_fix(context): if __name__ == "__main__": - main(auto_envvar_prefix='CHIP') + main(auto_envvar_prefix="CHIP") From 2a19f577b15c9cf1c1433bba14e6fff0d141ed41 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Wed, 9 Oct 2024 21:21:38 +0300 Subject: [PATCH 059/127] esp32-fix-empty-logs(#35939) (#35965) --- src/platform/ESP32/Logging.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/platform/ESP32/Logging.cpp b/src/platform/ESP32/Logging.cpp index e8e53aa9e6..9dfa1d87a1 100644 --- a/src/platform/ESP32/Logging.cpp +++ b/src/platform/ESP32/Logging.cpp @@ -29,9 +29,9 @@ void LogV(const char * module, uint8_t category, const char * msg, va_list v) { case kLogCategory_Error: { { - printf(LOG_COLOR_E "E (%" PRIu32 ") %s: ", esp_log_timestamp(), tag); + esp_log_write(ESP_LOG_ERROR, tag, LOG_COLOR_E "E (%" PRIu32 ") %s: ", esp_log_timestamp(), tag); esp_log_writev(ESP_LOG_ERROR, tag, msg, v); - printf(LOG_RESET_COLOR "\n"); + esp_log_write(ESP_LOG_ERROR, tag, LOG_RESET_COLOR "\n"); } } break; @@ -39,18 +39,18 @@ void LogV(const char * module, uint8_t category, const char * msg, va_list v) case kLogCategory_Progress: default: { { - printf(LOG_COLOR_I "I (%" PRIu32 ") %s: ", esp_log_timestamp(), tag); + esp_log_write(ESP_LOG_INFO, tag, LOG_COLOR_I "I (%" PRIu32 ") %s: ", esp_log_timestamp(), tag); esp_log_writev(ESP_LOG_INFO, tag, msg, v); - printf(LOG_RESET_COLOR "\n"); + esp_log_write(ESP_LOG_INFO, tag, LOG_RESET_COLOR "\n"); } } break; case kLogCategory_Detail: { { - printf(LOG_COLOR_D "D (%" PRIu32 ") %s: ", esp_log_timestamp(), tag); + esp_log_write(ESP_LOG_DEBUG, tag, LOG_COLOR_D "D (%" PRIu32 ") %s: ", esp_log_timestamp(), tag); esp_log_writev(ESP_LOG_DEBUG, tag, msg, v); - printf(LOG_RESET_COLOR "\n"); + esp_log_write(ESP_LOG_DEBUG, tag, LOG_RESET_COLOR "\n"); } } break; From 6252541628f1c64588dee9190e183283f407e7bb Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Wed, 9 Oct 2024 14:23:36 -0400 Subject: [PATCH 060/127] Add script and workflow that is able to "cancel all CI runs for a specific PR/commit" (#35975) * Add a script and workflow for 'cancel running workflows'. The intent for this is to allow failing workflows to trigger a "cancel all the rest of the runs" for a current PR. * Restyle * Rename parameter to make it clear it is a github token * Update scripts/tools/cancel_workflows_for_pr.py Co-authored-by: C Freeman --------- Co-authored-by: Andrei Litvin Co-authored-by: C Freeman --- .../workflows/cancel_workflows_for_pr.yaml | 55 ++++++++++++ scripts/tools/cancel_workflows_for_pr.py | 87 +++++++++++++++++++ 2 files changed, 142 insertions(+) create mode 100644 .github/workflows/cancel_workflows_for_pr.yaml create mode 100755 scripts/tools/cancel_workflows_for_pr.py diff --git a/.github/workflows/cancel_workflows_for_pr.yaml b/.github/workflows/cancel_workflows_for_pr.yaml new file mode 100644 index 0000000000..c8b23b6de7 --- /dev/null +++ b/.github/workflows/cancel_workflows_for_pr.yaml @@ -0,0 +1,55 @@ +# 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. + +name: Cancel workflow on PR +on: + workflow_dispatch: + inputs: + pull_request_id: + description: 'PR number to consider' + required: true + type: number + commit_sha: + description: 'Cancel runs for this specific SHA' + required: true + type: string + +jobs: + cancel_workflow: + name: Report on pull requests + + runs-on: ubuntu-latest + + # Don't run on forked repos + if: github.repository_owner == 'project-chip' + + steps: + - name: Checkout + uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + - name: Setup pip modules we use + run: | + pip install \ + click \ + coloredlogs \ + pygithub \ + && echo "DONE installint python prerequisites" + - name: Cancel runs + run: | + scripts/tools/cancel_workflows_for_pr.py \ + --pull-request ${{ inputs.pull_request_id }} \ + --commit-sha "${{ inputs.commit_sha }}" \ + --gh-api-token "${{ secrets.GITHUB_TOKEN }}" diff --git a/scripts/tools/cancel_workflows_for_pr.py b/scripts/tools/cancel_workflows_for_pr.py new file mode 100755 index 0000000000..bd4b85374c --- /dev/null +++ b/scripts/tools/cancel_workflows_for_pr.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python3 +# +# Copyright (c) 2024 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +import logging + +import click +import coloredlogs +from github import Github + +__LOG_LEVELS__ = { + "debug": logging.DEBUG, + "info": logging.INFO, + "warn": logging.WARN, + "fatal": logging.FATAL, +} + +REPOSITORY = "project-chip/connectedhomeip" + + +class Canceller: + def __init__(self, token): + self.api = Github(token) + self.repo = self.api.get_repo(REPOSITORY) + + def cancel_all_runs(self, pr_number, commit_sha, dry_run): + pr = self.repo.get_pull(pr_number) + logging.info("Examining PR '%s'", pr.title) + for commit in pr.get_commits(): + if commit.sha != commit_sha: + logging.info("Skipping SHA '%s' as it was not selected", commit.sha) + continue + + for check_suite in commit.get_check_suites(): + for run in check_suite.get_check_runs(): + if run.status in {"in_progress", "queued"}: + if dry_run: + logging.warning("DRY RUN: Will not stop run %s", run.name) + else: + logging.warning("Stopping run %s", run.name) + self.repo.get_workflow_run(run.id).cancel() + else: + logging.info("Skip over run %s (%s)", run.name, run.status) + + +@click.command() +@click.option( + "--log-level", + default="INFO", + type=click.Choice(list(__LOG_LEVELS__.keys()), case_sensitive=False), + help="Determines the verbosity of script output.", +) +@click.option("--pull-request", type=int, help="Pull request number to consider") +@click.option("--commit-sha", help="Commit to look at when cancelling pull requests") +@click.option("--gh-api-token", help="Github token to use") +@click.option("--token-file", help="Read github token from the given file") +@click.option("--dry-run", default=False, is_flag=True, help="Actually cancel or not") +def main(log_level, pull_request, commit_sha, gh_api_token, token_file, dry_run): + coloredlogs.install( + level=__LOG_LEVELS__[log_level], fmt="%(asctime)s %(levelname)-7s %(message)s" + ) + + if gh_api_token: + gh_token = gh_api_token + elif token_file: + gh_token = open(token_file, "rt").read().strip() + else: + raise Exception("Require a --gh-api-token or --token-file to access github") + + Canceller(gh_token).cancel_all_runs(pull_request, commit_sha, dry_run) + + +if __name__ == "__main__": + main() From b37012b35ebbff8a02f4cb3a88ef4359b4065d87 Mon Sep 17 00:00:00 2001 From: Justin Wood Date: Wed, 9 Oct 2024 12:21:25 -0700 Subject: [PATCH 061/127] Moving our XPC Checkin to be a general register (#35985) * Moving this to a general register * Restyled by whitespace * Restyled by clang-format --------- Co-authored-by: Restyled.io --- .../Framework/CHIP/MTRDeviceController_XPC.mm | 72 ++++++++++--------- .../CHIP/XPC Protocol/MTRXPCServerProtocol.h | 7 ++ 2 files changed, 46 insertions(+), 33 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm b/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm index 038be7934c..ca3100a1ad 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm @@ -40,46 +40,58 @@ @interface MTRDeviceController_XPC () @end +NSString * const MTRDeviceControllerRegistrationControllerContextKey = @"MTRDeviceControllerRegistrationControllerContext"; +NSString * const MTRDeviceControllerRegistrationNodeIDsKey = @"MTRDeviceControllerRegistrationNodeIDs"; +NSString * const MTRDeviceControllerRegistrationNodeIDKey = @"MTRDeviceControllerRegistrationNodeID"; + // #define MTR_HAVE_MACH_SERVICE_NAME_CONSTRUCTOR @implementation MTRDeviceController_XPC -#pragma mark - Device Node ID Commands +#pragma mark - Node ID Management -- (void)_registerNodeID:(NSNumber *)nodeID +MTR_DEVICECONTROLLER_SIMPLE_REMOTE_XPC_COMMAND(updateControllerConfiguration + : (NSDictionary *) controllerState, updateControllerConfiguration + : (NSDictionary *) controllerState) + +- (void)_updateRegistrationInfo { - @try { - [[self.xpcConnection remoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) { - MTR_LOG_ERROR("Register node error: %@ nodeID: %@", error, nodeID); - }] deviceController:self.uniqueIdentifier registerNodeID:nodeID]; - } @catch (NSException * exception) { - MTR_LOG_ERROR("Exception registering nodeID: %@", exception); + NSMutableDictionary * registrationInfo = [NSMutableDictionary dictionary]; + + NSMutableDictionary * controllerContext = [NSMutableDictionary dictionary]; + NSMutableArray * nodeIDs = [NSMutableArray array]; + + for (NSNumber * nodeID in [self.nodeIDToDeviceMap keyEnumerator]) { + NSMutableDictionary * nodeDictionary = [NSMutableDictionary dictionary]; + MTR_REQUIRED_ATTRIBUTE(MTRDeviceControllerRegistrationNodeIDKey, nodeID, nodeDictionary) + + [nodeIDs addObject:nodeDictionary]; } + MTR_REQUIRED_ATTRIBUTE(MTRDeviceControllerRegistrationNodeIDsKey, nodeIDs, registrationInfo) + MTR_REQUIRED_ATTRIBUTE(MTRDeviceControllerRegistrationControllerContextKey, controllerContext, registrationInfo) + + [self updateControllerConfiguration:registrationInfo]; +} + +- (void)_registerNodeID:(NSNumber *)nodeID +{ + [self _updateRegistrationInfo]; } - (void)_unregisterNodeID:(NSNumber *)nodeID { - @try { - [[self.xpcConnection remoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) { - MTR_LOG_ERROR("Unregister node error: %@ nodeID: %@", error, nodeID); - }] deviceController:self.uniqueIdentifier unregisterNodeID:nodeID]; - } @catch (NSException * exception) { - MTR_LOG_ERROR("Exception unregistering nodeID: %@", exception); - } + [self _updateRegistrationInfo]; } - (void)_checkinWithContext:(NSDictionary *)context { - @try { - if (!context) - context = [NSDictionary dictionary]; - - [[self.xpcConnection remoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) { - MTR_LOG_ERROR("Checkin error: %@", error); - }] deviceController:self.uniqueIdentifier checkInWithContext:context]; - } @catch (NSException * exception) { - MTR_LOG_ERROR("Exception checking in with context: %@", exception); - } + [self _updateRegistrationInfo]; +} + +- (void)removeDevice:(MTRDevice *)device +{ + [super removeDevice:device]; + [self _updateRegistrationInfo]; } #pragma mark - XPC @@ -246,13 +258,7 @@ - (BOOL)_setupXPCConnection // FIXME: Trying to kick all the MTRDevices attached to this controller to re-establish connections // This state needs to be stored properly and re-established at connnection time - MTR_LOG("%@ Starting existing NodeID Registration", self); - for (NSNumber * nodeID in [self.nodeIDToDeviceMap keyEnumerator]) { - MTR_LOG("%@ => Registering nodeID: %@", self, nodeID); - [self _registerNodeID:nodeID]; - } - - MTR_LOG("%@ Done existing NodeID Registration", self); + [self _updateRegistrationInfo]; self.xpcConnectedOrConnecting = YES; } else { MTR_LOG_ERROR("%@ Failed to set up XPC Connection", self); @@ -340,7 +346,7 @@ - (MTRDevice *)_setupDeviceForNodeID:(NSNumber *)nodeID prefetchedClusterData:(N [self.nodeIDToDeviceMap setObject:deviceToReturn forKey:nodeID]; MTR_LOG("%s: returning XPC device for node id %@", __PRETTY_FUNCTION__, nodeID); - [self _registerNodeID:nodeID]; + [self _updateRegistrationInfo]; return deviceToReturn; } diff --git a/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCServerProtocol.h b/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCServerProtocol.h index b404056c96..36e2be5d42 100644 --- a/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCServerProtocol.h +++ b/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCServerProtocol.h @@ -18,6 +18,10 @@ NS_ASSUME_NONNULL_BEGIN +MTR_EXTERN NSString * const MTRDeviceControllerRegistrationNodeIDsKey MTR_NEWLY_AVAILABLE; +MTR_EXTERN NSString * const MTRDeviceControllerRegistrationNodeIDKey MTR_NEWLY_AVAILABLE; +MTR_EXTERN NSString * const MTRDeviceControllerRegistrationControllerContextKey MTR_NEWLY_AVAILABLE; + MTR_NEWLY_AVAILABLE @protocol MTRXPCServerProtocol_MTRDevice @@ -42,6 +46,7 @@ MTR_NEWLY_AVAILABLE MTR_NEWLY_AVAILABLE @protocol MTRXPCServerProtocol_MTRDeviceController +@optional - (oneway void)deviceController:(NSUUID *)controller getIsRunningWithReply:(void (^)(BOOL response))reply; - (oneway void)deviceController:(NSUUID *)controller getUniqueIdentifierWithReply:(void (^)(NSUUID *))reply; - (oneway void)deviceController:(NSUUID *)controller controllerNodeIDWithReply:(void (^)(NSNumber * nodeID))reply; @@ -66,7 +71,9 @@ MTR_NEWLY_AVAILABLE MTR_NEWLY_AVAILABLE @protocol MTRXPCServerProtocol +@optional - (oneway void)deviceController:(NSUUID *)controller checkInWithContext:(NSDictionary *)context; +- (oneway void)deviceController:(NSUUID *)controller updateControllerConfiguration:(NSDictionary *)controllerState; @end NS_ASSUME_NONNULL_END From f217f77b09ffbfae8c1f89a9d23a1c0d9d4a012a Mon Sep 17 00:00:00 2001 From: Marcos B <15697303+gmarcosb@users.noreply.github.com> Date: Wed, 9 Oct 2024 14:39:45 -0600 Subject: [PATCH 062/127] Camera zone management cluster (#35879) * Generated using ./alchemy zap --attribute="in-progress" ... ZoneManagement.adoc * Generated using ./alchemy zap --attribute="in-progress" ... ZoneManagement.adoc * Re-generated using ./scripts/tools/zap_regen_all.py after merge * Restyled by whitespace * Restyled by prettier-json * Re-generated using ./scripts/tools/zap_regen_all.py after update to python generation --------- Co-authored-by: Restyled.io --- .github/workflows/tests.yaml | 1 + docs/zap_clusters.md | 1 + scripts/rules.matterlint | 1 + .../chip/zone-management-cluster.xml | 155 ++ .../zcl/zcl-with-test-extensions.json | 3 +- src/app/zap-templates/zcl/zcl.json | 3 +- src/app/zap_cluster_list.json | 6 +- .../data_model/controller-clusters.matter | 118 ++ .../chip/devicecontroller/ChipClusters.java | 443 ++++++ .../devicecontroller/ChipEventStructs.java | 122 ++ .../chip/devicecontroller/ChipStructs.java | 319 ++++ .../devicecontroller/ClusterIDMapping.java | 181 +++ .../devicecontroller/ClusterInfoMapping.java | 272 ++++ .../devicecontroller/ClusterReadMapping.java | 115 ++ .../devicecontroller/ClusterWriteMapping.java | 24 + .../ZoneManagementClusterZoneStoppedEvent.kt | 68 + ...ZoneManagementClusterZoneTriggeredEvent.kt | 68 + .../chip/devicecontroller/cluster/files.gni | 6 + ...agementClusterTwoDCartesianVertexStruct.kt | 56 + ...anagementClusterTwoDCartesianZoneStruct.kt | 90 ++ ...eManagementClusterZoneInformationStruct.kt | 64 + ...tClusterZoneTriggeringTimeControlStruct.kt | 77 + .../cluster/clusters/ZoneManagementCluster.kt | 1296 ++++++++++++++++ .../ZoneManagementClusterZoneStoppedEvent.kt | 68 + ...ZoneManagementClusterZoneTriggeredEvent.kt | 68 + .../java/matter/controller/cluster/files.gni | 7 + ...agementClusterTwoDCartesianVertexStruct.kt | 56 + ...anagementClusterTwoDCartesianZoneStruct.kt | 90 ++ ...eManagementClusterZoneInformationStruct.kt | 64 + ...tClusterZoneTriggeringTimeControlStruct.kt | 77 + .../CHIPAttributeTLVValueDecoder.cpp | 322 ++++ .../CHIPEventTLVValueDecoder.cpp | 114 ++ .../python/chip/clusters/CHIPClusters.py | 101 ++ .../python/chip/clusters/Objects.py | 457 ++++++ .../MTRAttributeSpecifiedCheck.mm | 42 + .../MTRAttributeTLVValueDecoder.mm | 111 ++ .../CHIP/zap-generated/MTRBaseClusters.h | 149 ++ .../CHIP/zap-generated/MTRBaseClusters.mm | 545 +++++++ .../CHIP/zap-generated/MTRClusterConstants.h | 25 + .../CHIP/zap-generated/MTRClusterNames.mm | 117 ++ .../CHIP/zap-generated/MTRClusters.h | 55 + .../CHIP/zap-generated/MTRClusters.mm | 188 +++ .../zap-generated/MTRCommandPayloadsObjc.h | 160 ++ .../zap-generated/MTRCommandPayloadsObjc.mm | 590 ++++++++ .../MTRCommandPayloads_Internal.h | 36 + .../zap-generated/MTRCommandTimedCheck.mm | 12 + .../zap-generated/MTREventTLVValueDecoder.mm | 89 ++ .../CHIP/zap-generated/MTRStructsObjc.h | 41 + .../CHIP/zap-generated/MTRStructsObjc.mm | 195 +++ .../zap-generated/attributes/Accessors.cpp | 147 ++ .../zap-generated/attributes/Accessors.h | 24 + .../app-common/zap-generated/callback.h | 68 + .../zap-generated/cluster-enums-check.h | 72 + .../app-common/zap-generated/cluster-enums.h | 80 + .../zap-generated/cluster-objects.cpp | 527 +++++++ .../zap-generated/cluster-objects.h | 536 +++++++ .../app-common/zap-generated/ids/Attributes.h | 46 + .../app-common/zap-generated/ids/Clusters.h | 3 + .../app-common/zap-generated/ids/Commands.h | 30 + .../app-common/zap-generated/ids/Events.h | 14 + .../zap-generated/cluster/Commands.h | 260 ++++ .../cluster/ComplexArgumentParser.cpp | 162 ++ .../cluster/ComplexArgumentParser.h | 21 + .../cluster/logging/DataModelLogger.cpp | 299 ++++ .../cluster/logging/DataModelLogger.h | 23 + .../cluster/logging/EntryToText.cpp | 55 + .../zap-generated/cluster/Commands.h | 1329 +++++++++++++++++ 67 files changed, 10960 insertions(+), 4 deletions(-) create mode 100644 src/app/zap-templates/zcl/data-model/chip/zone-management-cluster.xml create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ZoneManagementClusterZoneStoppedEvent.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ZoneManagementClusterZoneTriggeredEvent.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterTwoDCartesianVertexStruct.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterTwoDCartesianZoneStruct.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterZoneInformationStruct.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterZoneTriggeringTimeControlStruct.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/clusters/ZoneManagementCluster.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/eventstructs/ZoneManagementClusterZoneStoppedEvent.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/eventstructs/ZoneManagementClusterZoneTriggeredEvent.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterTwoDCartesianVertexStruct.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterTwoDCartesianZoneStruct.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterZoneInformationStruct.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterZoneTriggeringTimeControlStruct.kt diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index d11f9f7323..a84e8639f7 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -210,6 +210,7 @@ jobs: src/app/zap-templates/zcl/data-model/chip/sample-mei-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/electrical-energy-measurement-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/electrical-power-measurement-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/zone-management-cluster.xml \ " - name: Build Apps run: | diff --git a/docs/zap_clusters.md b/docs/zap_clusters.md index 5803545d3e..84ca34a74d 100644 --- a/docs/zap_clusters.md +++ b/docs/zap_clusters.md @@ -129,6 +129,7 @@ Generally regenerate using one of: | 1294 | 0x50E | AccountLogin | | 1295 | 0x50F | ContentControl | | 1296 | 0x510 | ContentAppObserver | +| 1360 | 0x550 | ZoneManagement | | 1363 | 0x553 | WebRTCTransportProvider | | 1364 | 0x554 | WebRTCTransportRequestor | | 1366 | 0x556 | Chime | diff --git a/scripts/rules.matterlint b/scripts/rules.matterlint index b7ce7ef975..69715eea87 100644 --- a/scripts/rules.matterlint +++ b/scripts/rules.matterlint @@ -120,6 +120,7 @@ load "../src/app/zap-templates/zcl/data-model/chip/resource-monitoring-cluster.x load "../src/app/zap-templates/zcl/data-model/chip/sample-mei-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/electrical-energy-measurement-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/electrical-power-measurement-cluster.xml"; +load "../src/app/zap-templates/zcl/data-model/chip/zone-management-cluster.xml"; all endpoints { // These attributes follow a different code path and do not have to be diff --git a/src/app/zap-templates/zcl/data-model/chip/zone-management-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/zone-management-cluster.xml new file mode 100644 index 0000000000..27a947b561 --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/chip/zone-management-cluster.xml @@ -0,0 +1,155 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Zone Management + 0x0550 + ZONE_MANAGEMENT_CLUSTER + This cluster provides an interface to manage regions of interest, or Zones, which can be either manufacturer or user defined. + true + + + + + + true + + SupportedZoneSources + Zones + TimeControl + Sensitivity + + This command SHALL create and store a TwoD Cartesian Zone. + + + + + + + + + + + The UpdateTwoDCartesianZone SHALL update a stored TwoD Cartesian Zone. + + + + + + + The GetTwoDCartesianZone SHALL return the TwoD Cartesian Zone for the passed in ZoneID. + + + + + + This command SHALL be generated in response to a GetTwoDCartesianZone command. + + + + + This command SHALL remove the Zone mapped to the passed in ZoneID. + + + + + + + + This event SHALL be generated when a Zone is first triggered. + + + + + + This event SHALL be generated when either when the TriggerDetectedDuration value is exceeded by the TimeSinceInitialTrigger value or when the MaxDuration value is exceeded by the TimeSinceInitialTrigger value as described in ZoneTriggeringTimeControlStruct. + + + + diff --git a/src/app/zap-templates/zcl/zcl-with-test-extensions.json b/src/app/zap-templates/zcl/zcl-with-test-extensions.json index 61d46b6453..b78abba239 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -140,7 +140,8 @@ "sample-mei-cluster.xml", "types/door-lock.xml", "types/occupancy-sensing.xml", - "types/thermostat-user-interface-configuration.xml" + "types/thermostat-user-interface-configuration.xml", + "zone-management-cluster.xml" ], "manufacturersXml": "../../../../src/app/zap-templates/zcl/data-model/manufacturers.xml", "options": { diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index f4e04ef1f2..ba95e57f63 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -134,7 +134,8 @@ "sample-mei-cluster.xml", "types/door-lock.xml", "types/occupancy-sensing.xml", - "types/thermostat-user-interface-configuration.xml" + "types/thermostat-user-interface-configuration.xml", + "zone-management-cluster.xml" ], "manufacturersXml": "../../../../src/app/zap-templates/zcl/data-model/manufacturers.xml", "options": { diff --git a/src/app/zap_cluster_list.json b/src/app/zap_cluster_list.json index aab95321af..d4c4801058 100644 --- a/src/app/zap_cluster_list.json +++ b/src/app/zap_cluster_list.json @@ -134,7 +134,8 @@ "WEB_RTC_PROVIDER_CLUSTER": [], "WEBRTC_REQUESTOR_CLUSTER": [], "WIFI_NETWORK_DIAGNOSTICS_CLUSTER": [], - "WINDOW_COVERING_CLUSTER": [] + "WINDOW_COVERING_CLUSTER": [], + "ZONE_MANAGEMENT_CLUSTER": [] }, "ServerDirectories": { "ACCESS_CONTROL_CLUSTER": ["access-control-server"], @@ -318,6 +319,7 @@ "WIFI_NETWORK_MANAGEMENT_CLUSTER": ["wifi-network-management-server"], "WINDOW_COVERING_CLUSTER": ["window-covering-server"], "WATER_HEATER_MANAGEMENT_CLUSTER": ["water-heater-management-server"], - "WATER_HEATER_MODE_CLUSTER": ["mode-base-server"] + "WATER_HEATER_MODE_CLUSTER": ["mode-base-server"], + "ZONE_MANAGEMENT_CLUSTER": [] } } diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 07b98b1795..f04be5c4d6 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -9416,6 +9416,124 @@ provisional cluster ContentAppObserver = 1296 { command ContentAppMessage(ContentAppMessageRequest): ContentAppMessageResponse = 0; } +/** This cluster provides an interface to manage regions of interest, or Zones, which can be either manufacturer or user defined. */ +provisional cluster ZoneManagement = 1360 { + revision 1; + + enum StatusCodeEnum : enum8 { + kZoneNotFound = 2; + kZoneInUse = 3; + } + + enum ZoneEventStoppedReasonEnum : enum8 { + kActionStopped = 0; + kTimeout = 1; + } + + enum ZoneEventTriggeredReasonEnum : enum8 { + kMotion = 0; + } + + enum ZoneSourceEnum : enum8 { + kMfg = 0; + kUser = 1; + } + + enum ZoneTypeEnum : enum8 { + kTwoDCARTZone = 0; + } + + enum ZoneUseEnum : enum8 { + kMotion = 0; + kPrivacy = 1; + kFocus = 2; + } + + bitmap Feature : bitmap32 { + kTwoDimensionalCartesianZone = 0x1; + } + + struct TwoDCartesianVertexStruct { + int16u x = 0; + int16u y = 1; + } + + struct TwoDCartesianZoneStruct { + char_string<16> name = 0; + ZoneUseEnum use = 1; + TwoDCartesianVertexStruct vertices[] = 2; + optional char_string<9> color = 3; + } + + struct ZoneInformationStruct { + int16u zoneID = 0; + ZoneTypeEnum zoneType = 1; + ZoneSourceEnum zoneSource = 2; + } + + struct ZoneTriggeringTimeControlStruct { + int16u initialDuration = 0; + int16u augmentationDuration = 1; + elapsed_s maxDuration = 2; + int16u blindDuration = 3; + } + + info event ZoneTriggered = 0 { + int16u zones[] = 0; + ZoneEventTriggeredReasonEnum reason = 1; + } + + info event ZoneStopped = 1 { + int16u zones[] = 0; + ZoneEventStoppedReasonEnum reason = 1; + } + + readonly attribute ZoneSourceEnum supportedZoneSources[] = 0; + readonly attribute optional ZoneInformationStruct zones[] = 1; + attribute ZoneTriggeringTimeControlStruct timeControl[] = 2; + attribute int8u sensitivity = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct CreateTwoDCartesianZoneRequest { + TwoDCartesianZoneStruct zone = 0; + } + + response struct CreateTwoDCartesianZoneResponse = 1 { + int16u zoneID = 0; + } + + request struct UpdateTwoDCartesianZoneRequest { + int16u zoneID = 0; + TwoDCartesianZoneStruct zone = 1; + } + + request struct GetTwoDCartesianZoneRequest { + optional nullable int16u zoneID = 0; + } + + response struct GetTwoDCartesianZoneResponse = 4 { + TwoDCartesianZoneStruct zones[] = 0; + } + + request struct RemoveZoneRequest { + int16u zoneID = 0; + } + + /** This command SHALL create and store a TwoD Cartesian Zone. */ + command access(invoke: manage) CreateTwoDCartesianZone(CreateTwoDCartesianZoneRequest): CreateTwoDCartesianZoneResponse = 0; + /** The UpdateTwoDCartesianZone SHALL update a stored TwoD Cartesian Zone. */ + command access(invoke: manage) UpdateTwoDCartesianZone(UpdateTwoDCartesianZoneRequest): DefaultSuccess = 2; + /** The GetTwoDCartesianZone SHALL return the TwoD Cartesian Zone for the passed in ZoneID. */ + command access(invoke: manage) GetTwoDCartesianZone(GetTwoDCartesianZoneRequest): GetTwoDCartesianZoneResponse = 3; + /** This command SHALL remove the Zone mapped to the passed in ZoneID. */ + command access(invoke: manage) RemoveZone(RemoveZoneRequest): DefaultSuccess = 5; +} + /** The WebRTC transport provider cluster provides a way for stream providers (e.g. Cameras) to stream or receive their data through WebRTC. */ provisional cluster WebRTCTransportProvider = 1363 { revision 1; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java index 4104a75abb..fb50bee24f 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java @@ -59518,6 +59518,449 @@ public void onSuccess(byte[] tlv) { } } + public static class ZoneManagementCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 1360L; + + private static final long SUPPORTED_ZONE_SOURCES_ATTRIBUTE_ID = 0L; + private static final long ZONES_ATTRIBUTE_ID = 1L; + private static final long TIME_CONTROL_ATTRIBUTE_ID = 2L; + private static final long SENSITIVITY_ATTRIBUTE_ID = 3L; + private static final long GENERATED_COMMAND_LIST_ATTRIBUTE_ID = 65528L; + private static final long ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID = 65529L; + private static final long EVENT_LIST_ATTRIBUTE_ID = 65530L; + private static final long ATTRIBUTE_LIST_ATTRIBUTE_ID = 65531L; + private static final long FEATURE_MAP_ATTRIBUTE_ID = 65532L; + private static final long CLUSTER_REVISION_ATTRIBUTE_ID = 65533L; + + public ZoneManagementCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId, CLUSTER_ID); + } + + @Override + @Deprecated + public long initWithDevice(long devicePtr, int endpointId) { + return 0L; + } + + public void createTwoDCartesianZone(CreateTwoDCartesianZoneResponseCallback callback, ChipStructs.ZoneManagementClusterTwoDCartesianZoneStruct zone) { + createTwoDCartesianZone(callback, zone, 0); + } + + public void createTwoDCartesianZone(CreateTwoDCartesianZoneResponseCallback callback, ChipStructs.ZoneManagementClusterTwoDCartesianZoneStruct zone, int timedInvokeTimeoutMs) { + final long commandId = 0L; + + ArrayList elements = new ArrayList<>(); + final long zoneFieldID = 0L; + BaseTLVType zonetlvValue = zone.encodeTlv(); + elements.add(new StructElement(zoneFieldID, zonetlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + final long zoneIDFieldID = 0L; + Integer zoneID = null; + for (StructElement element: invokeStructValue.value()) { + if (element.contextTagNum() == zoneIDFieldID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + zoneID = castingValue.value(Integer.class); + } + } + } + callback.onSuccess(zoneID); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void updateTwoDCartesianZone(DefaultClusterCallback callback, Integer zoneID, ChipStructs.ZoneManagementClusterTwoDCartesianZoneStruct zone) { + updateTwoDCartesianZone(callback, zoneID, zone, 0); + } + + public void updateTwoDCartesianZone(DefaultClusterCallback callback, Integer zoneID, ChipStructs.ZoneManagementClusterTwoDCartesianZoneStruct zone, int timedInvokeTimeoutMs) { + final long commandId = 2L; + + ArrayList elements = new ArrayList<>(); + final long zoneIDFieldID = 0L; + BaseTLVType zoneIDtlvValue = new UIntType(zoneID); + elements.add(new StructElement(zoneIDFieldID, zoneIDtlvValue)); + + final long zoneFieldID = 1L; + BaseTLVType zonetlvValue = zone.encodeTlv(); + elements.add(new StructElement(zoneFieldID, zonetlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void getTwoDCartesianZone(GetTwoDCartesianZoneResponseCallback callback, @Nullable Optional zoneID) { + getTwoDCartesianZone(callback, zoneID, 0); + } + + public void getTwoDCartesianZone(GetTwoDCartesianZoneResponseCallback callback, @Nullable Optional zoneID, int timedInvokeTimeoutMs) { + final long commandId = 3L; + + ArrayList elements = new ArrayList<>(); + final long zoneIDFieldID = 0L; + BaseTLVType zoneIDtlvValue = zoneID != null ? zoneID.map((nonOptionalzoneID) -> new UIntType(nonOptionalzoneID)).orElse(new EmptyType()) : new NullType(); + elements.add(new StructElement(zoneIDFieldID, zoneIDtlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + final long zonesFieldID = 0L; + ArrayList zones = null; + for (StructElement element: invokeStructValue.value()) { + if (element.contextTagNum() == zonesFieldID) { + if (element.value(BaseTLVType.class).type() == TLVType.Array) { + ArrayType castingValue = element.value(ArrayType.class); + zones = castingValue.map((elementcastingValue) -> ChipStructs.ZoneManagementClusterTwoDCartesianZoneStruct.decodeTlv(elementcastingValue)); + } + } + } + callback.onSuccess(zones); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void removeZone(DefaultClusterCallback callback, Integer zoneID) { + removeZone(callback, zoneID, 0); + } + + public void removeZone(DefaultClusterCallback callback, Integer zoneID, int timedInvokeTimeoutMs) { + final long commandId = 5L; + + ArrayList elements = new ArrayList<>(); + final long zoneIDFieldID = 0L; + BaseTLVType zoneIDtlvValue = new UIntType(zoneID); + elements.add(new StructElement(zoneIDFieldID, zoneIDtlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public interface CreateTwoDCartesianZoneResponseCallback extends BaseClusterCallback { + void onSuccess(Integer zoneID); + } + + public interface GetTwoDCartesianZoneResponseCallback extends BaseClusterCallback { + void onSuccess(ArrayList zones); + } + + public interface SupportedZoneSourcesAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface ZonesAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface TimeControlAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface AcceptedCommandListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface EventListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface AttributeListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public void readSupportedZoneSourcesAttribute( + SupportedZoneSourcesAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SUPPORTED_ZONE_SOURCES_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SUPPORTED_ZONE_SOURCES_ATTRIBUTE_ID, true); + } + + public void subscribeSupportedZoneSourcesAttribute( + SupportedZoneSourcesAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SUPPORTED_ZONE_SOURCES_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SUPPORTED_ZONE_SOURCES_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readZonesAttribute( + ZonesAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ZONES_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ZONES_ATTRIBUTE_ID, true); + } + + public void subscribeZonesAttribute( + ZonesAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ZONES_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ZONES_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readTimeControlAttribute( + TimeControlAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TIME_CONTROL_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, TIME_CONTROL_ATTRIBUTE_ID, true); + } + + public void writeTimeControlAttribute(DefaultClusterCallback callback, ArrayList value) { + writeTimeControlAttribute(callback, value, 0); + } + + public void writeTimeControlAttribute(DefaultClusterCallback callback, ArrayList value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = ArrayType.generateArrayType(value, (elementvalue) -> elementvalue.encodeTlv()); + writeAttribute(new WriteAttributesCallbackImpl(callback), TIME_CONTROL_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeTimeControlAttribute( + TimeControlAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TIME_CONTROL_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, TIME_CONTROL_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readSensitivityAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SENSITIVITY_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SENSITIVITY_ATTRIBUTE_ID, true); + } + + public void writeSensitivityAttribute(DefaultClusterCallback callback, Integer value) { + writeSensitivityAttribute(callback, value, 0); + } + + public void writeSensitivityAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new UIntType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), SENSITIVITY_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeSensitivityAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SENSITIVITY_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SENSITIVITY_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readEventListAttribute( + EventListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, EVENT_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, EVENT_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeEventListAttribute( + EventListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, EVENT_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, EVENT_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readAttributeListAttribute( + AttributeListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ATTRIBUTE_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ATTRIBUTE_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeAttributeListAttribute( + AttributeListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ATTRIBUTE_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ATTRIBUTE_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readFeatureMapAttribute( + LongAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FEATURE_MAP_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, FEATURE_MAP_ATTRIBUTE_ID, true); + } + + public void subscribeFeatureMapAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FEATURE_MAP_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, FEATURE_MAP_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readClusterRevisionAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CLUSTER_REVISION_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CLUSTER_REVISION_ATTRIBUTE_ID, true); + } + + public void subscribeClusterRevisionAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CLUSTER_REVISION_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CLUSTER_REVISION_ATTRIBUTE_ID, minInterval, maxInterval); + } + } + public static class WebRTCTransportProviderCluster extends BaseChipCluster { public static final long CLUSTER_ID = 1363L; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java b/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java index 737462f3da..ce9f162bde 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java @@ -6187,6 +6187,128 @@ public String toString() { return output.toString(); } } +public static class ZoneManagementClusterZoneTriggeredEvent { + public ArrayList zones; + public Integer reason; + private static final long ZONES_ID = 0L; + private static final long REASON_ID = 1L; + + public ZoneManagementClusterZoneTriggeredEvent( + ArrayList zones, + Integer reason + ) { + this.zones = zones; + this.reason = reason; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(ZONES_ID, ArrayType.generateArrayType(zones, (elementzones) -> new UIntType(elementzones)))); + values.add(new StructElement(REASON_ID, new UIntType(reason))); + + return new StructType(values); + } + + public static ZoneManagementClusterZoneTriggeredEvent decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + ArrayList zones = null; + Integer reason = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == ZONES_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Array) { + ArrayType castingValue = element.value(ArrayType.class); + zones = castingValue.map((elementcastingValue) -> elementcastingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == REASON_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + reason = castingValue.value(Integer.class); + } + } + } + return new ZoneManagementClusterZoneTriggeredEvent( + zones, + reason + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("ZoneManagementClusterZoneTriggeredEvent {\n"); + output.append("\tzones: "); + output.append(zones); + output.append("\n"); + output.append("\treason: "); + output.append(reason); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class ZoneManagementClusterZoneStoppedEvent { + public ArrayList zones; + public Integer reason; + private static final long ZONES_ID = 0L; + private static final long REASON_ID = 1L; + + public ZoneManagementClusterZoneStoppedEvent( + ArrayList zones, + Integer reason + ) { + this.zones = zones; + this.reason = reason; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(ZONES_ID, ArrayType.generateArrayType(zones, (elementzones) -> new UIntType(elementzones)))); + values.add(new StructElement(REASON_ID, new UIntType(reason))); + + return new StructType(values); + } + + public static ZoneManagementClusterZoneStoppedEvent decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + ArrayList zones = null; + Integer reason = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == ZONES_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Array) { + ArrayType castingValue = element.value(ArrayType.class); + zones = castingValue.map((elementcastingValue) -> elementcastingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == REASON_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + reason = castingValue.value(Integer.class); + } + } + } + return new ZoneManagementClusterZoneStoppedEvent( + zones, + reason + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("ZoneManagementClusterZoneStoppedEvent {\n"); + output.append("\tzones: "); + output.append(zones); + output.append("\n"); + output.append("\treason: "); + output.append(reason); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} public static class CommissionerControlClusterCommissioningRequestResultEvent { public Long requestID; public Long clientNodeID; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java index 88684160d1..1b02cba515 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java @@ -12724,6 +12724,325 @@ public String toString() { return output.toString(); } } +public static class ZoneManagementClusterTwoDCartesianVertexStruct { + public Integer x; + public Integer y; + private static final long X_ID = 0L; + private static final long Y_ID = 1L; + + public ZoneManagementClusterTwoDCartesianVertexStruct( + Integer x, + Integer y + ) { + this.x = x; + this.y = y; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(X_ID, new UIntType(x))); + values.add(new StructElement(Y_ID, new UIntType(y))); + + return new StructType(values); + } + + public static ZoneManagementClusterTwoDCartesianVertexStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer x = null; + Integer y = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == X_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + x = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == Y_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + y = castingValue.value(Integer.class); + } + } + } + return new ZoneManagementClusterTwoDCartesianVertexStruct( + x, + y + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("ZoneManagementClusterTwoDCartesianVertexStruct {\n"); + output.append("\tx: "); + output.append(x); + output.append("\n"); + output.append("\ty: "); + output.append(y); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class ZoneManagementClusterTwoDCartesianZoneStruct { + public String name; + public Integer use; + public ArrayList vertices; + public Optional color; + private static final long NAME_ID = 0L; + private static final long USE_ID = 1L; + private static final long VERTICES_ID = 2L; + private static final long COLOR_ID = 3L; + + public ZoneManagementClusterTwoDCartesianZoneStruct( + String name, + Integer use, + ArrayList vertices, + Optional color + ) { + this.name = name; + this.use = use; + this.vertices = vertices; + this.color = color; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(NAME_ID, new StringType(name))); + values.add(new StructElement(USE_ID, new UIntType(use))); + values.add(new StructElement(VERTICES_ID, ArrayType.generateArrayType(vertices, (elementvertices) -> elementvertices.encodeTlv()))); + values.add(new StructElement(COLOR_ID, color.map((nonOptionalcolor) -> new StringType(nonOptionalcolor)).orElse(new EmptyType()))); + + return new StructType(values); + } + + public static ZoneManagementClusterTwoDCartesianZoneStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + String name = null; + Integer use = null; + ArrayList vertices = null; + Optional color = Optional.empty(); + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == NAME_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + name = castingValue.value(String.class); + } + } else if (element.contextTagNum() == USE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + use = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == VERTICES_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Array) { + ArrayType castingValue = element.value(ArrayType.class); + vertices = castingValue.map((elementcastingValue) -> ChipStructs.ZoneManagementClusterTwoDCartesianVertexStruct.decodeTlv(elementcastingValue)); + } + } else if (element.contextTagNum() == COLOR_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + color = Optional.of(castingValue.value(String.class)); + } + } + } + return new ZoneManagementClusterTwoDCartesianZoneStruct( + name, + use, + vertices, + color + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("ZoneManagementClusterTwoDCartesianZoneStruct {\n"); + output.append("\tname: "); + output.append(name); + output.append("\n"); + output.append("\tuse: "); + output.append(use); + output.append("\n"); + output.append("\tvertices: "); + output.append(vertices); + output.append("\n"); + output.append("\tcolor: "); + output.append(color); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class ZoneManagementClusterZoneInformationStruct { + public Integer zoneID; + public Integer zoneType; + public Integer zoneSource; + private static final long ZONE_ID_ID = 0L; + private static final long ZONE_TYPE_ID = 1L; + private static final long ZONE_SOURCE_ID = 2L; + + public ZoneManagementClusterZoneInformationStruct( + Integer zoneID, + Integer zoneType, + Integer zoneSource + ) { + this.zoneID = zoneID; + this.zoneType = zoneType; + this.zoneSource = zoneSource; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(ZONE_ID_ID, new UIntType(zoneID))); + values.add(new StructElement(ZONE_TYPE_ID, new UIntType(zoneType))); + values.add(new StructElement(ZONE_SOURCE_ID, new UIntType(zoneSource))); + + return new StructType(values); + } + + public static ZoneManagementClusterZoneInformationStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer zoneID = null; + Integer zoneType = null; + Integer zoneSource = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == ZONE_ID_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + zoneID = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == ZONE_TYPE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + zoneType = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == ZONE_SOURCE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + zoneSource = castingValue.value(Integer.class); + } + } + } + return new ZoneManagementClusterZoneInformationStruct( + zoneID, + zoneType, + zoneSource + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("ZoneManagementClusterZoneInformationStruct {\n"); + output.append("\tzoneID: "); + output.append(zoneID); + output.append("\n"); + output.append("\tzoneType: "); + output.append(zoneType); + output.append("\n"); + output.append("\tzoneSource: "); + output.append(zoneSource); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class ZoneManagementClusterZoneTriggeringTimeControlStruct { + public Integer initialDuration; + public Integer augmentationDuration; + public Long maxDuration; + public Integer blindDuration; + private static final long INITIAL_DURATION_ID = 0L; + private static final long AUGMENTATION_DURATION_ID = 1L; + private static final long MAX_DURATION_ID = 2L; + private static final long BLIND_DURATION_ID = 3L; + + public ZoneManagementClusterZoneTriggeringTimeControlStruct( + Integer initialDuration, + Integer augmentationDuration, + Long maxDuration, + Integer blindDuration + ) { + this.initialDuration = initialDuration; + this.augmentationDuration = augmentationDuration; + this.maxDuration = maxDuration; + this.blindDuration = blindDuration; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(INITIAL_DURATION_ID, new UIntType(initialDuration))); + values.add(new StructElement(AUGMENTATION_DURATION_ID, new UIntType(augmentationDuration))); + values.add(new StructElement(MAX_DURATION_ID, new UIntType(maxDuration))); + values.add(new StructElement(BLIND_DURATION_ID, new UIntType(blindDuration))); + + return new StructType(values); + } + + public static ZoneManagementClusterZoneTriggeringTimeControlStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer initialDuration = null; + Integer augmentationDuration = null; + Long maxDuration = null; + Integer blindDuration = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == INITIAL_DURATION_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + initialDuration = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == AUGMENTATION_DURATION_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + augmentationDuration = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == MAX_DURATION_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + maxDuration = castingValue.value(Long.class); + } + } else if (element.contextTagNum() == BLIND_DURATION_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + blindDuration = castingValue.value(Integer.class); + } + } + } + return new ZoneManagementClusterZoneTriggeringTimeControlStruct( + initialDuration, + augmentationDuration, + maxDuration, + blindDuration + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("ZoneManagementClusterZoneTriggeringTimeControlStruct {\n"); + output.append("\tinitialDuration: "); + output.append(initialDuration); + output.append("\n"); + output.append("\taugmentationDuration: "); + output.append(augmentationDuration); + output.append("\n"); + output.append("\tmaxDuration: "); + output.append(maxDuration); + output.append("\n"); + output.append("\tblindDuration: "); + output.append(blindDuration); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} public static class WebRTCTransportProviderClusterICEServerStruct { public ArrayList urls; public Optional username; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java index 28a415a300..36adc73907 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -379,6 +379,9 @@ public static BaseCluster getCluster(long clusterId) { if (clusterId == ContentAppObserver.ID) { return new ContentAppObserver(); } + if (clusterId == ZoneManagement.ID) { + return new ZoneManagement(); + } if (clusterId == WebRTCTransportProvider.ID) { return new WebRTCTransportProvider(); } @@ -16888,6 +16891,184 @@ public long getCommandID(String name) throws IllegalArgumentException { return Command.valueOf(name).getID(); } } + public static class ZoneManagement implements BaseCluster { + public static final long ID = 1360L; + public long getID() { + return ID; + } + + public enum Attribute { + SupportedZoneSources(0L), + Zones(1L), + TimeControl(2L), + Sensitivity(3L), + GeneratedCommandList(65528L), + AcceptedCommandList(65529L), + EventList(65530L), + AttributeList(65531L), + FeatureMap(65532L), + ClusterRevision(65533L),; + private final long id; + Attribute(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Attribute value(long id) throws NoSuchFieldError { + for (Attribute attribute : Attribute.values()) { + if (attribute.getID() == id) { + return attribute; + } + } + throw new NoSuchFieldError(); + } + } + + public enum Event { + ZoneTriggered(0L), + ZoneStopped(1L),; + private final long id; + Event(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Event value(long id) throws NoSuchFieldError { + for (Event event : Event.values()) { + if (event.getID() == id) { + return event; + } + } + throw new NoSuchFieldError(); + } + } + + public enum Command { + CreateTwoDCartesianZone(0L), + UpdateTwoDCartesianZone(2L), + GetTwoDCartesianZone(3L), + RemoveZone(5L),; + private final long id; + Command(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Command value(long id) throws NoSuchFieldError { + for (Command command : Command.values()) { + if (command.getID() == id) { + return command; + } + } + throw new NoSuchFieldError(); + } + }public enum CreateTwoDCartesianZoneCommandField {Zone(0),; + private final int id; + CreateTwoDCartesianZoneCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static CreateTwoDCartesianZoneCommandField value(int id) throws NoSuchFieldError { + for (CreateTwoDCartesianZoneCommandField field : CreateTwoDCartesianZoneCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum UpdateTwoDCartesianZoneCommandField {ZoneID(0),Zone(1),; + private final int id; + UpdateTwoDCartesianZoneCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static UpdateTwoDCartesianZoneCommandField value(int id) throws NoSuchFieldError { + for (UpdateTwoDCartesianZoneCommandField field : UpdateTwoDCartesianZoneCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum GetTwoDCartesianZoneCommandField {ZoneID(0),; + private final int id; + GetTwoDCartesianZoneCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static GetTwoDCartesianZoneCommandField value(int id) throws NoSuchFieldError { + for (GetTwoDCartesianZoneCommandField field : GetTwoDCartesianZoneCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum RemoveZoneCommandField {ZoneID(0),; + private final int id; + RemoveZoneCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static RemoveZoneCommandField value(int id) throws NoSuchFieldError { + for (RemoveZoneCommandField field : RemoveZoneCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }@Override + public String getAttributeName(long id) throws NoSuchFieldError { + return Attribute.value(id).toString(); + } + + @Override + public String getEventName(long id) throws NoSuchFieldError { + return Event.value(id).toString(); + } + + @Override + public String getCommandName(long id) throws NoSuchFieldError { + return Command.value(id).toString(); + } + + @Override + public long getAttributeID(String name) throws IllegalArgumentException { + return Attribute.valueOf(name).getID(); + } + + @Override + public long getEventID(String name) throws IllegalArgumentException { + return Event.valueOf(name).getID(); + } + + @Override + public long getCommandID(String name) throws IllegalArgumentException { + return Command.valueOf(name).getID(); + } + } public static class WebRTCTransportProvider implements BaseCluster { public static final long ID = 1363L; public long getID() { diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java index 27dda463b3..a8ead57ed4 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java @@ -19995,6 +19995,198 @@ public void onError(Exception ex) { } + public static class DelegatedZoneManagementClusterCreateTwoDCartesianZoneResponseCallback implements ChipClusters.ZoneManagementCluster.CreateTwoDCartesianZoneResponseCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(Integer zoneID) { + Map responseValues = new LinkedHashMap<>(); + + CommandResponseInfo zoneIDResponseValue = new CommandResponseInfo("zoneID", "Integer"); + responseValues.put(zoneIDResponseValue, zoneID); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + + public static class DelegatedZoneManagementClusterGetTwoDCartesianZoneResponseCallback implements ChipClusters.ZoneManagementCluster.GetTwoDCartesianZoneResponseCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(ArrayList zones) { + Map responseValues = new LinkedHashMap<>(); + + // zones: TwoDCartesianZoneStruct + // Conversion from this type to Java is not properly implemented yet + + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + public static class DelegatedZoneManagementClusterSupportedZoneSourcesAttributeCallback implements ChipClusters.ZoneManagementCluster.SupportedZoneSourcesAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedZoneManagementClusterZonesAttributeCallback implements ChipClusters.ZoneManagementCluster.ZonesAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedZoneManagementClusterTimeControlAttributeCallback implements ChipClusters.ZoneManagementCluster.TimeControlAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedZoneManagementClusterGeneratedCommandListAttributeCallback implements ChipClusters.ZoneManagementCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedZoneManagementClusterAcceptedCommandListAttributeCallback implements ChipClusters.ZoneManagementCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedZoneManagementClusterEventListAttributeCallback implements ChipClusters.ZoneManagementCluster.EventListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedZoneManagementClusterAttributeListAttributeCallback implements ChipClusters.ZoneManagementCluster.AttributeListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedWebRTCTransportProviderClusterSolicitOfferResponseCallback implements ChipClusters.WebRTCTransportProviderCluster.SolicitOfferResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override @@ -22699,6 +22891,10 @@ public Map initializeClusterMap() { (ptr, endpointId) -> new ChipClusters.ContentAppObserverCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("contentAppObserver", contentAppObserverClusterInfo); + ClusterInfo zoneManagementClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.ZoneManagementCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("zoneManagement", zoneManagementClusterInfo); + ClusterInfo webRTCTransportProviderClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.WebRTCTransportProviderCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("webRTCTransportProvider", webRTCTransportProviderClusterInfo); @@ -22852,6 +23048,7 @@ public void combineCommand(Map destination, Map> getCommandMap() { commandMap.put("contentAppObserver", contentAppObserverClusterInteractionInfoMap); + Map zoneManagementClusterInteractionInfoMap = new LinkedHashMap<>(); + + Map zoneManagementcreateTwoDCartesianZoneCommandParams = new LinkedHashMap(); + + InteractionInfo zoneManagementcreateTwoDCartesianZoneInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ZoneManagementCluster) cluster) + .createTwoDCartesianZone((ChipClusters.ZoneManagementCluster.CreateTwoDCartesianZoneResponseCallback) callback + , (ChipStructs.ZoneManagementClusterTwoDCartesianZoneStruct) + commandArguments.get("zone") + + ); + }, + () -> new DelegatedZoneManagementClusterCreateTwoDCartesianZoneResponseCallback(), + zoneManagementcreateTwoDCartesianZoneCommandParams + ); + zoneManagementClusterInteractionInfoMap.put("createTwoDCartesianZone", zoneManagementcreateTwoDCartesianZoneInteractionInfo); + + Map zoneManagementupdateTwoDCartesianZoneCommandParams = new LinkedHashMap(); + + CommandParameterInfo zoneManagementupdateTwoDCartesianZonezoneIDCommandParameterInfo = new CommandParameterInfo("zoneID", Integer.class, Integer.class); + zoneManagementupdateTwoDCartesianZoneCommandParams.put("zoneID",zoneManagementupdateTwoDCartesianZonezoneIDCommandParameterInfo); + + InteractionInfo zoneManagementupdateTwoDCartesianZoneInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ZoneManagementCluster) cluster) + .updateTwoDCartesianZone((DefaultClusterCallback) callback + , (Integer) + commandArguments.get("zoneID") + , (ChipStructs.ZoneManagementClusterTwoDCartesianZoneStruct) + commandArguments.get("zone") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + zoneManagementupdateTwoDCartesianZoneCommandParams + ); + zoneManagementClusterInteractionInfoMap.put("updateTwoDCartesianZone", zoneManagementupdateTwoDCartesianZoneInteractionInfo); + + Map zoneManagementgetTwoDCartesianZoneCommandParams = new LinkedHashMap(); + + CommandParameterInfo zoneManagementgetTwoDCartesianZonezoneIDCommandParameterInfo = new CommandParameterInfo("zoneID", Optional.class, Integer.class); + zoneManagementgetTwoDCartesianZoneCommandParams.put("zoneID",zoneManagementgetTwoDCartesianZonezoneIDCommandParameterInfo); + InteractionInfo zoneManagementgetTwoDCartesianZoneInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ZoneManagementCluster) cluster) + .getTwoDCartesianZone((ChipClusters.ZoneManagementCluster.GetTwoDCartesianZoneResponseCallback) callback + , (Optional) + commandArguments.get("zoneID") + + ); + }, + () -> new DelegatedZoneManagementClusterGetTwoDCartesianZoneResponseCallback(), + zoneManagementgetTwoDCartesianZoneCommandParams + ); + zoneManagementClusterInteractionInfoMap.put("getTwoDCartesianZone", zoneManagementgetTwoDCartesianZoneInteractionInfo); + + Map zoneManagementremoveZoneCommandParams = new LinkedHashMap(); + + CommandParameterInfo zoneManagementremoveZonezoneIDCommandParameterInfo = new CommandParameterInfo("zoneID", Integer.class, Integer.class); + zoneManagementremoveZoneCommandParams.put("zoneID",zoneManagementremoveZonezoneIDCommandParameterInfo); + InteractionInfo zoneManagementremoveZoneInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ZoneManagementCluster) cluster) + .removeZone((DefaultClusterCallback) callback + , (Integer) + commandArguments.get("zoneID") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + zoneManagementremoveZoneCommandParams + ); + zoneManagementClusterInteractionInfoMap.put("removeZone", zoneManagementremoveZoneInteractionInfo); + + commandMap.put("zoneManagement", zoneManagementClusterInteractionInfoMap); + Map webRTCTransportProviderClusterInteractionInfoMap = new LinkedHashMap<>(); Map webRTCTransportProvidersolicitOfferCommandParams = new LinkedHashMap(); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java index 41df5ac5c8..7c1bdf9f43 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java @@ -18247,6 +18247,120 @@ private static Map readContentAppObserverInteractionInf return result; } + private static Map readZoneManagementInteractionInfo() { + Map result = new LinkedHashMap<>();Map readZoneManagementSupportedZoneSourcesCommandParams = new LinkedHashMap(); + InteractionInfo readZoneManagementSupportedZoneSourcesAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ZoneManagementCluster) cluster).readSupportedZoneSourcesAttribute( + (ChipClusters.ZoneManagementCluster.SupportedZoneSourcesAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedZoneManagementClusterSupportedZoneSourcesAttributeCallback(), + readZoneManagementSupportedZoneSourcesCommandParams + ); + result.put("readSupportedZoneSourcesAttribute", readZoneManagementSupportedZoneSourcesAttributeInteractionInfo); + Map readZoneManagementZonesCommandParams = new LinkedHashMap(); + InteractionInfo readZoneManagementZonesAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ZoneManagementCluster) cluster).readZonesAttribute( + (ChipClusters.ZoneManagementCluster.ZonesAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedZoneManagementClusterZonesAttributeCallback(), + readZoneManagementZonesCommandParams + ); + result.put("readZonesAttribute", readZoneManagementZonesAttributeInteractionInfo); + Map readZoneManagementTimeControlCommandParams = new LinkedHashMap(); + InteractionInfo readZoneManagementTimeControlAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ZoneManagementCluster) cluster).readTimeControlAttribute( + (ChipClusters.ZoneManagementCluster.TimeControlAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedZoneManagementClusterTimeControlAttributeCallback(), + readZoneManagementTimeControlCommandParams + ); + result.put("readTimeControlAttribute", readZoneManagementTimeControlAttributeInteractionInfo); + Map readZoneManagementSensitivityCommandParams = new LinkedHashMap(); + InteractionInfo readZoneManagementSensitivityAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ZoneManagementCluster) cluster).readSensitivityAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readZoneManagementSensitivityCommandParams + ); + result.put("readSensitivityAttribute", readZoneManagementSensitivityAttributeInteractionInfo); + Map readZoneManagementGeneratedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readZoneManagementGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ZoneManagementCluster) cluster).readGeneratedCommandListAttribute( + (ChipClusters.ZoneManagementCluster.GeneratedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedZoneManagementClusterGeneratedCommandListAttributeCallback(), + readZoneManagementGeneratedCommandListCommandParams + ); + result.put("readGeneratedCommandListAttribute", readZoneManagementGeneratedCommandListAttributeInteractionInfo); + Map readZoneManagementAcceptedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readZoneManagementAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ZoneManagementCluster) cluster).readAcceptedCommandListAttribute( + (ChipClusters.ZoneManagementCluster.AcceptedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedZoneManagementClusterAcceptedCommandListAttributeCallback(), + readZoneManagementAcceptedCommandListCommandParams + ); + result.put("readAcceptedCommandListAttribute", readZoneManagementAcceptedCommandListAttributeInteractionInfo); + Map readZoneManagementEventListCommandParams = new LinkedHashMap(); + InteractionInfo readZoneManagementEventListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ZoneManagementCluster) cluster).readEventListAttribute( + (ChipClusters.ZoneManagementCluster.EventListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedZoneManagementClusterEventListAttributeCallback(), + readZoneManagementEventListCommandParams + ); + result.put("readEventListAttribute", readZoneManagementEventListAttributeInteractionInfo); + Map readZoneManagementAttributeListCommandParams = new LinkedHashMap(); + InteractionInfo readZoneManagementAttributeListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ZoneManagementCluster) cluster).readAttributeListAttribute( + (ChipClusters.ZoneManagementCluster.AttributeListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedZoneManagementClusterAttributeListAttributeCallback(), + readZoneManagementAttributeListCommandParams + ); + result.put("readAttributeListAttribute", readZoneManagementAttributeListAttributeInteractionInfo); + Map readZoneManagementFeatureMapCommandParams = new LinkedHashMap(); + InteractionInfo readZoneManagementFeatureMapAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ZoneManagementCluster) cluster).readFeatureMapAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readZoneManagementFeatureMapCommandParams + ); + result.put("readFeatureMapAttribute", readZoneManagementFeatureMapAttributeInteractionInfo); + Map readZoneManagementClusterRevisionCommandParams = new LinkedHashMap(); + InteractionInfo readZoneManagementClusterRevisionAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ZoneManagementCluster) cluster).readClusterRevisionAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readZoneManagementClusterRevisionCommandParams + ); + result.put("readClusterRevisionAttribute", readZoneManagementClusterRevisionAttributeInteractionInfo); + + return result; + } private static Map readWebRTCTransportProviderInteractionInfo() { Map result = new LinkedHashMap<>();Map readWebRTCTransportProviderCurrentSessionsCommandParams = new LinkedHashMap(); InteractionInfo readWebRTCTransportProviderCurrentSessionsAttributeInteractionInfo = new InteractionInfo( @@ -19962,6 +20076,7 @@ public Map> getReadAttributeMap() { put("accountLogin", readAccountLoginInteractionInfo()); put("contentControl", readContentControlInteractionInfo()); put("contentAppObserver", readContentAppObserverInteractionInfo()); + put("zoneManagement", readZoneManagementInteractionInfo()); put("webRTCTransportProvider", readWebRTCTransportProviderInteractionInfo()); put("webRTCTransportRequestor", readWebRTCTransportRequestorInteractionInfo()); put("chime", readChimeInteractionInfo()); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java index b2ffaac83a..011171e81a 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java @@ -3472,6 +3472,30 @@ public Map> getWriteAttributeMap() { writeAttributeMap.put("contentControl", writeContentControlInteractionInfo); Map writeContentAppObserverInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("contentAppObserver", writeContentAppObserverInteractionInfo); + Map writeZoneManagementInteractionInfo = new LinkedHashMap<>(); + Map writeZoneManagementSensitivityCommandParams = new LinkedHashMap(); + CommandParameterInfo zoneManagementsensitivityCommandParameterInfo = + new CommandParameterInfo( + "value", + Integer.class, + Integer.class + ); + writeZoneManagementSensitivityCommandParams.put( + "value", + zoneManagementsensitivityCommandParameterInfo + ); + InteractionInfo writeZoneManagementSensitivityAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ZoneManagementCluster) cluster).writeSensitivityAttribute( + (DefaultClusterCallback) callback, + (Integer) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeZoneManagementSensitivityCommandParams + ); + writeZoneManagementInteractionInfo.put("writeSensitivityAttribute", writeZoneManagementSensitivityAttributeInteractionInfo); + writeAttributeMap.put("zoneManagement", writeZoneManagementInteractionInfo); Map writeWebRTCTransportProviderInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("webRTCTransportProvider", writeWebRTCTransportProviderInteractionInfo); Map writeWebRTCTransportRequestorInteractionInfo = new LinkedHashMap<>(); diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ZoneManagementClusterZoneStoppedEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ZoneManagementClusterZoneStoppedEvent.kt new file mode 100644 index 0000000000..ce1aba9101 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ZoneManagementClusterZoneStoppedEvent.kt @@ -0,0 +1,68 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.eventstructs + +import chip.devicecontroller.cluster.* +import matter.tlv.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ZoneManagementClusterZoneStoppedEvent(val zones: List, val reason: UInt) { + override fun toString(): String = buildString { + append("ZoneManagementClusterZoneStoppedEvent {\n") + append("\tzones : $zones\n") + append("\treason : $reason\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + startArray(ContextSpecificTag(TAG_ZONES)) + for (item in zones.iterator()) { + put(AnonymousTag, item) + } + endArray() + put(ContextSpecificTag(TAG_REASON), reason) + endStructure() + } + } + + companion object { + private const val TAG_ZONES = 0 + private const val TAG_REASON = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ZoneManagementClusterZoneStoppedEvent { + tlvReader.enterStructure(tlvTag) + val zones = + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_ZONES)) + while (!tlvReader.isEndOfContainer()) { + this.add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + val reason = tlvReader.getUInt(ContextSpecificTag(TAG_REASON)) + + tlvReader.exitContainer() + + return ZoneManagementClusterZoneStoppedEvent(zones, reason) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ZoneManagementClusterZoneTriggeredEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ZoneManagementClusterZoneTriggeredEvent.kt new file mode 100644 index 0000000000..610fee6521 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ZoneManagementClusterZoneTriggeredEvent.kt @@ -0,0 +1,68 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.eventstructs + +import chip.devicecontroller.cluster.* +import matter.tlv.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ZoneManagementClusterZoneTriggeredEvent(val zones: List, val reason: UInt) { + override fun toString(): String = buildString { + append("ZoneManagementClusterZoneTriggeredEvent {\n") + append("\tzones : $zones\n") + append("\treason : $reason\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + startArray(ContextSpecificTag(TAG_ZONES)) + for (item in zones.iterator()) { + put(AnonymousTag, item) + } + endArray() + put(ContextSpecificTag(TAG_REASON), reason) + endStructure() + } + } + + companion object { + private const val TAG_ZONES = 0 + private const val TAG_REASON = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ZoneManagementClusterZoneTriggeredEvent { + tlvReader.enterStructure(tlvTag) + val zones = + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_ZONES)) + while (!tlvReader.isEndOfContainer()) { + this.add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + val reason = tlvReader.getUInt(ContextSpecificTag(TAG_REASON)) + + tlvReader.exitContainer() + + return ZoneManagementClusterZoneTriggeredEvent(zones, reason) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni b/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni index 115bbe53cb..08a9ad5d6c 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni @@ -164,6 +164,10 @@ structs_sources = [ "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/WebRTCTransportProviderClusterWebRTCSessionStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/WebRTCTransportRequestorClusterICEServerStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/WebRTCTransportRequestorClusterWebRTCSessionStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterTwoDCartesianVertexStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterTwoDCartesianZoneStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterZoneInformationStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterZoneTriggeringTimeControlStruct.kt", ] eventstructs_sources = [ @@ -251,4 +255,6 @@ eventstructs_sources = [ "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterAssociationFailureEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterConnectionStatusEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterDisconnectionEvent.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ZoneManagementClusterZoneStoppedEvent.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ZoneManagementClusterZoneTriggeredEvent.kt", ] \ No newline at end of file diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterTwoDCartesianVertexStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterTwoDCartesianVertexStruct.kt new file mode 100644 index 0000000000..649b0338fd --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterTwoDCartesianVertexStruct.kt @@ -0,0 +1,56 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.structs + +import chip.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ZoneManagementClusterTwoDCartesianVertexStruct(val x: UInt, val y: UInt) { + override fun toString(): String = buildString { + append("ZoneManagementClusterTwoDCartesianVertexStruct {\n") + append("\tx : $x\n") + append("\ty : $y\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_X), x) + put(ContextSpecificTag(TAG_Y), y) + endStructure() + } + } + + companion object { + private const val TAG_X = 0 + private const val TAG_Y = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ZoneManagementClusterTwoDCartesianVertexStruct { + tlvReader.enterStructure(tlvTag) + val x = tlvReader.getUInt(ContextSpecificTag(TAG_X)) + val y = tlvReader.getUInt(ContextSpecificTag(TAG_Y)) + + tlvReader.exitContainer() + + return ZoneManagementClusterTwoDCartesianVertexStruct(x, y) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterTwoDCartesianZoneStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterTwoDCartesianZoneStruct.kt new file mode 100644 index 0000000000..b42e6ebd80 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterTwoDCartesianZoneStruct.kt @@ -0,0 +1,90 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.structs + +import chip.devicecontroller.cluster.* +import java.util.Optional +import matter.tlv.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ZoneManagementClusterTwoDCartesianZoneStruct( + val name: String, + val use: UInt, + val vertices: List, + val color: Optional, +) { + override fun toString(): String = buildString { + append("ZoneManagementClusterTwoDCartesianZoneStruct {\n") + append("\tname : $name\n") + append("\tuse : $use\n") + append("\tvertices : $vertices\n") + append("\tcolor : $color\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_NAME), name) + put(ContextSpecificTag(TAG_USE), use) + startArray(ContextSpecificTag(TAG_VERTICES)) + for (item in vertices.iterator()) { + item.toTlv(AnonymousTag, this) + } + endArray() + if (color.isPresent) { + val optcolor = color.get() + put(ContextSpecificTag(TAG_COLOR), optcolor) + } + endStructure() + } + } + + companion object { + private const val TAG_NAME = 0 + private const val TAG_USE = 1 + private const val TAG_VERTICES = 2 + private const val TAG_COLOR = 3 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ZoneManagementClusterTwoDCartesianZoneStruct { + tlvReader.enterStructure(tlvTag) + val name = tlvReader.getString(ContextSpecificTag(TAG_NAME)) + val use = tlvReader.getUInt(ContextSpecificTag(TAG_USE)) + val vertices = + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_VERTICES)) + while (!tlvReader.isEndOfContainer()) { + add(ZoneManagementClusterTwoDCartesianVertexStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + val color = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_COLOR))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_COLOR))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return ZoneManagementClusterTwoDCartesianZoneStruct(name, use, vertices, color) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterZoneInformationStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterZoneInformationStruct.kt new file mode 100644 index 0000000000..3073c80152 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterZoneInformationStruct.kt @@ -0,0 +1,64 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.structs + +import chip.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ZoneManagementClusterZoneInformationStruct( + val zoneID: UInt, + val zoneType: UInt, + val zoneSource: UInt, +) { + override fun toString(): String = buildString { + append("ZoneManagementClusterZoneInformationStruct {\n") + append("\tzoneID : $zoneID\n") + append("\tzoneType : $zoneType\n") + append("\tzoneSource : $zoneSource\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_ZONE_ID), zoneID) + put(ContextSpecificTag(TAG_ZONE_TYPE), zoneType) + put(ContextSpecificTag(TAG_ZONE_SOURCE), zoneSource) + endStructure() + } + } + + companion object { + private const val TAG_ZONE_ID = 0 + private const val TAG_ZONE_TYPE = 1 + private const val TAG_ZONE_SOURCE = 2 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ZoneManagementClusterZoneInformationStruct { + tlvReader.enterStructure(tlvTag) + val zoneID = tlvReader.getUInt(ContextSpecificTag(TAG_ZONE_ID)) + val zoneType = tlvReader.getUInt(ContextSpecificTag(TAG_ZONE_TYPE)) + val zoneSource = tlvReader.getUInt(ContextSpecificTag(TAG_ZONE_SOURCE)) + + tlvReader.exitContainer() + + return ZoneManagementClusterZoneInformationStruct(zoneID, zoneType, zoneSource) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterZoneTriggeringTimeControlStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterZoneTriggeringTimeControlStruct.kt new file mode 100644 index 0000000000..3e55171ac8 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterZoneTriggeringTimeControlStruct.kt @@ -0,0 +1,77 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.structs + +import chip.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ZoneManagementClusterZoneTriggeringTimeControlStruct( + val initialDuration: UInt, + val augmentationDuration: UInt, + val maxDuration: ULong, + val blindDuration: UInt, +) { + override fun toString(): String = buildString { + append("ZoneManagementClusterZoneTriggeringTimeControlStruct {\n") + append("\tinitialDuration : $initialDuration\n") + append("\taugmentationDuration : $augmentationDuration\n") + append("\tmaxDuration : $maxDuration\n") + append("\tblindDuration : $blindDuration\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_INITIAL_DURATION), initialDuration) + put(ContextSpecificTag(TAG_AUGMENTATION_DURATION), augmentationDuration) + put(ContextSpecificTag(TAG_MAX_DURATION), maxDuration) + put(ContextSpecificTag(TAG_BLIND_DURATION), blindDuration) + endStructure() + } + } + + companion object { + private const val TAG_INITIAL_DURATION = 0 + private const val TAG_AUGMENTATION_DURATION = 1 + private const val TAG_MAX_DURATION = 2 + private const val TAG_BLIND_DURATION = 3 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): ZoneManagementClusterZoneTriggeringTimeControlStruct { + tlvReader.enterStructure(tlvTag) + val initialDuration = tlvReader.getUInt(ContextSpecificTag(TAG_INITIAL_DURATION)) + val augmentationDuration = tlvReader.getUInt(ContextSpecificTag(TAG_AUGMENTATION_DURATION)) + val maxDuration = tlvReader.getULong(ContextSpecificTag(TAG_MAX_DURATION)) + val blindDuration = tlvReader.getUInt(ContextSpecificTag(TAG_BLIND_DURATION)) + + tlvReader.exitContainer() + + return ZoneManagementClusterZoneTriggeringTimeControlStruct( + initialDuration, + augmentationDuration, + maxDuration, + blindDuration, + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/ZoneManagementCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/ZoneManagementCluster.kt new file mode 100644 index 0000000000..c51fe6eaf0 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/ZoneManagementCluster.kt @@ -0,0 +1,1296 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package matter.controller.cluster.clusters + +import java.time.Duration +import java.util.logging.Level +import java.util.logging.Logger +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.transform +import matter.controller.InvokeRequest +import matter.controller.InvokeResponse +import matter.controller.MatterController +import matter.controller.ReadData +import matter.controller.ReadRequest +import matter.controller.SubscribeRequest +import matter.controller.SubscriptionState +import matter.controller.UByteSubscriptionState +import matter.controller.UIntSubscriptionState +import matter.controller.UShortSubscriptionState +import matter.controller.WriteRequest +import matter.controller.WriteRequests +import matter.controller.WriteResponse +import matter.controller.cluster.structs.* +import matter.controller.model.AttributePath +import matter.controller.model.CommandPath +import matter.tlv.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ZoneManagementCluster( + private val controller: MatterController, + private val endpointId: UShort, +) { + class CreateTwoDCartesianZoneResponse(val zoneID: UShort) + + class GetTwoDCartesianZoneResponse(val zones: List) + + class SupportedZoneSourcesAttribute(val value: List) + + sealed class SupportedZoneSourcesAttributeSubscriptionState { + data class Success(val value: List) : SupportedZoneSourcesAttributeSubscriptionState() + + data class Error(val exception: Exception) : SupportedZoneSourcesAttributeSubscriptionState() + + object SubscriptionEstablished : SupportedZoneSourcesAttributeSubscriptionState() + } + + class ZonesAttribute(val value: List?) + + sealed class ZonesAttributeSubscriptionState { + data class Success(val value: List?) : + ZonesAttributeSubscriptionState() + + data class Error(val exception: Exception) : ZonesAttributeSubscriptionState() + + object SubscriptionEstablished : ZonesAttributeSubscriptionState() + } + + class TimeControlAttribute(val value: List) + + sealed class TimeControlAttributeSubscriptionState { + data class Success(val value: List) : + TimeControlAttributeSubscriptionState() + + data class Error(val exception: Exception) : TimeControlAttributeSubscriptionState() + + object SubscriptionEstablished : TimeControlAttributeSubscriptionState() + } + + class GeneratedCommandListAttribute(val value: List) + + sealed class GeneratedCommandListAttributeSubscriptionState { + data class Success(val value: List) : GeneratedCommandListAttributeSubscriptionState() + + data class Error(val exception: Exception) : GeneratedCommandListAttributeSubscriptionState() + + object SubscriptionEstablished : GeneratedCommandListAttributeSubscriptionState() + } + + class AcceptedCommandListAttribute(val value: List) + + sealed class AcceptedCommandListAttributeSubscriptionState { + data class Success(val value: List) : AcceptedCommandListAttributeSubscriptionState() + + data class Error(val exception: Exception) : AcceptedCommandListAttributeSubscriptionState() + + object SubscriptionEstablished : AcceptedCommandListAttributeSubscriptionState() + } + + class EventListAttribute(val value: List) + + sealed class EventListAttributeSubscriptionState { + data class Success(val value: List) : EventListAttributeSubscriptionState() + + data class Error(val exception: Exception) : EventListAttributeSubscriptionState() + + object SubscriptionEstablished : EventListAttributeSubscriptionState() + } + + class AttributeListAttribute(val value: List) + + sealed class AttributeListAttributeSubscriptionState { + data class Success(val value: List) : AttributeListAttributeSubscriptionState() + + data class Error(val exception: Exception) : AttributeListAttributeSubscriptionState() + + object SubscriptionEstablished : AttributeListAttributeSubscriptionState() + } + + suspend fun createTwoDCartesianZone( + zone: ZoneManagementClusterTwoDCartesianZoneStruct, + timedInvokeTimeout: Duration? = null, + ): CreateTwoDCartesianZoneResponse { + val commandId: UInt = 0u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_ZONE_REQ: Int = 0 + zone.toTlv(ContextSpecificTag(TAG_ZONE_REQ), tlvWriter) + tlvWriter.endStructure() + + val request: InvokeRequest = + InvokeRequest( + CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), + tlvPayload = tlvWriter.getEncoded(), + timedRequest = timedInvokeTimeout, + ) + + val response: InvokeResponse = controller.invoke(request) + logger.log(Level.FINE, "Invoke command succeeded: ${response}") + + val tlvReader = TlvReader(response.payload) + tlvReader.enterStructure(AnonymousTag) + val TAG_ZONE_ID: Int = 0 + var zoneID_decoded: UShort? = null + + while (!tlvReader.isEndOfContainer()) { + val tag = tlvReader.peekElement().tag + + if (tag == ContextSpecificTag(TAG_ZONE_ID)) { + zoneID_decoded = tlvReader.getUShort(tag) + } else { + tlvReader.skipElement() + } + } + + if (zoneID_decoded == null) { + throw IllegalStateException("zoneID not found in TLV") + } + + tlvReader.exitContainer() + + return CreateTwoDCartesianZoneResponse(zoneID_decoded) + } + + suspend fun updateTwoDCartesianZone( + zoneID: UShort, + zone: ZoneManagementClusterTwoDCartesianZoneStruct, + timedInvokeTimeout: Duration? = null, + ) { + val commandId: UInt = 2u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_ZONE_ID_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_ZONE_ID_REQ), zoneID) + + val TAG_ZONE_REQ: Int = 1 + zone.toTlv(ContextSpecificTag(TAG_ZONE_REQ), tlvWriter) + tlvWriter.endStructure() + + val request: InvokeRequest = + InvokeRequest( + CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), + tlvPayload = tlvWriter.getEncoded(), + timedRequest = timedInvokeTimeout, + ) + + val response: InvokeResponse = controller.invoke(request) + logger.log(Level.FINE, "Invoke command succeeded: ${response}") + } + + suspend fun getTwoDCartesianZone( + zoneID: UShort?, + timedInvokeTimeout: Duration? = null, + ): GetTwoDCartesianZoneResponse { + val commandId: UInt = 3u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_ZONE_ID_REQ: Int = 0 + zoneID?.let { tlvWriter.put(ContextSpecificTag(TAG_ZONE_ID_REQ), zoneID) } + tlvWriter.endStructure() + + val request: InvokeRequest = + InvokeRequest( + CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), + tlvPayload = tlvWriter.getEncoded(), + timedRequest = timedInvokeTimeout, + ) + + val response: InvokeResponse = controller.invoke(request) + logger.log(Level.FINE, "Invoke command succeeded: ${response}") + + val tlvReader = TlvReader(response.payload) + tlvReader.enterStructure(AnonymousTag) + val TAG_ZONES: Int = 0 + var zones_decoded: List? = null + + while (!tlvReader.isEndOfContainer()) { + val tag = tlvReader.peekElement().tag + + if (tag == ContextSpecificTag(TAG_ZONES)) { + zones_decoded = + buildList { + tlvReader.enterArray(tag) + while (!tlvReader.isEndOfContainer()) { + add(ZoneManagementClusterTwoDCartesianZoneStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + } else { + tlvReader.skipElement() + } + } + + if (zones_decoded == null) { + throw IllegalStateException("zones not found in TLV") + } + + tlvReader.exitContainer() + + return GetTwoDCartesianZoneResponse(zones_decoded) + } + + suspend fun removeZone(zoneID: UShort, timedInvokeTimeout: Duration? = null) { + val commandId: UInt = 5u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_ZONE_ID_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_ZONE_ID_REQ), zoneID) + tlvWriter.endStructure() + + val request: InvokeRequest = + InvokeRequest( + CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), + tlvPayload = tlvWriter.getEncoded(), + timedRequest = timedInvokeTimeout, + ) + + val response: InvokeResponse = controller.invoke(request) + logger.log(Level.FINE, "Invoke command succeeded: ${response}") + } + + suspend fun readSupportedZoneSourcesAttribute(): SupportedZoneSourcesAttribute { + val ATTRIBUTE_ID: UInt = 0u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Supportedzonesources attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUByte(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return SupportedZoneSourcesAttribute(decodedValue) + } + + suspend fun subscribeSupportedZoneSourcesAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 0u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + SupportedZoneSourcesAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Supportedzonesources attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUByte(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(SupportedZoneSourcesAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(SupportedZoneSourcesAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readZonesAttribute(): ZonesAttribute { + val ATTRIBUTE_ID: UInt = 1u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Zones attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (tlvReader.isNextTag(AnonymousTag)) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(ZoneManagementClusterZoneInformationStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + } else { + null + } + + return ZonesAttribute(decodedValue) + } + + suspend fun subscribeZonesAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 1u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + ZonesAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Zones attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (tlvReader.isNextTag(AnonymousTag)) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(ZoneManagementClusterZoneInformationStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + } else { + null + } + + decodedValue?.let { emit(ZonesAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(ZonesAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readTimeControlAttribute(): TimeControlAttribute { + val ATTRIBUTE_ID: UInt = 2u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Timecontrol attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(ZoneManagementClusterZoneTriggeringTimeControlStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + + return TimeControlAttribute(decodedValue) + } + + suspend fun writeTimeControlAttribute( + value: List, + timedWriteTimeout: Duration? = null, + ) { + val ATTRIBUTE_ID: UInt = 2u + + val tlvWriter = TlvWriter() + tlvWriter.startArray(AnonymousTag) + for (item in value.iterator()) { + item.toTlv(AnonymousTag, tlvWriter) + } + tlvWriter.endArray() + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeTimeControlAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 2u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + TimeControlAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Timecontrol attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add( + ZoneManagementClusterZoneTriggeringTimeControlStruct.fromTlv( + AnonymousTag, + tlvReader, + ) + ) + } + tlvReader.exitContainer() + } + + emit(TimeControlAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(TimeControlAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readSensitivityAttribute(): UByte { + val ATTRIBUTE_ID: UInt = 3u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Sensitivity attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte = tlvReader.getUByte(AnonymousTag) + + return decodedValue + } + + suspend fun writeSensitivityAttribute(value: UByte, timedWriteTimeout: Duration? = null) { + val ATTRIBUTE_ID: UInt = 3u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeSensitivityAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 3u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UByteSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Sensitivity attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte = tlvReader.getUByte(AnonymousTag) + + emit(UByteSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(UByteSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readGeneratedCommandListAttribute(): GeneratedCommandListAttribute { + val ATTRIBUTE_ID: UInt = 65528u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Generatedcommandlist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return GeneratedCommandListAttribute(decodedValue) + } + + suspend fun subscribeGeneratedCommandListAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65528u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + GeneratedCommandListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Generatedcommandlist attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(GeneratedCommandListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(GeneratedCommandListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readAcceptedCommandListAttribute(): AcceptedCommandListAttribute { + val ATTRIBUTE_ID: UInt = 65529u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Acceptedcommandlist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return AcceptedCommandListAttribute(decodedValue) + } + + suspend fun subscribeAcceptedCommandListAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65529u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + AcceptedCommandListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Acceptedcommandlist attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(AcceptedCommandListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(AcceptedCommandListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readEventListAttribute(): EventListAttribute { + val ATTRIBUTE_ID: UInt = 65530u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Eventlist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return EventListAttribute(decodedValue) + } + + suspend fun subscribeEventListAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65530u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + EventListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Eventlist attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(EventListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(EventListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readAttributeListAttribute(): AttributeListAttribute { + val ATTRIBUTE_ID: UInt = 65531u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Attributelist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return AttributeListAttribute(decodedValue) + } + + suspend fun subscribeAttributeListAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65531u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + AttributeListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Attributelist attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(AttributeListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(AttributeListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readFeatureMapAttribute(): UInt { + val ATTRIBUTE_ID: UInt = 65532u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Featuremap attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt = tlvReader.getUInt(AnonymousTag) + + return decodedValue + } + + suspend fun subscribeFeatureMapAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65532u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UIntSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Featuremap attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt = tlvReader.getUInt(AnonymousTag) + + emit(UIntSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(UIntSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readClusterRevisionAttribute(): UShort { + val ATTRIBUTE_ID: UInt = 65533u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Clusterrevision attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UShort = tlvReader.getUShort(AnonymousTag) + + return decodedValue + } + + suspend fun subscribeClusterRevisionAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65533u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UShortSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Clusterrevision attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UShort = tlvReader.getUShort(AnonymousTag) + + emit(UShortSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(UShortSubscriptionState.SubscriptionEstablished) + } + } + } + } + + companion object { + private val logger = Logger.getLogger(ZoneManagementCluster::class.java.name) + const val CLUSTER_ID: UInt = 1360u + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ZoneManagementClusterZoneStoppedEvent.kt b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ZoneManagementClusterZoneStoppedEvent.kt new file mode 100644 index 0000000000..424437cf89 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ZoneManagementClusterZoneStoppedEvent.kt @@ -0,0 +1,68 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.controller.cluster.eventstructs + +import matter.controller.cluster.* +import matter.tlv.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ZoneManagementClusterZoneStoppedEvent(val zones: List, val reason: UByte) { + override fun toString(): String = buildString { + append("ZoneManagementClusterZoneStoppedEvent {\n") + append("\tzones : $zones\n") + append("\treason : $reason\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + startArray(ContextSpecificTag(TAG_ZONES)) + for (item in zones.iterator()) { + put(AnonymousTag, item) + } + endArray() + put(ContextSpecificTag(TAG_REASON), reason) + endStructure() + } + } + + companion object { + private const val TAG_ZONES = 0 + private const val TAG_REASON = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ZoneManagementClusterZoneStoppedEvent { + tlvReader.enterStructure(tlvTag) + val zones = + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_ZONES)) + while (!tlvReader.isEndOfContainer()) { + this.add(tlvReader.getUShort(AnonymousTag)) + } + tlvReader.exitContainer() + } + val reason = tlvReader.getUByte(ContextSpecificTag(TAG_REASON)) + + tlvReader.exitContainer() + + return ZoneManagementClusterZoneStoppedEvent(zones, reason) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ZoneManagementClusterZoneTriggeredEvent.kt b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ZoneManagementClusterZoneTriggeredEvent.kt new file mode 100644 index 0000000000..42300fd350 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ZoneManagementClusterZoneTriggeredEvent.kt @@ -0,0 +1,68 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.controller.cluster.eventstructs + +import matter.controller.cluster.* +import matter.tlv.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ZoneManagementClusterZoneTriggeredEvent(val zones: List, val reason: UByte) { + override fun toString(): String = buildString { + append("ZoneManagementClusterZoneTriggeredEvent {\n") + append("\tzones : $zones\n") + append("\treason : $reason\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + startArray(ContextSpecificTag(TAG_ZONES)) + for (item in zones.iterator()) { + put(AnonymousTag, item) + } + endArray() + put(ContextSpecificTag(TAG_REASON), reason) + endStructure() + } + } + + companion object { + private const val TAG_ZONES = 0 + private const val TAG_REASON = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ZoneManagementClusterZoneTriggeredEvent { + tlvReader.enterStructure(tlvTag) + val zones = + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_ZONES)) + while (!tlvReader.isEndOfContainer()) { + this.add(tlvReader.getUShort(AnonymousTag)) + } + tlvReader.exitContainer() + } + val reason = tlvReader.getUByte(ContextSpecificTag(TAG_REASON)) + + tlvReader.exitContainer() + + return ZoneManagementClusterZoneTriggeredEvent(zones, reason) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/files.gni b/src/controller/java/generated/java/matter/controller/cluster/files.gni index 73e0a1190a..a237dc9521 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/files.gni +++ b/src/controller/java/generated/java/matter/controller/cluster/files.gni @@ -164,6 +164,10 @@ matter_structs_sources = [ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/WebRTCTransportProviderClusterWebRTCSessionStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/WebRTCTransportRequestorClusterICEServerStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/WebRTCTransportRequestorClusterWebRTCSessionStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterTwoDCartesianVertexStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterTwoDCartesianZoneStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterZoneInformationStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterZoneTriggeringTimeControlStruct.kt", ] matter_eventstructs_sources = [ @@ -251,6 +255,8 @@ matter_eventstructs_sources = [ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterAssociationFailureEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterConnectionStatusEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterDisconnectionEvent.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ZoneManagementClusterZoneStoppedEvent.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ZoneManagementClusterZoneTriggeredEvent.kt", ] matter_clusters_sources = [ @@ -379,4 +385,5 @@ matter_clusters_sources = [ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/WiFiNetworkDiagnosticsCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/WiFiNetworkManagementCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/WindowCoveringCluster.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/ZoneManagementCluster.kt", ] \ No newline at end of file diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterTwoDCartesianVertexStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterTwoDCartesianVertexStruct.kt new file mode 100644 index 0000000000..3ff890b7ec --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterTwoDCartesianVertexStruct.kt @@ -0,0 +1,56 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.controller.cluster.structs + +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ZoneManagementClusterTwoDCartesianVertexStruct(val x: UShort, val y: UShort) { + override fun toString(): String = buildString { + append("ZoneManagementClusterTwoDCartesianVertexStruct {\n") + append("\tx : $x\n") + append("\ty : $y\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_X), x) + put(ContextSpecificTag(TAG_Y), y) + endStructure() + } + } + + companion object { + private const val TAG_X = 0 + private const val TAG_Y = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ZoneManagementClusterTwoDCartesianVertexStruct { + tlvReader.enterStructure(tlvTag) + val x = tlvReader.getUShort(ContextSpecificTag(TAG_X)) + val y = tlvReader.getUShort(ContextSpecificTag(TAG_Y)) + + tlvReader.exitContainer() + + return ZoneManagementClusterTwoDCartesianVertexStruct(x, y) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterTwoDCartesianZoneStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterTwoDCartesianZoneStruct.kt new file mode 100644 index 0000000000..117fabb709 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterTwoDCartesianZoneStruct.kt @@ -0,0 +1,90 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.controller.cluster.structs + +import java.util.Optional +import matter.controller.cluster.* +import matter.tlv.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ZoneManagementClusterTwoDCartesianZoneStruct( + val name: String, + val use: UByte, + val vertices: List, + val color: Optional, +) { + override fun toString(): String = buildString { + append("ZoneManagementClusterTwoDCartesianZoneStruct {\n") + append("\tname : $name\n") + append("\tuse : $use\n") + append("\tvertices : $vertices\n") + append("\tcolor : $color\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_NAME), name) + put(ContextSpecificTag(TAG_USE), use) + startArray(ContextSpecificTag(TAG_VERTICES)) + for (item in vertices.iterator()) { + item.toTlv(AnonymousTag, this) + } + endArray() + if (color.isPresent) { + val optcolor = color.get() + put(ContextSpecificTag(TAG_COLOR), optcolor) + } + endStructure() + } + } + + companion object { + private const val TAG_NAME = 0 + private const val TAG_USE = 1 + private const val TAG_VERTICES = 2 + private const val TAG_COLOR = 3 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ZoneManagementClusterTwoDCartesianZoneStruct { + tlvReader.enterStructure(tlvTag) + val name = tlvReader.getString(ContextSpecificTag(TAG_NAME)) + val use = tlvReader.getUByte(ContextSpecificTag(TAG_USE)) + val vertices = + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_VERTICES)) + while (!tlvReader.isEndOfContainer()) { + add(ZoneManagementClusterTwoDCartesianVertexStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + val color = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_COLOR))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_COLOR))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return ZoneManagementClusterTwoDCartesianZoneStruct(name, use, vertices, color) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterZoneInformationStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterZoneInformationStruct.kt new file mode 100644 index 0000000000..8de10c83a4 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterZoneInformationStruct.kt @@ -0,0 +1,64 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.controller.cluster.structs + +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ZoneManagementClusterZoneInformationStruct( + val zoneID: UShort, + val zoneType: UByte, + val zoneSource: UByte, +) { + override fun toString(): String = buildString { + append("ZoneManagementClusterZoneInformationStruct {\n") + append("\tzoneID : $zoneID\n") + append("\tzoneType : $zoneType\n") + append("\tzoneSource : $zoneSource\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_ZONE_ID), zoneID) + put(ContextSpecificTag(TAG_ZONE_TYPE), zoneType) + put(ContextSpecificTag(TAG_ZONE_SOURCE), zoneSource) + endStructure() + } + } + + companion object { + private const val TAG_ZONE_ID = 0 + private const val TAG_ZONE_TYPE = 1 + private const val TAG_ZONE_SOURCE = 2 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ZoneManagementClusterZoneInformationStruct { + tlvReader.enterStructure(tlvTag) + val zoneID = tlvReader.getUShort(ContextSpecificTag(TAG_ZONE_ID)) + val zoneType = tlvReader.getUByte(ContextSpecificTag(TAG_ZONE_TYPE)) + val zoneSource = tlvReader.getUByte(ContextSpecificTag(TAG_ZONE_SOURCE)) + + tlvReader.exitContainer() + + return ZoneManagementClusterZoneInformationStruct(zoneID, zoneType, zoneSource) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterZoneTriggeringTimeControlStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterZoneTriggeringTimeControlStruct.kt new file mode 100644 index 0000000000..8978d74256 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterZoneTriggeringTimeControlStruct.kt @@ -0,0 +1,77 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.controller.cluster.structs + +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ZoneManagementClusterZoneTriggeringTimeControlStruct( + val initialDuration: UShort, + val augmentationDuration: UShort, + val maxDuration: UInt, + val blindDuration: UShort, +) { + override fun toString(): String = buildString { + append("ZoneManagementClusterZoneTriggeringTimeControlStruct {\n") + append("\tinitialDuration : $initialDuration\n") + append("\taugmentationDuration : $augmentationDuration\n") + append("\tmaxDuration : $maxDuration\n") + append("\tblindDuration : $blindDuration\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_INITIAL_DURATION), initialDuration) + put(ContextSpecificTag(TAG_AUGMENTATION_DURATION), augmentationDuration) + put(ContextSpecificTag(TAG_MAX_DURATION), maxDuration) + put(ContextSpecificTag(TAG_BLIND_DURATION), blindDuration) + endStructure() + } + } + + companion object { + private const val TAG_INITIAL_DURATION = 0 + private const val TAG_AUGMENTATION_DURATION = 1 + private const val TAG_MAX_DURATION = 2 + private const val TAG_BLIND_DURATION = 3 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): ZoneManagementClusterZoneTriggeringTimeControlStruct { + tlvReader.enterStructure(tlvTag) + val initialDuration = tlvReader.getUShort(ContextSpecificTag(TAG_INITIAL_DURATION)) + val augmentationDuration = tlvReader.getUShort(ContextSpecificTag(TAG_AUGMENTATION_DURATION)) + val maxDuration = tlvReader.getUInt(ContextSpecificTag(TAG_MAX_DURATION)) + val blindDuration = tlvReader.getUShort(ContextSpecificTag(TAG_BLIND_DURATION)) + + tlvReader.exitContainer() + + return ZoneManagementClusterZoneTriggeringTimeControlStruct( + initialDuration, + augmentationDuration, + maxDuration, + blindDuration, + ) + } + } +} diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index 19f3f8d3ed..217e10fc3a 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -42236,6 +42236,328 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } + case app::Clusters::ZoneManagement::Id: { + using namespace app::Clusters::ZoneManagement; + switch (aPath.mAttributeId) + { + case Attributes::SupportedZoneSources::Id: { + using TypeInfo = Attributes::SupportedZoneSources::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Integer"; + std::string newElement_0CtorSignature = "(I)V"; + jint jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::Zones::Id: { + using TypeInfo = Attributes::Zones::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + jobject newElement_0_zoneID; + std::string newElement_0_zoneIDClassName = "java/lang/Integer"; + std::string newElement_0_zoneIDCtorSignature = "(I)V"; + jint jninewElement_0_zoneID = static_cast(entry_0.zoneID); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_zoneIDClassName.c_str(), + newElement_0_zoneIDCtorSignature.c_str(), + jninewElement_0_zoneID, newElement_0_zoneID); + jobject newElement_0_zoneType; + std::string newElement_0_zoneTypeClassName = "java/lang/Integer"; + std::string newElement_0_zoneTypeCtorSignature = "(I)V"; + jint jninewElement_0_zoneType = static_cast(entry_0.zoneType); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_zoneTypeClassName.c_str(), + newElement_0_zoneTypeCtorSignature.c_str(), + jninewElement_0_zoneType, newElement_0_zoneType); + jobject newElement_0_zoneSource; + std::string newElement_0_zoneSourceClassName = "java/lang/Integer"; + std::string newElement_0_zoneSourceCtorSignature = "(I)V"; + jint jninewElement_0_zoneSource = static_cast(entry_0.zoneSource); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_zoneSourceClassName.c_str(), + newElement_0_zoneSourceCtorSignature.c_str(), + jninewElement_0_zoneSource, newElement_0_zoneSource); + + jclass zoneInformationStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ZoneManagementClusterZoneInformationStruct", + zoneInformationStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ZoneManagementClusterZoneInformationStruct"); + return nullptr; + } + + jmethodID zoneInformationStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, zoneInformationStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V", + &zoneInformationStructStructCtor_1); + if (err != CHIP_NO_ERROR || zoneInformationStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ZoneManagementClusterZoneInformationStruct constructor"); + return nullptr; + } + + newElement_0 = env->NewObject(zoneInformationStructStructClass_1, zoneInformationStructStructCtor_1, + newElement_0_zoneID, newElement_0_zoneType, newElement_0_zoneSource); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::TimeControl::Id: { + using TypeInfo = Attributes::TimeControl::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + jobject newElement_0_initialDuration; + std::string newElement_0_initialDurationClassName = "java/lang/Integer"; + std::string newElement_0_initialDurationCtorSignature = "(I)V"; + jint jninewElement_0_initialDuration = static_cast(entry_0.initialDuration); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_initialDurationClassName.c_str(), newElement_0_initialDurationCtorSignature.c_str(), + jninewElement_0_initialDuration, newElement_0_initialDuration); + jobject newElement_0_augmentationDuration; + std::string newElement_0_augmentationDurationClassName = "java/lang/Integer"; + std::string newElement_0_augmentationDurationCtorSignature = "(I)V"; + jint jninewElement_0_augmentationDuration = static_cast(entry_0.augmentationDuration); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_augmentationDurationClassName.c_str(), newElement_0_augmentationDurationCtorSignature.c_str(), + jninewElement_0_augmentationDuration, newElement_0_augmentationDuration); + jobject newElement_0_maxDuration; + std::string newElement_0_maxDurationClassName = "java/lang/Long"; + std::string newElement_0_maxDurationCtorSignature = "(J)V"; + jlong jninewElement_0_maxDuration = static_cast(entry_0.maxDuration); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_maxDurationClassName.c_str(), + newElement_0_maxDurationCtorSignature.c_str(), + jninewElement_0_maxDuration, newElement_0_maxDuration); + jobject newElement_0_blindDuration; + std::string newElement_0_blindDurationClassName = "java/lang/Integer"; + std::string newElement_0_blindDurationCtorSignature = "(I)V"; + jint jninewElement_0_blindDuration = static_cast(entry_0.blindDuration); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_blindDurationClassName.c_str(), newElement_0_blindDurationCtorSignature.c_str(), + jninewElement_0_blindDuration, newElement_0_blindDuration); + + jclass zoneTriggeringTimeControlStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ZoneManagementClusterZoneTriggeringTimeControlStruct", + zoneTriggeringTimeControlStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ZoneManagementClusterZoneTriggeringTimeControlStruct"); + return nullptr; + } + + jmethodID zoneTriggeringTimeControlStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, zoneTriggeringTimeControlStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Integer;)V", + &zoneTriggeringTimeControlStructStructCtor_1); + if (err != CHIP_NO_ERROR || zoneTriggeringTimeControlStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$ZoneManagementClusterZoneTriggeringTimeControlStruct constructor"); + return nullptr; + } + + newElement_0 = + env->NewObject(zoneTriggeringTimeControlStructStructClass_1, zoneTriggeringTimeControlStructStructCtor_1, + newElement_0_initialDuration, newElement_0_augmentationDuration, newElement_0_maxDuration, + newElement_0_blindDuration); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::Sensitivity::Id: { + using TypeInfo = Attributes::Sensitivity::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + case Attributes::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AcceptedCommandList::Id: { + using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::EventList::Id: { + using TypeInfo = Attributes::EventList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AttributeList::Id: { + using TypeInfo = Attributes::AttributeList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::FeatureMap::Id: { + using TypeInfo = Attributes::FeatureMap::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::ClusterRevision::Id: { + using TypeInfo = Attributes::ClusterRevision::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + break; + } + break; + } case app::Clusters::WebRTCTransportProvider::Id: { using namespace app::Clusters::WebRTCTransportProvider; switch (aPath.mAttributeId) diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index 45f2344180..dcb49ce662 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -8248,6 +8248,120 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } + case app::Clusters::ZoneManagement::Id: { + using namespace app::Clusters::ZoneManagement; + switch (aPath.mEventId) + { + case Events::ZoneTriggered::Id: { + Events::ZoneTriggered::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value_zones; + chip::JniReferences::GetInstance().CreateArrayList(value_zones); + + auto iter_value_zones_0 = cppValue.zones.begin(); + while (iter_value_zones_0.Next()) + { + auto & entry_0 = iter_value_zones_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Integer"; + std::string newElement_0CtorSignature = "(I)V"; + jint jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value_zones, newElement_0); + } + + jobject value_reason; + std::string value_reasonClassName = "java/lang/Integer"; + std::string value_reasonCtorSignature = "(I)V"; + jint jnivalue_reason = static_cast(cppValue.reason); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_reasonClassName.c_str(), value_reasonCtorSignature.c_str(), jnivalue_reason, value_reason); + + jclass zoneTriggeredStructClass; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipEventStructs$ZoneManagementClusterZoneTriggeredEvent", zoneTriggeredStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$ZoneManagementClusterZoneTriggeredEvent"); + return nullptr; + } + + jmethodID zoneTriggeredStructCtor; + err = chip::JniReferences::GetInstance().FindMethod( + env, zoneTriggeredStructClass, "", "(Ljava/util/ArrayList;Ljava/lang/Integer;)V", &zoneTriggeredStructCtor); + if (err != CHIP_NO_ERROR || zoneTriggeredStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$ZoneManagementClusterZoneTriggeredEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(zoneTriggeredStructClass, zoneTriggeredStructCtor, value_zones, value_reason); + + return value; + } + case Events::ZoneStopped::Id: { + Events::ZoneStopped::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value_zones; + chip::JniReferences::GetInstance().CreateArrayList(value_zones); + + auto iter_value_zones_0 = cppValue.zones.begin(); + while (iter_value_zones_0.Next()) + { + auto & entry_0 = iter_value_zones_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Integer"; + std::string newElement_0CtorSignature = "(I)V"; + jint jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value_zones, newElement_0); + } + + jobject value_reason; + std::string value_reasonClassName = "java/lang/Integer"; + std::string value_reasonCtorSignature = "(I)V"; + jint jnivalue_reason = static_cast(cppValue.reason); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_reasonClassName.c_str(), value_reasonCtorSignature.c_str(), jnivalue_reason, value_reason); + + jclass zoneStoppedStructClass; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipEventStructs$ZoneManagementClusterZoneStoppedEvent", zoneStoppedStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$ZoneManagementClusterZoneStoppedEvent"); + return nullptr; + } + + jmethodID zoneStoppedStructCtor; + err = chip::JniReferences::GetInstance().FindMethod( + env, zoneStoppedStructClass, "", "(Ljava/util/ArrayList;Ljava/lang/Integer;)V", &zoneStoppedStructCtor); + if (err != CHIP_NO_ERROR || zoneStoppedStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$ZoneManagementClusterZoneStoppedEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(zoneStoppedStructClass, zoneStoppedStructCtor, value_zones, value_reason); + + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + break; + } + break; + } case app::Clusters::WebRTCTransportProvider::Id: { using namespace app::Clusters::WebRTCTransportProvider; switch (aPath.mEventId) diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index e0aec01394..fda87c81ec 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -13035,6 +13035,105 @@ class ChipClusters: }, }, } + _ZONE_MANAGEMENT_CLUSTER_INFO = { + "clusterName": "ZoneManagement", + "clusterId": 0x00000550, + "commands": { + 0x00000000: { + "commandId": 0x00000000, + "commandName": "CreateTwoDCartesianZone", + "args": { + "zone": "TwoDCartesianZoneStruct", + }, + }, + 0x00000002: { + "commandId": 0x00000002, + "commandName": "UpdateTwoDCartesianZone", + "args": { + "zoneID": "int", + "zone": "TwoDCartesianZoneStruct", + }, + }, + 0x00000003: { + "commandId": 0x00000003, + "commandName": "GetTwoDCartesianZone", + "args": { + "zoneID": "int", + }, + }, + 0x00000005: { + "commandId": 0x00000005, + "commandName": "RemoveZone", + "args": { + "zoneID": "int", + }, + }, + }, + "attributes": { + 0x00000000: { + "attributeName": "SupportedZoneSources", + "attributeId": 0x00000000, + "type": "int", + "reportable": True, + }, + 0x00000001: { + "attributeName": "Zones", + "attributeId": 0x00000001, + "type": "", + "reportable": True, + }, + 0x00000002: { + "attributeName": "TimeControl", + "attributeId": 0x00000002, + "type": "", + "reportable": True, + "writable": True, + }, + 0x00000003: { + "attributeName": "Sensitivity", + "attributeId": 0x00000003, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x0000FFF8: { + "attributeName": "GeneratedCommandList", + "attributeId": 0x0000FFF8, + "type": "int", + "reportable": True, + }, + 0x0000FFF9: { + "attributeName": "AcceptedCommandList", + "attributeId": 0x0000FFF9, + "type": "int", + "reportable": True, + }, + 0x0000FFFA: { + "attributeName": "EventList", + "attributeId": 0x0000FFFA, + "type": "int", + "reportable": True, + }, + 0x0000FFFB: { + "attributeName": "AttributeList", + "attributeId": 0x0000FFFB, + "type": "int", + "reportable": True, + }, + 0x0000FFFC: { + "attributeName": "FeatureMap", + "attributeId": 0x0000FFFC, + "type": "int", + "reportable": True, + }, + 0x0000FFFD: { + "attributeName": "ClusterRevision", + "attributeId": 0x0000FFFD, + "type": "int", + "reportable": True, + }, + }, + } _WEB_RTC_TRANSPORT_PROVIDER_CLUSTER_INFO = { "clusterName": "WebRTCTransportProvider", "clusterId": 0x00000553, @@ -14537,6 +14636,7 @@ class ChipClusters: 0x0000050E: _ACCOUNT_LOGIN_CLUSTER_INFO, 0x0000050F: _CONTENT_CONTROL_CLUSTER_INFO, 0x00000510: _CONTENT_APP_OBSERVER_CLUSTER_INFO, + 0x00000550: _ZONE_MANAGEMENT_CLUSTER_INFO, 0x00000553: _WEB_RTC_TRANSPORT_PROVIDER_CLUSTER_INFO, 0x00000554: _WEB_RTC_TRANSPORT_REQUESTOR_CLUSTER_INFO, 0x00000556: _CHIME_CLUSTER_INFO, @@ -14665,6 +14765,7 @@ class ChipClusters: "AccountLogin": _ACCOUNT_LOGIN_CLUSTER_INFO, "ContentControl": _CONTENT_CONTROL_CLUSTER_INFO, "ContentAppObserver": _CONTENT_APP_OBSERVER_CLUSTER_INFO, + "ZoneManagement": _ZONE_MANAGEMENT_CLUSTER_INFO, "WebRTCTransportProvider": _WEB_RTC_TRANSPORT_PROVIDER_CLUSTER_INFO, "WebRTCTransportRequestor": _WEB_RTC_TRANSPORT_REQUESTOR_CLUSTER_INFO, "Chime": _CHIME_CLUSTER_INFO, diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index bd4f5cfbd8..4e886049df 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -156,6 +156,7 @@ "AccountLogin", "ContentControl", "ContentAppObserver", + "ZoneManagement", "WebRTCTransportProvider", "WebRTCTransportRequestor", "Chime", @@ -46537,6 +46538,462 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'uint' = 0 +@dataclass +class ZoneManagement(Cluster): + id: typing.ClassVar[int] = 0x00000550 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="supportedZoneSources", Tag=0x00000000, Type=typing.List[ZoneManagement.Enums.ZoneSourceEnum]), + ClusterObjectFieldDescriptor(Label="zones", Tag=0x00000001, Type=typing.Optional[typing.List[ZoneManagement.Structs.ZoneInformationStruct]]), + ClusterObjectFieldDescriptor(Label="timeControl", Tag=0x00000002, Type=typing.List[ZoneManagement.Structs.ZoneTriggeringTimeControlStruct]), + ClusterObjectFieldDescriptor(Label="sensitivity", Tag=0x00000003, Type=uint), + ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=uint), + ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), + ]) + + supportedZoneSources: 'typing.List[ZoneManagement.Enums.ZoneSourceEnum]' = None + zones: 'typing.Optional[typing.List[ZoneManagement.Structs.ZoneInformationStruct]]' = None + timeControl: 'typing.List[ZoneManagement.Structs.ZoneTriggeringTimeControlStruct]' = None + sensitivity: 'uint' = None + generatedCommandList: 'typing.List[uint]' = None + acceptedCommandList: 'typing.List[uint]' = None + eventList: 'typing.List[uint]' = None + attributeList: 'typing.List[uint]' = None + featureMap: 'uint' = None + clusterRevision: 'uint' = None + + class Enums: + class StatusCodeEnum(MatterIntEnum): + kZoneNotFound = 0x02 + kZoneInUse = 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 + + class ZoneEventStoppedReasonEnum(MatterIntEnum): + kActionStopped = 0x00 + kTimeout = 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 ZoneEventTriggeredReasonEnum(MatterIntEnum): + kMotion = 0x00 + # 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 = 1 + + class ZoneSourceEnum(MatterIntEnum): + kMfg = 0x00 + kUser = 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 ZoneTypeEnum(MatterIntEnum): + kTwoDCARTZone = 0x00 + # 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 = 1 + + class ZoneUseEnum(MatterIntEnum): + kMotion = 0x00 + kPrivacy = 0x01 + kFocus = 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 Bitmaps: + class Feature(IntFlag): + kTwoDimensionalCartesianZone = 0x1 + + class Structs: + @dataclass + class TwoDCartesianVertexStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="x", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="y", Tag=1, Type=uint), + ]) + + x: 'uint' = 0 + y: 'uint' = 0 + + @dataclass + class TwoDCartesianZoneStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="name", Tag=0, Type=str), + ClusterObjectFieldDescriptor(Label="use", Tag=1, Type=ZoneManagement.Enums.ZoneUseEnum), + ClusterObjectFieldDescriptor(Label="vertices", Tag=2, Type=typing.List[ZoneManagement.Structs.TwoDCartesianVertexStruct]), + ClusterObjectFieldDescriptor(Label="color", Tag=3, Type=typing.Optional[str]), + ]) + + name: 'str' = "" + use: 'ZoneManagement.Enums.ZoneUseEnum' = 0 + vertices: 'typing.List[ZoneManagement.Structs.TwoDCartesianVertexStruct]' = field(default_factory=lambda: []) + color: 'typing.Optional[str]' = None + + @dataclass + class ZoneInformationStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="zoneID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="zoneType", Tag=1, Type=ZoneManagement.Enums.ZoneTypeEnum), + ClusterObjectFieldDescriptor(Label="zoneSource", Tag=2, Type=ZoneManagement.Enums.ZoneSourceEnum), + ]) + + zoneID: 'uint' = 0 + zoneType: 'ZoneManagement.Enums.ZoneTypeEnum' = 0 + zoneSource: 'ZoneManagement.Enums.ZoneSourceEnum' = 0 + + @dataclass + class ZoneTriggeringTimeControlStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="initialDuration", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="augmentationDuration", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="maxDuration", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="blindDuration", Tag=3, Type=uint), + ]) + + initialDuration: 'uint' = 0 + augmentationDuration: 'uint' = 0 + maxDuration: 'uint' = 0 + blindDuration: 'uint' = 0 + + class Commands: + @dataclass + class CreateTwoDCartesianZone(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000550 + command_id: typing.ClassVar[int] = 0x00000000 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = 'CreateTwoDCartesianZoneResponse' + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="zone", Tag=0, Type=ZoneManagement.Structs.TwoDCartesianZoneStruct), + ]) + + zone: 'ZoneManagement.Structs.TwoDCartesianZoneStruct' = field(default_factory=lambda: ZoneManagement.Structs.TwoDCartesianZoneStruct()) + + @dataclass + class CreateTwoDCartesianZoneResponse(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000550 + command_id: typing.ClassVar[int] = 0x00000001 + is_client: typing.ClassVar[bool] = False + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="zoneID", Tag=0, Type=uint), + ]) + + zoneID: 'uint' = 0 + + @dataclass + class UpdateTwoDCartesianZone(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000550 + command_id: typing.ClassVar[int] = 0x00000002 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="zoneID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="zone", Tag=1, Type=ZoneManagement.Structs.TwoDCartesianZoneStruct), + ]) + + zoneID: 'uint' = 0 + zone: 'ZoneManagement.Structs.TwoDCartesianZoneStruct' = field(default_factory=lambda: ZoneManagement.Structs.TwoDCartesianZoneStruct()) + + @dataclass + class GetTwoDCartesianZone(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000550 + command_id: typing.ClassVar[int] = 0x00000003 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = 'GetTwoDCartesianZoneResponse' + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="zoneID", Tag=0, Type=typing.Union[None, Nullable, uint]), + ]) + + zoneID: 'typing.Union[None, Nullable, uint]' = None + + @dataclass + class GetTwoDCartesianZoneResponse(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000550 + command_id: typing.ClassVar[int] = 0x00000004 + is_client: typing.ClassVar[bool] = False + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="zones", Tag=0, Type=typing.List[ZoneManagement.Structs.TwoDCartesianZoneStruct]), + ]) + + zones: 'typing.List[ZoneManagement.Structs.TwoDCartesianZoneStruct]' = field(default_factory=lambda: []) + + @dataclass + class RemoveZone(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000550 + command_id: typing.ClassVar[int] = 0x00000005 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="zoneID", Tag=0, Type=uint), + ]) + + zoneID: 'uint' = 0 + + class Attributes: + @dataclass + class SupportedZoneSources(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000550 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[ZoneManagement.Enums.ZoneSourceEnum]) + + value: 'typing.List[ZoneManagement.Enums.ZoneSourceEnum]' = field(default_factory=lambda: []) + + @dataclass + class Zones(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000550 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000001 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[typing.List[ZoneManagement.Structs.ZoneInformationStruct]]) + + value: 'typing.Optional[typing.List[ZoneManagement.Structs.ZoneInformationStruct]]' = None + + @dataclass + class TimeControl(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000550 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000002 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[ZoneManagement.Structs.ZoneTriggeringTimeControlStruct]) + + value: 'typing.List[ZoneManagement.Structs.ZoneTriggeringTimeControlStruct]' = field(default_factory=lambda: []) + + @dataclass + class Sensitivity(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000550 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000003 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass + class GeneratedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000550 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFF8 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class AcceptedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000550 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFF9 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class EventList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000550 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFA + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class AttributeList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000550 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFB + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class FeatureMap(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000550 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFC + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass + class ClusterRevision(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000550 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFD + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + class Events: + @dataclass + class ZoneTriggered(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000550 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="zones", Tag=0, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="reason", Tag=1, Type=ZoneManagement.Enums.ZoneEventTriggeredReasonEnum), + ]) + + zones: 'typing.List[uint]' = field(default_factory=lambda: []) + reason: 'ZoneManagement.Enums.ZoneEventTriggeredReasonEnum' = 0 + + @dataclass + class ZoneStopped(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000550 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000001 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="zones", Tag=0, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="reason", Tag=1, Type=ZoneManagement.Enums.ZoneEventStoppedReasonEnum), + ]) + + zones: 'typing.List[uint]' = field(default_factory=lambda: []) + reason: 'ZoneManagement.Enums.ZoneEventStoppedReasonEnum' = 0 + + @dataclass class WebRTCTransportProvider(Cluster): id: typing.ClassVar[int] = 0x00000553 diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm index a3d3649fb1..50fe1dcfc9 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm @@ -5915,6 +5915,45 @@ static BOOL AttributeIsSpecifiedInContentAppObserverCluster(AttributeId aAttribu } } } +static BOOL AttributeIsSpecifiedInZoneManagementCluster(AttributeId aAttributeId) +{ + using namespace Clusters::ZoneManagement; + switch (aAttributeId) { + case Attributes::SupportedZoneSources::Id: { + return YES; + } + case Attributes::Zones::Id: { + return YES; + } + case Attributes::TimeControl::Id: { + return YES; + } + case Attributes::Sensitivity::Id: { + return YES; + } + case Attributes::GeneratedCommandList::Id: { + return YES; + } + case Attributes::AcceptedCommandList::Id: { + return YES; + } + case Attributes::EventList::Id: { + return YES; + } + case Attributes::AttributeList::Id: { + return YES; + } + case Attributes::FeatureMap::Id: { + return YES; + } + case Attributes::ClusterRevision::Id: { + return YES; + } + default: { + return NO; + } + } +} static BOOL AttributeIsSpecifiedInWebRTCTransportProviderCluster(AttributeId aAttributeId) { using namespace Clusters::WebRTCTransportProvider; @@ -6744,6 +6783,9 @@ BOOL MTRAttributeIsSpecified(ClusterId aClusterId, AttributeId aAttributeId) case Clusters::ContentAppObserver::Id: { return AttributeIsSpecifiedInContentAppObserverCluster(aAttributeId); } + case Clusters::ZoneManagement::Id: { + return AttributeIsSpecifiedInZoneManagementCluster(aAttributeId); + } case Clusters::WebRTCTransportProvider::Id: { return AttributeIsSpecifiedInWebRTCTransportProviderCluster(aAttributeId); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index 686b92c333..32c5f4d79d 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -16910,6 +16910,114 @@ static id _Nullable DecodeAttributeValueForContentAppObserverCluster(AttributeId *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } +static id _Nullable DecodeAttributeValueForZoneManagementCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::ZoneManagement; + switch (aAttributeId) { + case Attributes::SupportedZoneSources::Id: { + using TypeInfo = Attributes::SupportedZoneSources::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::Zones::Id: { + using TypeInfo = Attributes::Zones::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRZoneManagementClusterZoneInformationStruct * newElement_0; + newElement_0 = [MTRZoneManagementClusterZoneInformationStruct new]; + newElement_0.zoneID = [NSNumber numberWithUnsignedShort:entry_0.zoneID]; + newElement_0.zoneType = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.zoneType)]; + newElement_0.zoneSource = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.zoneSource)]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::TimeControl::Id: { + using TypeInfo = Attributes::TimeControl::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRZoneManagementClusterZoneTriggeringTimeControlStruct * newElement_0; + newElement_0 = [MTRZoneManagementClusterZoneTriggeringTimeControlStruct new]; + newElement_0.initialDuration = [NSNumber numberWithUnsignedShort:entry_0.initialDuration]; + newElement_0.augmentationDuration = [NSNumber numberWithUnsignedShort:entry_0.augmentationDuration]; + newElement_0.maxDuration = [NSNumber numberWithUnsignedInt:entry_0.maxDuration]; + newElement_0.blindDuration = [NSNumber numberWithUnsignedShort:entry_0.blindDuration]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::Sensitivity::Id: { + using TypeInfo = Attributes::Sensitivity::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} static id _Nullable DecodeAttributeValueForWebRTCTransportProviderCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { using namespace Clusters::WebRTCTransportProvider; @@ -19192,6 +19300,9 @@ id _Nullable MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::T case Clusters::ContentAppObserver::Id: { return DecodeAttributeValueForContentAppObserverCluster(aPath.mAttributeId, aReader, aError); } + case Clusters::ZoneManagement::Id: { + return DecodeAttributeValueForZoneManagementCluster(aPath.mAttributeId, aReader, aError); + } case Clusters::WebRTCTransportProvider::Id: { return DecodeAttributeValueForWebRTCTransportProviderCluster(aPath.mAttributeId, aReader, aError); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 8f23fc159f..563d5e12ec 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -14762,6 +14762,122 @@ MTR_PROVISIONALLY_AVAILABLE @end +/** + * Cluster Zone Management + * + * This cluster provides an interface to manage regions of interest, or Zones, which can be either manufacturer or user defined. + */ +MTR_PROVISIONALLY_AVAILABLE +@interface MTRBaseClusterZoneManagement : MTRGenericBaseCluster + +/** + * Command CreateTwoDCartesianZone + * + * This command SHALL create and store a TwoD Cartesian Zone. + */ +- (void)createTwoDCartesianZoneWithParams:(MTRZoneManagementClusterCreateTwoDCartesianZoneParams *)params completion:(void (^)(MTRZoneManagementClusterCreateTwoDCartesianZoneResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command UpdateTwoDCartesianZone + * + * The UpdateTwoDCartesianZone SHALL update a stored TwoD Cartesian Zone. + */ +- (void)updateTwoDCartesianZoneWithParams:(MTRZoneManagementClusterUpdateTwoDCartesianZoneParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command GetTwoDCartesianZone + * + * The GetTwoDCartesianZone SHALL return the TwoD Cartesian Zone for the passed in ZoneID. + */ +- (void)getTwoDCartesianZoneWithParams:(MTRZoneManagementClusterGetTwoDCartesianZoneParams * _Nullable)params completion:(void (^)(MTRZoneManagementClusterGetTwoDCartesianZoneResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)getTwoDCartesianZoneWithCompletion:(void (^)(MTRZoneManagementClusterGetTwoDCartesianZoneResponseParams * _Nullable data, NSError * _Nullable error))completion + MTR_PROVISIONALLY_AVAILABLE; +/** + * Command RemoveZone + * + * This command SHALL remove the Zone mapped to the passed in ZoneID. + */ +- (void)removeZoneWithParams:(MTRZoneManagementClusterRemoveZoneParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeSupportedZoneSourcesWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeSupportedZoneSourcesWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeSupportedZoneSourcesWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeZonesWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeZonesWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeZonesWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeTimeControlWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeTimeControlWithValue:(NSArray * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeTimeControlWithValue:(NSArray * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeTimeControlWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeTimeControlWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeSensitivityWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSensitivityWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSensitivityWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeSensitivityWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeSensitivityWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +@interface MTRBaseClusterZoneManagement (Availability) + +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ +- (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue MTR_PROVISIONALLY_AVAILABLE; + +@end + /** * Cluster WebRTC Transport Provider * @@ -20370,6 +20486,39 @@ typedef NS_ENUM(uint8_t, MTRContentAppObserverStatus) { MTRContentAppObserverStatusUnexpectedData MTR_PROVISIONALLY_AVAILABLE = 0x01, } MTR_PROVISIONALLY_AVAILABLE; +typedef NS_ENUM(uint8_t, MTRZoneManagementStatusCode) { + MTRZoneManagementStatusCodeZoneNotFound MTR_PROVISIONALLY_AVAILABLE = 0x02, + MTRZoneManagementStatusCodeZoneInUse MTR_PROVISIONALLY_AVAILABLE = 0x03, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRZoneManagementZoneEventStoppedReason) { + MTRZoneManagementZoneEventStoppedReasonActionStopped MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRZoneManagementZoneEventStoppedReasonTimeout MTR_PROVISIONALLY_AVAILABLE = 0x01, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRZoneManagementZoneEventTriggeredReason) { + MTRZoneManagementZoneEventTriggeredReasonMotion MTR_PROVISIONALLY_AVAILABLE = 0x00, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRZoneManagementZoneSource) { + MTRZoneManagementZoneSourceMfg MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRZoneManagementZoneSourceUser MTR_PROVISIONALLY_AVAILABLE = 0x01, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRZoneManagementZoneType) { + MTRZoneManagementZoneTypeTwoDCARTZone MTR_PROVISIONALLY_AVAILABLE = 0x00, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRZoneManagementZoneUse) { + MTRZoneManagementZoneUseMotion MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRZoneManagementZoneUsePrivacy MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTRZoneManagementZoneUseFocus MTR_PROVISIONALLY_AVAILABLE = 0x02, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_OPTIONS(uint32_t, MTRZoneManagementFeature) { + MTRZoneManagementFeatureTwoDimensionalCartesianZone MTR_PROVISIONALLY_AVAILABLE = 0x1, +} MTR_PROVISIONALLY_AVAILABLE; + typedef NS_ENUM(uint8_t, MTRWebRTCTransportProviderStreamType) { MTRWebRTCTransportProviderStreamTypeInternal MTR_PROVISIONALLY_AVAILABLE = 0x00, MTRWebRTCTransportProviderStreamTypeRecording MTR_PROVISIONALLY_AVAILABLE = 0x01, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index 80e36303d3..4106e3eab6 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -102121,6 +102121,551 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC @end +@implementation MTRBaseClusterZoneManagement + +- (void)createTwoDCartesianZoneWithParams:(MTRZoneManagementClusterCreateTwoDCartesianZoneParams *)params completion:(void (^)(MTRZoneManagementClusterCreateTwoDCartesianZoneResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + if (params == nil) { + params = [[MTRZoneManagementClusterCreateTwoDCartesianZoneParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ZoneManagement::Commands::CreateTwoDCartesianZone::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRZoneManagementClusterCreateTwoDCartesianZoneResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)updateTwoDCartesianZoneWithParams:(MTRZoneManagementClusterUpdateTwoDCartesianZoneParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRZoneManagementClusterUpdateTwoDCartesianZoneParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ZoneManagement::Commands::UpdateTwoDCartesianZone::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)getTwoDCartesianZoneWithCompletion:(void (^)(MTRZoneManagementClusterGetTwoDCartesianZoneResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + [self getTwoDCartesianZoneWithParams:nil completion:completion]; +} +- (void)getTwoDCartesianZoneWithParams:(MTRZoneManagementClusterGetTwoDCartesianZoneParams * _Nullable)params completion:(void (^)(MTRZoneManagementClusterGetTwoDCartesianZoneResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + if (params == nil) { + params = [[MTRZoneManagementClusterGetTwoDCartesianZoneParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ZoneManagement::Commands::GetTwoDCartesianZone::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRZoneManagementClusterGetTwoDCartesianZoneResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)removeZoneWithParams:(MTRZoneManagementClusterRemoveZoneParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRZoneManagementClusterRemoveZoneParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ZoneManagement::Commands::RemoveZone::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)readAttributeSupportedZoneSourcesWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ZoneManagement::Attributes::SupportedZoneSources::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeSupportedZoneSourcesWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = ZoneManagement::Attributes::SupportedZoneSources::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeSupportedZoneSourcesWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ZoneManagement::Attributes::SupportedZoneSources::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeZonesWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ZoneManagement::Attributes::Zones::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeZonesWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = ZoneManagement::Attributes::Zones::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeZonesWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ZoneManagement::Attributes::Zones::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeTimeControlWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ZoneManagement::Attributes::TimeControl::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeTimeControlWithValue:(NSArray * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeTimeControlWithValue:(NSArray * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeTimeControlWithValue:(NSArray * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = ZoneManagement::Attributes::TimeControl::TypeInfo; + TypeInfo::Type cppValue; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (value.count != 0) { + auto * listHolder_0 = new ListHolder(value.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < value.count; ++i_0) { + if ( ! [value[i_0] isKindOfClass: [MTRZoneManagementClusterZoneTriggeringTimeControlStruct class]] ) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (MTRZoneManagementClusterZoneTriggeringTimeControlStruct *)value[i_0]; + listHolder_0->mList[i_0].initialDuration = element_0.initialDuration.unsignedShortValue; + listHolder_0->mList[i_0].augmentationDuration = element_0.augmentationDuration.unsignedShortValue; + listHolder_0->mList[i_0].maxDuration = element_0.maxDuration.unsignedIntValue; + listHolder_0->mList[i_0].blindDuration = element_0.blindDuration.unsignedShortValue; + } + cppValue = ListType_0(listHolder_0->mList, value.count); + } else { + cppValue = ListType_0(); + } + } + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeTimeControlWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = ZoneManagement::Attributes::TimeControl::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeTimeControlWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ZoneManagement::Attributes::TimeControl::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeSensitivityWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ZoneManagement::Attributes::Sensitivity::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeSensitivityWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeSensitivityWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeSensitivityWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = ZoneManagement::Attributes::Sensitivity::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeSensitivityWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = ZoneManagement::Attributes::Sensitivity::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeSensitivityWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ZoneManagement::Attributes::Sensitivity::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ZoneManagement::Attributes::GeneratedCommandList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = ZoneManagement::Attributes::GeneratedCommandList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ZoneManagement::Attributes::GeneratedCommandList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ZoneManagement::Attributes::AcceptedCommandList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = ZoneManagement::Attributes::AcceptedCommandList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ZoneManagement::Attributes::AcceptedCommandList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ZoneManagement::Attributes::EventList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = ZoneManagement::Attributes::EventList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ZoneManagement::Attributes::EventList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ZoneManagement::Attributes::AttributeList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = ZoneManagement::Attributes::AttributeList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ZoneManagement::Attributes::AttributeList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ZoneManagement::Attributes::FeatureMap::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = ZoneManagement::Attributes::FeatureMap::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ZoneManagement::Attributes::FeatureMap::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ZoneManagement::Attributes::ClusterRevision::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = ZoneManagement::Attributes::ClusterRevision::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ZoneManagement::Attributes::ClusterRevision::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +@end + @implementation MTRBaseClusterWebRTCTransportProvider - (void)solicitOfferWithParams:(MTRWebRTCTransportProviderClusterSolicitOfferParams *)params completion:(void (^)(MTRWebRTCTransportProviderClusterSolicitOfferResponseParams * _Nullable data, NSError * _Nullable error))completion diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index fdefd1f503..2623ff86b5 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -197,6 +197,7 @@ typedef NS_ENUM(uint32_t, MTRClusterIDType) { MTRClusterIDTypeAccountLoginID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x0000050E, MTRClusterIDTypeContentControlID MTR_PROVISIONALLY_AVAILABLE = 0x0000050F, MTRClusterIDTypeContentAppObserverID MTR_PROVISIONALLY_AVAILABLE = 0x00000510, + MTRClusterIDTypeZoneManagementID MTR_PROVISIONALLY_AVAILABLE = 0x00000550, MTRClusterIDTypeWebRTCTransportProviderID MTR_PROVISIONALLY_AVAILABLE = 0x00000553, MTRClusterIDTypeWebRTCTransportRequestorID MTR_PROVISIONALLY_AVAILABLE = 0x00000554, MTRClusterIDTypeChimeID MTR_PROVISIONALLY_AVAILABLE = 0x00000556, @@ -4742,6 +4743,18 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterContentAppObserverAttributeFeatureMapID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeFeatureMapID, MTRAttributeIDTypeClusterContentAppObserverAttributeClusterRevisionID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster ZoneManagement attributes + MTRAttributeIDTypeClusterZoneManagementAttributeSupportedZoneSourcesID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + MTRAttributeIDTypeClusterZoneManagementAttributeZonesID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + MTRAttributeIDTypeClusterZoneManagementAttributeTimeControlID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, + MTRAttributeIDTypeClusterZoneManagementAttributeSensitivityID MTR_PROVISIONALLY_AVAILABLE = 0x00000003, + MTRAttributeIDTypeClusterZoneManagementAttributeGeneratedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, + MTRAttributeIDTypeClusterZoneManagementAttributeAcceptedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, + MTRAttributeIDTypeClusterZoneManagementAttributeEventListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeEventListID, + MTRAttributeIDTypeClusterZoneManagementAttributeAttributeListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAttributeListID, + MTRAttributeIDTypeClusterZoneManagementAttributeFeatureMapID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeFeatureMapID, + MTRAttributeIDTypeClusterZoneManagementAttributeClusterRevisionID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster WebRTCTransportProvider attributes MTRAttributeIDTypeClusterWebRTCTransportProviderAttributeCurrentSessionsID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, MTRAttributeIDTypeClusterWebRTCTransportProviderAttributeGeneratedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, @@ -6964,6 +6977,14 @@ typedef NS_ENUM(uint32_t, MTRCommandIDType) { MTRCommandIDTypeClusterContentAppObserverCommandContentAppMessageID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, MTRCommandIDTypeClusterContentAppObserverCommandContentAppMessageResponseID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + // Cluster ZoneManagement commands + MTRCommandIDTypeClusterZoneManagementCommandCreateTwoDCartesianZoneID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + MTRCommandIDTypeClusterZoneManagementCommandCreateTwoDCartesianZoneResponseID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + MTRCommandIDTypeClusterZoneManagementCommandUpdateTwoDCartesianZoneID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, + MTRCommandIDTypeClusterZoneManagementCommandGetTwoDCartesianZoneID MTR_PROVISIONALLY_AVAILABLE = 0x00000003, + MTRCommandIDTypeClusterZoneManagementCommandGetTwoDCartesianZoneResponseID MTR_PROVISIONALLY_AVAILABLE = 0x00000004, + MTRCommandIDTypeClusterZoneManagementCommandRemoveZoneID MTR_PROVISIONALLY_AVAILABLE = 0x00000005, + // Cluster WebRTCTransportProvider commands MTRCommandIDTypeClusterWebRTCTransportProviderCommandSolicitOfferID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, MTRCommandIDTypeClusterWebRTCTransportProviderCommandSolicitOfferResponseID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, @@ -7563,6 +7584,10 @@ typedef NS_ENUM(uint32_t, MTREventIDType) { // Cluster ContentControl events MTREventIDTypeClusterContentControlEventRemainingScreenTimeExpiredID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + // Cluster ZoneManagement events + MTREventIDTypeClusterZoneManagementEventZoneTriggeredID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + MTREventIDTypeClusterZoneManagementEventZoneStoppedID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + // Cluster CommissionerControl events MTREventIDTypeClusterCommissionerControlEventCommissioningRequestResultID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm index f69444d9a1..863188d378 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm @@ -369,6 +369,9 @@ case MTRClusterIDTypeContentAppObserverID: result = @"ContentAppObserver"; break; + case MTRClusterIDTypeZoneManagementID: + result = @"ZoneManagement"; + break; case MTRClusterIDTypeWebRTCTransportProviderID: result = @"WebRTCTransportProvider"; break; @@ -8149,6 +8152,57 @@ } break; + case MTRClusterIDTypeZoneManagementID: + + switch (attributeID) { + + // Cluster ZoneManagement attributes + case MTRAttributeIDTypeClusterZoneManagementAttributeSupportedZoneSourcesID: + result = @"SupportedZoneSources"; + break; + + case MTRAttributeIDTypeClusterZoneManagementAttributeZonesID: + result = @"Zones"; + break; + + case MTRAttributeIDTypeClusterZoneManagementAttributeTimeControlID: + result = @"TimeControl"; + break; + + case MTRAttributeIDTypeClusterZoneManagementAttributeSensitivityID: + result = @"Sensitivity"; + break; + + case MTRAttributeIDTypeClusterZoneManagementAttributeGeneratedCommandListID: + result = @"GeneratedCommandList"; + break; + + case MTRAttributeIDTypeClusterZoneManagementAttributeAcceptedCommandListID: + result = @"AcceptedCommandList"; + break; + + case MTRAttributeIDTypeClusterZoneManagementAttributeEventListID: + result = @"EventList"; + break; + + case MTRAttributeIDTypeClusterZoneManagementAttributeAttributeListID: + result = @"AttributeList"; + break; + + case MTRAttributeIDTypeClusterZoneManagementAttributeFeatureMapID: + result = @"FeatureMap"; + break; + + case MTRAttributeIDTypeClusterZoneManagementAttributeClusterRevisionID: + result = @"ClusterRevision"; + break; + + default: + result = [NSString stringWithFormat:@"", attributeID]; + break; + } + break; + case MTRClusterIDTypeWebRTCTransportProviderID: switch (attributeID) { @@ -11002,6 +11056,32 @@ } break; + case MTRClusterIDTypeZoneManagementID: + + switch (commandID) { + + case MTRCommandIDTypeClusterZoneManagementCommandCreateTwoDCartesianZoneID: + result = @"CreateTwoDCartesianZone"; + break; + + case MTRCommandIDTypeClusterZoneManagementCommandUpdateTwoDCartesianZoneID: + result = @"UpdateTwoDCartesianZone"; + break; + + case MTRCommandIDTypeClusterZoneManagementCommandGetTwoDCartesianZoneID: + result = @"GetTwoDCartesianZone"; + break; + + case MTRCommandIDTypeClusterZoneManagementCommandRemoveZoneID: + result = @"RemoveZone"; + break; + + default: + result = [NSString stringWithFormat:@"", commandID]; + break; + } + break; + case MTRClusterIDTypeWebRTCTransportProviderID: switch (commandID) { @@ -12670,6 +12750,24 @@ } break; + case MTRClusterIDTypeZoneManagementID: + + switch (commandID) { + + case MTRCommandIDTypeClusterZoneManagementCommandCreateTwoDCartesianZoneResponseID: + result = @"CreateTwoDCartesianZoneResponse"; + break; + + case MTRCommandIDTypeClusterZoneManagementCommandGetTwoDCartesianZoneResponseID: + result = @"GetTwoDCartesianZoneResponse"; + break; + + default: + result = [NSString stringWithFormat:@"", commandID]; + break; + } + break; + case MTRClusterIDTypeWebRTCTransportProviderID: switch (commandID) { @@ -14459,6 +14557,25 @@ } break; + case MTRClusterIDTypeZoneManagementID: + + switch (eventID) { + + // Cluster ZoneManagement events + case MTREventIDTypeClusterZoneManagementEventZoneTriggeredID: + result = @"ZoneTriggered"; + break; + + case MTREventIDTypeClusterZoneManagementEventZoneStoppedID: + result = @"ZoneStopped"; + break; + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + case MTRClusterIDTypeWebRTCTransportProviderID: switch (eventID) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index 4988732fe8..c14ef194b7 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -6826,6 +6826,61 @@ MTR_PROVISIONALLY_AVAILABLE @end +/** + * Cluster Zone Management + * This cluster provides an interface to manage regions of interest, or Zones, which can be either manufacturer or user defined. + */ +MTR_PROVISIONALLY_AVAILABLE +@interface MTRClusterZoneManagement : MTRGenericCluster + +- (void)createTwoDCartesianZoneWithParams:(MTRZoneManagementClusterCreateTwoDCartesianZoneParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRZoneManagementClusterCreateTwoDCartesianZoneResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)updateTwoDCartesianZoneWithParams:(MTRZoneManagementClusterUpdateTwoDCartesianZoneParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)getTwoDCartesianZoneWithParams:(MTRZoneManagementClusterGetTwoDCartesianZoneParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRZoneManagementClusterGetTwoDCartesianZoneResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)getTwoDCartesianZoneWithExpectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRZoneManagementClusterGetTwoDCartesianZoneResponseParams * _Nullable data, NSError * _Nullable error))completion + MTR_PROVISIONALLY_AVAILABLE; +- (void)removeZoneWithParams:(MTRZoneManagementClusterRemoveZoneParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeSupportedZoneSourcesWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeZonesWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeTimeControlWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeTimeControlWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeTimeControlWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeSensitivityWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSensitivityWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSensitivityWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +@interface MTRClusterZoneManagement (Availability) + +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ +- (instancetype _Nullable)initWithDevice:(MTRDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue MTR_PROVISIONALLY_AVAILABLE; + +@end + /** * Cluster WebRTC Transport Provider * The WebRTC transport provider cluster provides a way for stream providers (e.g. Cameras) to stream or receive their data through WebRTC. diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index 2c8bf9015f..b24a0eb9df 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -19554,6 +19554,194 @@ - (void)contentAppMessageWithParams:(MTRContentAppObserverClusterContentAppMessa @end +@implementation MTRClusterZoneManagement + +- (void)createTwoDCartesianZoneWithParams:(MTRZoneManagementClusterCreateTwoDCartesianZoneParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRZoneManagementClusterCreateTwoDCartesianZoneResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + if (params == nil) { + params = [[MTRZoneManagementClusterCreateTwoDCartesianZoneParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ZoneManagement::Commands::CreateTwoDCartesianZone::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRZoneManagementClusterCreateTwoDCartesianZoneResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)updateTwoDCartesianZoneWithParams:(MTRZoneManagementClusterUpdateTwoDCartesianZoneParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRZoneManagementClusterUpdateTwoDCartesianZoneParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ZoneManagement::Commands::UpdateTwoDCartesianZone::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)getTwoDCartesianZoneWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completion:(void (^)(MTRZoneManagementClusterGetTwoDCartesianZoneResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + [self getTwoDCartesianZoneWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; +} +- (void)getTwoDCartesianZoneWithParams:(MTRZoneManagementClusterGetTwoDCartesianZoneParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRZoneManagementClusterGetTwoDCartesianZoneResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + if (params == nil) { + params = [[MTRZoneManagementClusterGetTwoDCartesianZoneParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ZoneManagement::Commands::GetTwoDCartesianZone::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRZoneManagementClusterGetTwoDCartesianZoneResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)removeZoneWithParams:(MTRZoneManagementClusterRemoveZoneParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRZoneManagementClusterRemoveZoneParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ZoneManagement::Commands::RemoveZone::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (NSDictionary * _Nullable)readAttributeSupportedZoneSourcesWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeZoneManagementID) attributeID:@(MTRAttributeIDTypeClusterZoneManagementAttributeSupportedZoneSourcesID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeZonesWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeZoneManagementID) attributeID:@(MTRAttributeIDTypeClusterZoneManagementAttributeZonesID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeTimeControlWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeZoneManagementID) attributeID:@(MTRAttributeIDTypeClusterZoneManagementAttributeTimeControlID) params:params]; +} + +- (void)writeAttributeTimeControlWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeTimeControlWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeTimeControlWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeZoneManagementID) attributeID:@(MTRAttributeIDTypeClusterZoneManagementAttributeTimeControlID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeSensitivityWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeZoneManagementID) attributeID:@(MTRAttributeIDTypeClusterZoneManagementAttributeSensitivityID) params:params]; +} + +- (void)writeAttributeSensitivityWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeSensitivityWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeSensitivityWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeZoneManagementID) attributeID:@(MTRAttributeIDTypeClusterZoneManagementAttributeSensitivityID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeZoneManagementID) attributeID:@(MTRAttributeIDTypeClusterZoneManagementAttributeGeneratedCommandListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeZoneManagementID) attributeID:@(MTRAttributeIDTypeClusterZoneManagementAttributeAcceptedCommandListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeZoneManagementID) attributeID:@(MTRAttributeIDTypeClusterZoneManagementAttributeEventListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeZoneManagementID) attributeID:@(MTRAttributeIDTypeClusterZoneManagementAttributeAttributeListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeZoneManagementID) attributeID:@(MTRAttributeIDTypeClusterZoneManagementAttributeFeatureMapID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeZoneManagementID) attributeID:@(MTRAttributeIDTypeClusterZoneManagementAttributeClusterRevisionID) params:params]; +} + +@end + @implementation MTRClusterWebRTCTransportProvider - (void)solicitOfferWithParams:(MTRWebRTCTransportProviderClusterSolicitOfferParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRWebRTCTransportProviderClusterSolicitOfferResponseParams * _Nullable data, NSError * _Nullable error))completion diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h index 63cbb17356..cd38412eb0 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -10835,6 +10835,166 @@ MTR_PROVISIONALLY_AVAILABLE error:(NSError * __autoreleasing *)error MTR_PROVISIONALLY_AVAILABLE; @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRZoneManagementClusterCreateTwoDCartesianZoneParams : NSObject + +@property (nonatomic, copy) MTRZoneManagementClusterTwoDCartesianZoneStruct * _Nonnull zone MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRZoneManagementClusterCreateTwoDCartesianZoneResponseParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull zoneID MTR_PROVISIONALLY_AVAILABLE; + +/** + * Initialize an MTRZoneManagementClusterCreateTwoDCartesianZoneResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRZoneManagementClusterUpdateTwoDCartesianZoneParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull zoneID MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) MTRZoneManagementClusterTwoDCartesianZoneStruct * _Nonnull zone MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRZoneManagementClusterGetTwoDCartesianZoneParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nullable zoneID MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRZoneManagementClusterGetTwoDCartesianZoneResponseParams : NSObject + +@property (nonatomic, copy) NSArray * _Nonnull zones MTR_PROVISIONALLY_AVAILABLE; + +/** + * Initialize an MTRZoneManagementClusterGetTwoDCartesianZoneResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRZoneManagementClusterRemoveZoneParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull zoneID MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + MTR_PROVISIONALLY_AVAILABLE @interface MTRWebRTCTransportProviderClusterSolicitOfferParams : NSObject diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index aaddab1b68..41bc2383d8 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -31337,6 +31337,596 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::ContentA @end +@implementation MTRZoneManagementClusterCreateTwoDCartesianZoneParams +- (instancetype)init +{ + if (self = [super init]) { + + _zone = [MTRZoneManagementClusterTwoDCartesianZoneStruct new]; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRZoneManagementClusterCreateTwoDCartesianZoneParams alloc] init]; + + other.zone = self.zone; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: zone:%@; >", NSStringFromClass([self class]), _zone]; + return descriptionString; +} + +@end + +@implementation MTRZoneManagementClusterCreateTwoDCartesianZoneParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::ZoneManagement::Commands::CreateTwoDCartesianZone::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.zone.name = AsCharSpan(self.zone.name); + encodableStruct.zone.use = static_cast>(self.zone.use.unsignedCharValue); + { + using ListType_1 = std::remove_reference_t; + using ListMemberType_1 = ListMemberTypeGetter::Type; + if (self.zone.vertices.count != 0) { + auto * listHolder_1 = new ListHolder(self.zone.vertices.count); + if (listHolder_1 == nullptr || listHolder_1->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_1); + for (size_t i_1 = 0; i_1 < self.zone.vertices.count; ++i_1) { + if (![self.zone.vertices[i_1] isKindOfClass:[MTRZoneManagementClusterTwoDCartesianVertexStruct class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_1 = (MTRZoneManagementClusterTwoDCartesianVertexStruct *) self.zone.vertices[i_1]; + listHolder_1->mList[i_1].x = element_1.x.unsignedShortValue; + listHolder_1->mList[i_1].y = element_1.y.unsignedShortValue; + } + encodableStruct.zone.vertices = ListType_1(listHolder_1->mList, self.zone.vertices.count); + } else { + encodableStruct.zone.vertices = ListType_1(); + } + } + if (self.zone.color != nil) { + auto & definedValue_1 = encodableStruct.zone.color.Emplace(); + definedValue_1 = AsCharSpan(self.zone.color); + } + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRZoneManagementClusterCreateTwoDCartesianZoneResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _zoneID = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRZoneManagementClusterCreateTwoDCartesianZoneResponseParams alloc] init]; + + other.zoneID = self.zoneID; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: zoneID:%@; >", NSStringFromClass([self class]), _zoneID]; + return descriptionString; +} + +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::ZoneManagement::Commands::CreateTwoDCartesianZoneResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRZoneManagementClusterCreateTwoDCartesianZoneResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::ZoneManagement::Commands::CreateTwoDCartesianZoneResponse::DecodableType &)decodableStruct +{ + { + self.zoneID = [NSNumber numberWithUnsignedShort:decodableStruct.zoneID]; + } + return CHIP_NO_ERROR; +} + +@end + +@implementation MTRZoneManagementClusterUpdateTwoDCartesianZoneParams +- (instancetype)init +{ + if (self = [super init]) { + + _zoneID = @(0); + + _zone = [MTRZoneManagementClusterTwoDCartesianZoneStruct new]; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRZoneManagementClusterUpdateTwoDCartesianZoneParams alloc] init]; + + other.zoneID = self.zoneID; + other.zone = self.zone; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: zoneID:%@; zone:%@; >", NSStringFromClass([self class]), _zoneID, _zone]; + return descriptionString; +} + +@end + +@implementation MTRZoneManagementClusterUpdateTwoDCartesianZoneParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::ZoneManagement::Commands::UpdateTwoDCartesianZone::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.zoneID = self.zoneID.unsignedShortValue; + } + { + encodableStruct.zone.name = AsCharSpan(self.zone.name); + encodableStruct.zone.use = static_cast>(self.zone.use.unsignedCharValue); + { + using ListType_1 = std::remove_reference_t; + using ListMemberType_1 = ListMemberTypeGetter::Type; + if (self.zone.vertices.count != 0) { + auto * listHolder_1 = new ListHolder(self.zone.vertices.count); + if (listHolder_1 == nullptr || listHolder_1->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_1); + for (size_t i_1 = 0; i_1 < self.zone.vertices.count; ++i_1) { + if (![self.zone.vertices[i_1] isKindOfClass:[MTRZoneManagementClusterTwoDCartesianVertexStruct class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_1 = (MTRZoneManagementClusterTwoDCartesianVertexStruct *) self.zone.vertices[i_1]; + listHolder_1->mList[i_1].x = element_1.x.unsignedShortValue; + listHolder_1->mList[i_1].y = element_1.y.unsignedShortValue; + } + encodableStruct.zone.vertices = ListType_1(listHolder_1->mList, self.zone.vertices.count); + } else { + encodableStruct.zone.vertices = ListType_1(); + } + } + if (self.zone.color != nil) { + auto & definedValue_1 = encodableStruct.zone.color.Emplace(); + definedValue_1 = AsCharSpan(self.zone.color); + } + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRZoneManagementClusterGetTwoDCartesianZoneParams +- (instancetype)init +{ + if (self = [super init]) { + + _zoneID = nil; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRZoneManagementClusterGetTwoDCartesianZoneParams alloc] init]; + + other.zoneID = self.zoneID; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: zoneID:%@; >", NSStringFromClass([self class]), _zoneID]; + return descriptionString; +} + +@end + +@implementation MTRZoneManagementClusterGetTwoDCartesianZoneParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::ZoneManagement::Commands::GetTwoDCartesianZone::Type encodableStruct; + ListFreer listFreer; + { + if (self.zoneID != nil) { + auto & definedValue_0 = encodableStruct.zoneID.Emplace(); + if (self.zoneID == nil) { + definedValue_0.SetNull(); + } else { + auto & nonNullValue_1 = definedValue_0.SetNonNull(); + nonNullValue_1 = self.zoneID.unsignedShortValue; + } + } + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRZoneManagementClusterGetTwoDCartesianZoneResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _zones = [NSArray array]; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRZoneManagementClusterGetTwoDCartesianZoneResponseParams alloc] init]; + + other.zones = self.zones; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: zones:%@; >", NSStringFromClass([self class]), _zones]; + return descriptionString; +} + +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::ZoneManagement::Commands::GetTwoDCartesianZoneResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRZoneManagementClusterGetTwoDCartesianZoneResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::ZoneManagement::Commands::GetTwoDCartesianZoneResponse::DecodableType &)decodableStruct +{ + { + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = decodableStruct.zones.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRZoneManagementClusterTwoDCartesianZoneStruct * newElement_0; + newElement_0 = [MTRZoneManagementClusterTwoDCartesianZoneStruct new]; + newElement_0.name = AsString(entry_0.name); + if (newElement_0.name == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + newElement_0.use = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.use)]; + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + auto iter_2 = entry_0.vertices.begin(); + while (iter_2.Next()) { + auto & entry_2 = iter_2.GetValue(); + MTRZoneManagementClusterTwoDCartesianVertexStruct * newElement_2; + newElement_2 = [MTRZoneManagementClusterTwoDCartesianVertexStruct new]; + newElement_2.x = [NSNumber numberWithUnsignedShort:entry_2.x]; + newElement_2.y = [NSNumber numberWithUnsignedShort:entry_2.y]; + [array_2 addObject:newElement_2]; + } + CHIP_ERROR err = iter_2.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + newElement_0.vertices = array_2; + } + if (entry_0.color.HasValue()) { + newElement_0.color = AsString(entry_0.color.Value()); + if (newElement_0.color == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + } else { + newElement_0.color = nil; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + self.zones = array_0; + } + } + return CHIP_NO_ERROR; +} + +@end + +@implementation MTRZoneManagementClusterRemoveZoneParams +- (instancetype)init +{ + if (self = [super init]) { + + _zoneID = @(0); + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRZoneManagementClusterRemoveZoneParams alloc] init]; + + other.zoneID = self.zoneID; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: zoneID:%@; >", NSStringFromClass([self class]), _zoneID]; + return descriptionString; +} + +@end + +@implementation MTRZoneManagementClusterRemoveZoneParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::ZoneManagement::Commands::RemoveZone::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.zoneID = self.zoneID.unsignedShortValue; + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + @implementation MTRWebRTCTransportProviderClusterSolicitOfferParams - (instancetype)init { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h index b6345356d4..9e1a81b85f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h @@ -2032,6 +2032,42 @@ NS_ASSUME_NONNULL_BEGIN @end +@interface MTRZoneManagementClusterCreateTwoDCartesianZoneParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRZoneManagementClusterCreateTwoDCartesianZoneResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::ZoneManagement::Commands::CreateTwoDCartesianZoneResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRZoneManagementClusterUpdateTwoDCartesianZoneParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRZoneManagementClusterGetTwoDCartesianZoneParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRZoneManagementClusterGetTwoDCartesianZoneResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::ZoneManagement::Commands::GetTwoDCartesianZoneResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRZoneManagementClusterRemoveZoneParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + @interface MTRWebRTCTransportProviderClusterSolicitOfferParams (InternalMethods) - (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm index c330d2bb0d..d54f1d17f8 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm @@ -1124,6 +1124,15 @@ static BOOL CommandNeedsTimedInvokeInContentAppObserverCluster(AttributeId aAttr } } } +static BOOL CommandNeedsTimedInvokeInZoneManagementCluster(AttributeId aAttributeId) +{ + using namespace Clusters::ZoneManagement; + switch (aAttributeId) { + default: { + return NO; + } + } +} static BOOL CommandNeedsTimedInvokeInWebRTCTransportProviderCluster(AttributeId aAttributeId) { using namespace Clusters::WebRTCTransportProvider; @@ -1539,6 +1548,9 @@ BOOL MTRCommandNeedsTimedInvoke(NSNumber * _Nonnull aClusterID, NSNumber * _Nonn case Clusters::ContentAppObserver::Id: { return CommandNeedsTimedInvokeInContentAppObserverCluster(commandID); } + case Clusters::ZoneManagement::Id: { + return CommandNeedsTimedInvokeInZoneManagementCluster(commandID); + } case Clusters::WebRTCTransportProvider::Id: { return CommandNeedsTimedInvokeInWebRTCTransportProviderCluster(commandID); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm index 0ef12bcbba..e832d7ea73 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -4543,6 +4543,92 @@ static id _Nullable DecodeEventPayloadForContentAppObserverCluster(EventId aEven *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; return nil; } +static id _Nullable DecodeEventPayloadForZoneManagementCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::ZoneManagement; + switch (aEventId) { + case Events::ZoneTriggered::Id: { + Events::ZoneTriggered::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTRZoneManagementClusterZoneTriggeredEvent new]; + + do { + NSArray * _Nonnull memberValue; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.zones.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedShort:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + memberValue = array_0; + } + value.zones = memberValue; + } while (0); + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.reason)]; + value.reason = memberValue; + } while (0); + + return value; + } + case Events::ZoneStopped::Id: { + Events::ZoneStopped::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTRZoneManagementClusterZoneStoppedEvent new]; + + do { + NSArray * _Nonnull memberValue; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.zones.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedShort:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + memberValue = array_0; + } + value.zones = memberValue; + } while (0); + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.reason)]; + value.reason = memberValue; + } while (0); + + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + return nil; +} static id _Nullable DecodeEventPayloadForWebRTCTransportProviderCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { using namespace Clusters::WebRTCTransportProvider; @@ -5169,6 +5255,9 @@ id _Nullable MTRDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVRead case Clusters::ContentAppObserver::Id: { return DecodeEventPayloadForContentAppObserverCluster(aPath.mEventId, aReader, aError); } + case Clusters::ZoneManagement::Id: { + return DecodeEventPayloadForZoneManagementCluster(aPath.mEventId, aReader, aError); + } case Clusters::WebRTCTransportProvider::Id: { return DecodeEventPayloadForWebRTCTransportProviderCluster(aPath.mEventId, aReader, aError); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index fa103214b8..bbf11013cd 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -2117,6 +2117,47 @@ MTR_PROVISIONALLY_AVAILABLE @interface MTRContentControlClusterRemainingScreenTimeExpiredEvent : NSObject @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRZoneManagementClusterTwoDCartesianVertexStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull x MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull y MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRZoneManagementClusterTwoDCartesianZoneStruct : NSObject +@property (nonatomic, copy) NSString * _Nonnull name MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull use MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSArray * _Nonnull vertices MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nullable color MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRZoneManagementClusterZoneInformationStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull zoneID MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull zoneType MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull zoneSource MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRZoneManagementClusterZoneTriggeringTimeControlStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull initialDuration MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull augmentationDuration MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull maxDuration MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull blindDuration MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRZoneManagementClusterZoneTriggeredEvent : NSObject +@property (nonatomic, copy) NSArray * _Nonnull zones MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull reason MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRZoneManagementClusterZoneStoppedEvent : NSObject +@property (nonatomic, copy) NSArray * _Nonnull zones MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull reason MTR_PROVISIONALLY_AVAILABLE; +@end + MTR_PROVISIONALLY_AVAILABLE @interface MTRWebRTCTransportProviderClusterICEServerStruct : NSObject @property (nonatomic, copy) NSArray * _Nonnull urls MTR_PROVISIONALLY_AVAILABLE; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index e8153706aa..85dd21da5f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -8768,6 +8768,201 @@ - (NSString *)description @end +@implementation MTRZoneManagementClusterTwoDCartesianVertexStruct +- (instancetype)init +{ + if (self = [super init]) { + + _x = @(0); + + _y = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRZoneManagementClusterTwoDCartesianVertexStruct alloc] init]; + + other.x = self.x; + other.y = self.y; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: x:%@; y:%@; >", NSStringFromClass([self class]), _x, _y]; + return descriptionString; +} + +@end + +@implementation MTRZoneManagementClusterTwoDCartesianZoneStruct +- (instancetype)init +{ + if (self = [super init]) { + + _name = @""; + + _use = @(0); + + _vertices = [NSArray array]; + + _color = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRZoneManagementClusterTwoDCartesianZoneStruct alloc] init]; + + other.name = self.name; + other.use = self.use; + other.vertices = self.vertices; + other.color = self.color; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: name:%@; use:%@; vertices:%@; color:%@; >", NSStringFromClass([self class]), _name, _use, _vertices, _color]; + return descriptionString; +} + +@end + +@implementation MTRZoneManagementClusterZoneInformationStruct +- (instancetype)init +{ + if (self = [super init]) { + + _zoneID = @(0); + + _zoneType = @(0); + + _zoneSource = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRZoneManagementClusterZoneInformationStruct alloc] init]; + + other.zoneID = self.zoneID; + other.zoneType = self.zoneType; + other.zoneSource = self.zoneSource; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: zoneID:%@; zoneType:%@; zoneSource:%@; >", NSStringFromClass([self class]), _zoneID, _zoneType, _zoneSource]; + return descriptionString; +} + +@end + +@implementation MTRZoneManagementClusterZoneTriggeringTimeControlStruct +- (instancetype)init +{ + if (self = [super init]) { + + _initialDuration = @(0); + + _augmentationDuration = @(0); + + _maxDuration = @(0); + + _blindDuration = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRZoneManagementClusterZoneTriggeringTimeControlStruct alloc] init]; + + other.initialDuration = self.initialDuration; + other.augmentationDuration = self.augmentationDuration; + other.maxDuration = self.maxDuration; + other.blindDuration = self.blindDuration; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: initialDuration:%@; augmentationDuration:%@; maxDuration:%@; blindDuration:%@; >", NSStringFromClass([self class]), _initialDuration, _augmentationDuration, _maxDuration, _blindDuration]; + return descriptionString; +} + +@end + +@implementation MTRZoneManagementClusterZoneTriggeredEvent +- (instancetype)init +{ + if (self = [super init]) { + + _zones = [NSArray array]; + + _reason = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRZoneManagementClusterZoneTriggeredEvent alloc] init]; + + other.zones = self.zones; + other.reason = self.reason; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: zones:%@; reason:%@; >", NSStringFromClass([self class]), _zones, _reason]; + return descriptionString; +} + +@end + +@implementation MTRZoneManagementClusterZoneStoppedEvent +- (instancetype)init +{ + if (self = [super init]) { + + _zones = [NSArray array]; + + _reason = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRZoneManagementClusterZoneStoppedEvent alloc] init]; + + other.zones = self.zones; + other.reason = self.reason; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: zones:%@; reason:%@; >", NSStringFromClass([self class]), _zones, _reason]; + return descriptionString; +} + +@end + @implementation MTRWebRTCTransportProviderClusterICEServerStruct - (instancetype)init { 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 3141e1562a..f99be081fe 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 @@ -37305,6 +37305,153 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) } // namespace Attributes } // namespace ContentAppObserver +namespace ZoneManagement { +namespace Attributes { + +namespace Sensitivity { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::ZoneManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ZoneManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::ZoneManagement::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +} // namespace Sensitivity + +namespace FeatureMap { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::ZoneManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ZoneManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::ZoneManagement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); +} + +} // namespace FeatureMap + +namespace ClusterRevision { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::ZoneManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ZoneManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::ZoneManagement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace ZoneManagement + namespace WebRTCTransportProvider { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index 30641f2c4d..6c048e825a 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 @@ -5641,6 +5641,30 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, Mar } // namespace Attributes } // namespace ContentAppObserver +namespace ZoneManagement { +namespace Attributes { + +namespace Sensitivity { +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value); // int8u +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); +} // namespace Sensitivity + +namespace FeatureMap { +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value); // bitmap32 +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty); +} // namespace FeatureMap + +namespace ClusterRevision { +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace ZoneManagement + namespace WebRTCTransportProvider { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h index 61bd0a4962..dcf1cc651c 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -618,6 +618,11 @@ void emberAfContentControlClusterInitCallback(chip::EndpointId endpoint); */ void emberAfContentAppObserverClusterInitCallback(chip::EndpointId endpoint); +/** + * @param endpoint Endpoint that is being initialized + */ +void emberAfZoneManagementClusterInitCallback(chip::EndpointId endpoint); + /** * @param endpoint Endpoint that is being initialized */ @@ -5182,6 +5187,45 @@ chip::Protocols::InteractionModel::Status MatterContentAppObserverClusterServerP */ void emberAfContentAppObserverClusterServerTickCallback(chip::EndpointId endpoint); +// +// Zone Management Cluster +// + +/** + * @param endpoint Endpoint that is being initialized + */ +void emberAfZoneManagementClusterServerInitCallback(chip::EndpointId endpoint); + +/** + * @param endpoint Endpoint that is being shutdown + */ +void MatterZoneManagementClusterServerShutdownCallback(chip::EndpointId endpoint); + +/** + * @param endpoint Endpoint that is being initialized + */ +void emberAfZoneManagementClusterClientInitCallback(chip::EndpointId endpoint); + +/** + * @param attributePath Concrete attribute path that changed + */ +void MatterZoneManagementClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); + +/** + * @param attributePath Concrete attribute path to be changed + * @param attributeType Attribute type + * @param size Attribute size + * @param value Attribute value + */ +chip::Protocols::InteractionModel::Status +MatterZoneManagementClusterServerPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); + +/** + * @param endpoint Endpoint that is being served + */ +void emberAfZoneManagementClusterServerTickCallback(chip::EndpointId endpoint); + // // WebRTC Transport Provider Cluster // @@ -6687,6 +6731,30 @@ bool emberAfContentControlClusterSetScheduledContentRatingThresholdCallback( bool emberAfContentAppObserverClusterContentAppMessageCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::ContentAppObserver::Commands::ContentAppMessage::DecodableType & commandData); +/** + * @brief Zone Management Cluster CreateTwoDCartesianZone Command callback (from client) + */ +bool emberAfZoneManagementClusterCreateTwoDCartesianZoneCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::ZoneManagement::Commands::CreateTwoDCartesianZone::DecodableType & commandData); +/** + * @brief Zone Management Cluster UpdateTwoDCartesianZone Command callback (from client) + */ +bool emberAfZoneManagementClusterUpdateTwoDCartesianZoneCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::ZoneManagement::Commands::UpdateTwoDCartesianZone::DecodableType & commandData); +/** + * @brief Zone Management Cluster GetTwoDCartesianZone Command callback (from client) + */ +bool emberAfZoneManagementClusterGetTwoDCartesianZoneCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::ZoneManagement::Commands::GetTwoDCartesianZone::DecodableType & commandData); +/** + * @brief Zone Management Cluster RemoveZone Command callback (from client) + */ +bool emberAfZoneManagementClusterRemoveZoneCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::ZoneManagement::Commands::RemoveZone::DecodableType & commandData); /** * @brief WebRTC Transport Provider Cluster SolicitOffer Command callback (from client) */ 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 006c91ef14..15ce6cc758 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 @@ -3568,6 +3568,78 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(ContentAppObserver::Sta } } +static auto __attribute__((unused)) EnsureKnownEnumValue(ZoneManagement::StatusCodeEnum val) +{ + using EnumType = ZoneManagement::StatusCodeEnum; + switch (val) + { + case EnumType::kZoneNotFound: + case EnumType::kZoneInUse: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} +static auto __attribute__((unused)) EnsureKnownEnumValue(ZoneManagement::ZoneEventStoppedReasonEnum val) +{ + using EnumType = ZoneManagement::ZoneEventStoppedReasonEnum; + switch (val) + { + case EnumType::kActionStopped: + case EnumType::kTimeout: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} +static auto __attribute__((unused)) EnsureKnownEnumValue(ZoneManagement::ZoneEventTriggeredReasonEnum val) +{ + using EnumType = ZoneManagement::ZoneEventTriggeredReasonEnum; + switch (val) + { + case EnumType::kMotion: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} +static auto __attribute__((unused)) EnsureKnownEnumValue(ZoneManagement::ZoneSourceEnum val) +{ + using EnumType = ZoneManagement::ZoneSourceEnum; + switch (val) + { + case EnumType::kMfg: + case EnumType::kUser: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} +static auto __attribute__((unused)) EnsureKnownEnumValue(ZoneManagement::ZoneTypeEnum val) +{ + using EnumType = ZoneManagement::ZoneTypeEnum; + switch (val) + { + case EnumType::kTwoDCARTZone: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} +static auto __attribute__((unused)) EnsureKnownEnumValue(ZoneManagement::ZoneUseEnum val) +{ + using EnumType = ZoneManagement::ZoneUseEnum; + switch (val) + { + case EnumType::kMotion: + case EnumType::kPrivacy: + case EnumType::kFocus: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} + static auto __attribute__((unused)) EnsureKnownEnumValue(UnitTesting::SimpleEnum val) { using EnumType = UnitTesting::SimpleEnum; 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 8829a72561..679a2e2e49 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 @@ -5448,6 +5448,86 @@ enum class StatusEnum : uint8_t }; } // namespace ContentAppObserver +namespace ZoneManagement { + +// Enum for StatusCodeEnum +enum class StatusCodeEnum : uint8_t +{ + kZoneNotFound = 0x02, + kZoneInUse = 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, +}; + +// Enum for ZoneEventStoppedReasonEnum +enum class ZoneEventStoppedReasonEnum : uint8_t +{ + kActionStopped = 0x00, + kTimeout = 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 + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 2, +}; + +// Enum for ZoneEventTriggeredReasonEnum +enum class ZoneEventTriggeredReasonEnum : uint8_t +{ + kMotion = 0x00, + // 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 = 1, +}; + +// Enum for ZoneSourceEnum +enum class ZoneSourceEnum : uint8_t +{ + kMfg = 0x00, + kUser = 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 + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 2, +}; + +// Enum for ZoneTypeEnum +enum class ZoneTypeEnum : uint8_t +{ + kTwoDCARTZone = 0x00, + // 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 = 1, +}; + +// Enum for ZoneUseEnum +enum class ZoneUseEnum : uint8_t +{ + kMotion = 0x00, + kPrivacy = 0x01, + kFocus = 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 + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 3, +}; + +// Bitmap for Feature +enum class Feature : uint32_t +{ + kTwoDimensionalCartesianZone = 0x1, +}; +} // namespace ZoneManagement + namespace WebRTCTransportProvider { using StreamTypeEnum = Clusters::detail::StreamTypeEnum; diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index 05164fb2f7..6636fee68a 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -28595,6 +28595,526 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events } // namespace ContentAppObserver +namespace ZoneManagement { +namespace Structs { + +namespace TwoDCartesianVertexStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kX), x); + encoder.Encode(to_underlying(Fields::kY), y); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kX)) + { + err = DataModel::Decode(reader, x); + } + else if (__context_tag == to_underlying(Fields::kY)) + { + err = DataModel::Decode(reader, y); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace TwoDCartesianVertexStruct + +namespace TwoDCartesianZoneStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kName), name); + encoder.Encode(to_underlying(Fields::kUse), use); + encoder.Encode(to_underlying(Fields::kVertices), vertices); + encoder.Encode(to_underlying(Fields::kColor), color); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kName)) + { + err = DataModel::Decode(reader, name); + } + else if (__context_tag == to_underlying(Fields::kUse)) + { + err = DataModel::Decode(reader, use); + } + else if (__context_tag == to_underlying(Fields::kVertices)) + { + err = DataModel::Decode(reader, vertices); + } + else if (__context_tag == to_underlying(Fields::kColor)) + { + err = DataModel::Decode(reader, color); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace TwoDCartesianZoneStruct + +namespace ZoneInformationStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kZoneID), zoneID); + encoder.Encode(to_underlying(Fields::kZoneType), zoneType); + encoder.Encode(to_underlying(Fields::kZoneSource), zoneSource); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kZoneID)) + { + err = DataModel::Decode(reader, zoneID); + } + else if (__context_tag == to_underlying(Fields::kZoneType)) + { + err = DataModel::Decode(reader, zoneType); + } + else if (__context_tag == to_underlying(Fields::kZoneSource)) + { + err = DataModel::Decode(reader, zoneSource); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace ZoneInformationStruct + +namespace ZoneTriggeringTimeControlStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kInitialDuration), initialDuration); + encoder.Encode(to_underlying(Fields::kAugmentationDuration), augmentationDuration); + encoder.Encode(to_underlying(Fields::kMaxDuration), maxDuration); + encoder.Encode(to_underlying(Fields::kBlindDuration), blindDuration); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kInitialDuration)) + { + err = DataModel::Decode(reader, initialDuration); + } + else if (__context_tag == to_underlying(Fields::kAugmentationDuration)) + { + err = DataModel::Decode(reader, augmentationDuration); + } + else if (__context_tag == to_underlying(Fields::kMaxDuration)) + { + err = DataModel::Decode(reader, maxDuration); + } + else if (__context_tag == to_underlying(Fields::kBlindDuration)) + { + err = DataModel::Decode(reader, blindDuration); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace ZoneTriggeringTimeControlStruct +} // namespace Structs + +namespace Commands { +namespace CreateTwoDCartesianZone { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kZone), zone); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kZone)) + { + err = DataModel::Decode(reader, zone); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace CreateTwoDCartesianZone. +namespace CreateTwoDCartesianZoneResponse { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kZoneID), zoneID); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kZoneID)) + { + err = DataModel::Decode(reader, zoneID); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace CreateTwoDCartesianZoneResponse. +namespace UpdateTwoDCartesianZone { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kZoneID), zoneID); + encoder.Encode(to_underlying(Fields::kZone), zone); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kZoneID)) + { + err = DataModel::Decode(reader, zoneID); + } + else if (__context_tag == to_underlying(Fields::kZone)) + { + err = DataModel::Decode(reader, zone); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace UpdateTwoDCartesianZone. +namespace GetTwoDCartesianZone { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kZoneID), zoneID); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kZoneID)) + { + err = DataModel::Decode(reader, zoneID); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace GetTwoDCartesianZone. +namespace GetTwoDCartesianZoneResponse { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kZones), zones); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kZones)) + { + err = DataModel::Decode(reader, zones); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace GetTwoDCartesianZoneResponse. +namespace RemoveZone { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kZoneID), zoneID); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kZoneID)) + { + err = DataModel::Decode(reader, zoneID); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace RemoveZone. +} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::SupportedZoneSources::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, supportedZoneSources); + case Attributes::Zones::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, zones); + case Attributes::TimeControl::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, timeControl); + case Attributes::Sensitivity::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, sensitivity); + case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, generatedCommandList); + case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, acceptedCommandList); + case Attributes::EventList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, eventList); + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, attributeList); + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, featureMap); + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, clusterRevision); + default: + return CHIP_NO_ERROR; + } +} +} // namespace Attributes + +namespace Events { +namespace ZoneTriggered { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kZones), zones)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kReason), reason)); + return aWriter.EndContainer(outer); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kZones)) + { + err = DataModel::Decode(reader, zones); + } + else if (__context_tag == to_underlying(Fields::kReason)) + { + err = DataModel::Decode(reader, reason); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace ZoneTriggered. +namespace ZoneStopped { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kZones), zones)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kReason), reason)); + return aWriter.EndContainer(outer); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kZones)) + { + err = DataModel::Decode(reader, zones); + } + else if (__context_tag == to_underlying(Fields::kReason)) + { + err = DataModel::Decode(reader, reason); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace ZoneStopped. +} // namespace Events + +} // namespace ZoneManagement namespace WebRTCTransportProvider { namespace Structs {} // namespace Structs @@ -33190,6 +33710,13 @@ bool CommandIsFabricScoped(ClusterId aCluster, CommandId aCommand) return false; } } + case Clusters::ZoneManagement::Id: { + switch (aCommand) + { + default: + return false; + } + } case Clusters::WebRTCTransportProvider::Id: { switch (aCommand) { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 19baf37416..f23da12739 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 @@ -41278,6 +41278,542 @@ struct TypeInfo }; } // namespace Attributes } // namespace ContentAppObserver +namespace ZoneManagement { +namespace Structs { +namespace TwoDCartesianVertexStruct { +enum class Fields : uint8_t +{ + kX = 0, + kY = 1, +}; + +struct Type +{ +public: + uint16_t x = static_cast(0); + uint16_t y = static_cast(0); + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +using DecodableType = Type; + +} // namespace TwoDCartesianVertexStruct +namespace TwoDCartesianZoneStruct { +enum class Fields : uint8_t +{ + kName = 0, + kUse = 1, + kVertices = 2, + kColor = 3, +}; + +struct Type +{ +public: + chip::CharSpan name; + ZoneUseEnum use = static_cast(0); + DataModel::List vertices; + Optional color; + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +struct DecodableType +{ +public: + chip::CharSpan name; + ZoneUseEnum use = static_cast(0); + DataModel::DecodableList vertices; + Optional color; + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; +}; + +} // namespace TwoDCartesianZoneStruct +namespace ZoneInformationStruct { +enum class Fields : uint8_t +{ + kZoneID = 0, + kZoneType = 1, + kZoneSource = 2, +}; + +struct Type +{ +public: + uint16_t zoneID = static_cast(0); + ZoneTypeEnum zoneType = static_cast(0); + ZoneSourceEnum zoneSource = static_cast(0); + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +using DecodableType = Type; + +} // namespace ZoneInformationStruct +namespace ZoneTriggeringTimeControlStruct { +enum class Fields : uint8_t +{ + kInitialDuration = 0, + kAugmentationDuration = 1, + kMaxDuration = 2, + kBlindDuration = 3, +}; + +struct Type +{ +public: + uint16_t initialDuration = static_cast(0); + uint16_t augmentationDuration = static_cast(0); + uint32_t maxDuration = static_cast(0); + uint16_t blindDuration = static_cast(0); + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +using DecodableType = Type; + +} // namespace ZoneTriggeringTimeControlStruct +} // namespace Structs + +namespace Commands { +// Forward-declarations so we can reference these later. + +namespace CreateTwoDCartesianZone { +struct Type; +struct DecodableType; +} // namespace CreateTwoDCartesianZone + +namespace CreateTwoDCartesianZoneResponse { +struct Type; +struct DecodableType; +} // namespace CreateTwoDCartesianZoneResponse + +namespace UpdateTwoDCartesianZone { +struct Type; +struct DecodableType; +} // namespace UpdateTwoDCartesianZone + +namespace GetTwoDCartesianZone { +struct Type; +struct DecodableType; +} // namespace GetTwoDCartesianZone + +namespace GetTwoDCartesianZoneResponse { +struct Type; +struct DecodableType; +} // namespace GetTwoDCartesianZoneResponse + +namespace RemoveZone { +struct Type; +struct DecodableType; +} // namespace RemoveZone + +} // namespace Commands + +namespace Commands { +namespace CreateTwoDCartesianZone { +enum class Fields : uint8_t +{ + kZone = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::CreateTwoDCartesianZone::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } + + Structs::TwoDCartesianZoneStruct::Type zone; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = Clusters::ZoneManagement::Commands::CreateTwoDCartesianZoneResponse::DecodableType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::CreateTwoDCartesianZone::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } + + Structs::TwoDCartesianZoneStruct::DecodableType zone; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace CreateTwoDCartesianZone +namespace CreateTwoDCartesianZoneResponse { +enum class Fields : uint8_t +{ + kZoneID = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::CreateTwoDCartesianZoneResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } + + uint16_t zoneID = static_cast(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::CreateTwoDCartesianZoneResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } + + uint16_t zoneID = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace CreateTwoDCartesianZoneResponse +namespace UpdateTwoDCartesianZone { +enum class Fields : uint8_t +{ + kZoneID = 0, + kZone = 1, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::UpdateTwoDCartesianZone::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } + + uint16_t zoneID = static_cast(0); + Structs::TwoDCartesianZoneStruct::Type zone; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::UpdateTwoDCartesianZone::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } + + uint16_t zoneID = static_cast(0); + Structs::TwoDCartesianZoneStruct::DecodableType zone; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace UpdateTwoDCartesianZone +namespace GetTwoDCartesianZone { +enum class Fields : uint8_t +{ + kZoneID = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::GetTwoDCartesianZone::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } + + Optional> zoneID; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = Clusters::ZoneManagement::Commands::GetTwoDCartesianZoneResponse::DecodableType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::GetTwoDCartesianZone::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } + + Optional> zoneID; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace GetTwoDCartesianZone +namespace GetTwoDCartesianZoneResponse { +enum class Fields : uint8_t +{ + kZones = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::GetTwoDCartesianZoneResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } + + DataModel::List zones; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::GetTwoDCartesianZoneResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } + + DataModel::DecodableList zones; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace GetTwoDCartesianZoneResponse +namespace RemoveZone { +enum class Fields : uint8_t +{ + kZoneID = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::RemoveZone::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } + + uint16_t zoneID = static_cast(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::RemoveZone::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } + + uint16_t zoneID = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace RemoveZone +} // namespace Commands + +namespace Attributes { + +namespace SupportedZoneSources { +struct TypeInfo +{ + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; + + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::SupportedZoneSources::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace SupportedZoneSources +namespace Zones { +struct TypeInfo +{ + using Type = chip::app::DataModel::List; + using DecodableType = + chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList< + chip::app::Clusters::ZoneManagement::Structs::ZoneInformationStruct::DecodableType> &; + + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::Zones::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace Zones +namespace TimeControl { +struct TypeInfo +{ + using Type = + chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList< + chip::app::Clusters::ZoneManagement::Structs::ZoneTriggeringTimeControlStruct::DecodableType>; + using DecodableArgType = const chip::app::DataModel::DecodableList< + chip::app::Clusters::ZoneManagement::Structs::ZoneTriggeringTimeControlStruct::DecodableType> &; + + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::TimeControl::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace TimeControl +namespace Sensitivity { +struct TypeInfo +{ + using Type = uint8_t; + using DecodableType = uint8_t; + using DecodableArgType = uint8_t; + + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::Sensitivity::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace Sensitivity +namespace GeneratedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } +}; +} // namespace GeneratedCommandList +namespace AcceptedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } +}; +} // namespace AcceptedCommandList +namespace EventList { +struct TypeInfo : public Clusters::Globals::Attributes::EventList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } +}; +} // namespace EventList +namespace AttributeList { +struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } +}; +} // namespace AttributeList +namespace FeatureMap { +struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } +}; +} // namespace FeatureMap +namespace ClusterRevision { +struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } +}; +} // namespace ClusterRevision + +struct TypeInfo +{ + struct DecodableType + { + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); + + Attributes::SupportedZoneSources::TypeInfo::DecodableType supportedZoneSources; + Attributes::Zones::TypeInfo::DecodableType zones; + Attributes::TimeControl::TypeInfo::DecodableType timeControl; + Attributes::Sensitivity::TypeInfo::DecodableType sensitivity = static_cast(0); + Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; + Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; + Attributes::EventList::TypeInfo::DecodableType eventList; + Attributes::AttributeList::TypeInfo::DecodableType attributeList; + Attributes::FeatureMap::TypeInfo::DecodableType featureMap = static_cast(0); + Attributes::ClusterRevision::TypeInfo::DecodableType clusterRevision = static_cast(0); + }; +}; +} // namespace Attributes +namespace Events { +namespace ZoneTriggered { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ + kZones = 0, + kReason = 1, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::ZoneTriggered::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } + static constexpr bool kIsFabricScoped = false; + + DataModel::List zones; + ZoneEventTriggeredReasonEnum reason = static_cast(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::ZoneTriggered::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } + + DataModel::DecodableList zones; + ZoneEventTriggeredReasonEnum reason = static_cast(0); + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace ZoneTriggered +namespace ZoneStopped { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ + kZones = 0, + kReason = 1, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::ZoneStopped::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } + static constexpr bool kIsFabricScoped = false; + + DataModel::List zones; + ZoneEventStoppedReasonEnum reason = static_cast(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::ZoneStopped::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } + + DataModel::DecodableList zones; + ZoneEventStoppedReasonEnum reason = static_cast(0); + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace ZoneStopped +} // namespace Events +} // namespace ZoneManagement namespace WebRTCTransportProvider { namespace Structs { namespace ICEServerStruct = Clusters::detail::Structs::ICEServerStruct; diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h index 88942771fa..cc02c9ce31 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h @@ -7317,6 +7317,52 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace ContentAppObserver +namespace ZoneManagement { +namespace Attributes { + +namespace SupportedZoneSources { +static constexpr AttributeId Id = 0x00000000; +} // namespace SupportedZoneSources + +namespace Zones { +static constexpr AttributeId Id = 0x00000001; +} // namespace Zones + +namespace TimeControl { +static constexpr AttributeId Id = 0x00000002; +} // namespace TimeControl + +namespace Sensitivity { +static constexpr AttributeId Id = 0x00000003; +} // namespace Sensitivity + +namespace GeneratedCommandList { +static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id; +} // namespace GeneratedCommandList + +namespace AcceptedCommandList { +static constexpr AttributeId Id = Globals::Attributes::AcceptedCommandList::Id; +} // namespace AcceptedCommandList + +namespace EventList { +static constexpr AttributeId Id = Globals::Attributes::EventList::Id; +} // namespace EventList + +namespace AttributeList { +static constexpr AttributeId Id = Globals::Attributes::AttributeList::Id; +} // namespace AttributeList + +namespace FeatureMap { +static constexpr AttributeId Id = Globals::Attributes::FeatureMap::Id; +} // namespace FeatureMap + +namespace ClusterRevision { +static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace ZoneManagement + namespace WebRTCTransportProvider { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h index f7139e2756..c6e7bc83ea 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h @@ -376,6 +376,9 @@ static constexpr ClusterId Id = 0x0000050F; namespace ContentAppObserver { static constexpr ClusterId Id = 0x00000510; } // namespace ContentAppObserver +namespace ZoneManagement { +static constexpr ClusterId Id = 0x00000550; +} // namespace ZoneManagement namespace WebRTCTransportProvider { static constexpr ClusterId Id = 0x00000553; } // namespace WebRTCTransportProvider diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h index da67d0d999..9239aa3ace 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h @@ -1803,6 +1803,36 @@ static constexpr CommandId Id = 0x00000001; } // namespace Commands } // namespace ContentAppObserver +namespace ZoneManagement { +namespace Commands { + +namespace CreateTwoDCartesianZone { +static constexpr CommandId Id = 0x00000000; +} // namespace CreateTwoDCartesianZone + +namespace CreateTwoDCartesianZoneResponse { +static constexpr CommandId Id = 0x00000001; +} // namespace CreateTwoDCartesianZoneResponse + +namespace UpdateTwoDCartesianZone { +static constexpr CommandId Id = 0x00000002; +} // namespace UpdateTwoDCartesianZone + +namespace GetTwoDCartesianZone { +static constexpr CommandId Id = 0x00000003; +} // namespace GetTwoDCartesianZone + +namespace GetTwoDCartesianZoneResponse { +static constexpr CommandId Id = 0x00000004; +} // namespace GetTwoDCartesianZoneResponse + +namespace RemoveZone { +static constexpr CommandId Id = 0x00000005; +} // namespace RemoveZone + +} // namespace Commands +} // namespace ZoneManagement + namespace WebRTCTransportProvider { namespace Commands { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Events.h b/zzz_generated/app-common/app-common/zap-generated/ids/Events.h index 0756af5268..6f93156ea5 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Events.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Events.h @@ -683,6 +683,20 @@ static constexpr EventId Id = 0x00000000; } // namespace Events } // namespace ContentControl +namespace ZoneManagement { +namespace Events { + +namespace ZoneTriggered { +static constexpr EventId Id = 0x00000000; +} // namespace ZoneTriggered + +namespace ZoneStopped { +static constexpr EventId Id = 0x00000001; +} // namespace ZoneStopped + +} // namespace Events +} // namespace ZoneManagement + namespace CommissionerControl { namespace Events { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 1bbecf1c4b..5752601dc0 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -152,6 +152,7 @@ | AccountLogin | 0x050E | | ContentControl | 0x050F | | ContentAppObserver | 0x0510 | +| ZoneManagement | 0x0550 | | WebRTCTransportProvider | 0x0553 | | WebRTCTransportRequestor | 0x0554 | | Chime | 0x0556 | @@ -13649,6 +13650,186 @@ class ContentAppObserverContentAppMessage : public ClusterCommand chip::app::Clusters::ContentAppObserver::Commands::ContentAppMessage::Type mRequest; }; +/*----------------------------------------------------------------------------*\ +| Cluster ZoneManagement | 0x0550 | +|------------------------------------------------------------------------------| +| Commands: | | +| * CreateTwoDCartesianZone | 0x00 | +| * UpdateTwoDCartesianZone | 0x02 | +| * GetTwoDCartesianZone | 0x03 | +| * RemoveZone | 0x05 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * SupportedZoneSources | 0x0000 | +| * Zones | 0x0001 | +| * TimeControl | 0x0002 | +| * Sensitivity | 0x0003 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +| * ZoneTriggered | 0x0000 | +| * ZoneStopped | 0x0001 | +\*----------------------------------------------------------------------------*/ + +/* + * Command CreateTwoDCartesianZone + */ +class ZoneManagementCreateTwoDCartesianZone : public ClusterCommand +{ +public: + ZoneManagementCreateTwoDCartesianZone(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("create-two-dcartesian-zone", credsIssuerConfig), mComplex_Zone(&mRequest.zone) + { + AddArgument("Zone", &mComplex_Zone); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ZoneManagement::Commands::CreateTwoDCartesianZone::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ZoneManagement::Commands::CreateTwoDCartesianZone::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::ZoneManagement::Commands::CreateTwoDCartesianZone::Type mRequest; + TypedComplexArgument mComplex_Zone; +}; + +/* + * Command UpdateTwoDCartesianZone + */ +class ZoneManagementUpdateTwoDCartesianZone : public ClusterCommand +{ +public: + ZoneManagementUpdateTwoDCartesianZone(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("update-two-dcartesian-zone", credsIssuerConfig), mComplex_Zone(&mRequest.zone) + { + AddArgument("ZoneID", 0, UINT16_MAX, &mRequest.zoneID); + AddArgument("Zone", &mComplex_Zone); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ZoneManagement::Commands::UpdateTwoDCartesianZone::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ZoneManagement::Commands::UpdateTwoDCartesianZone::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::ZoneManagement::Commands::UpdateTwoDCartesianZone::Type mRequest; + TypedComplexArgument mComplex_Zone; +}; + +/* + * Command GetTwoDCartesianZone + */ +class ZoneManagementGetTwoDCartesianZone : public ClusterCommand +{ +public: + ZoneManagementGetTwoDCartesianZone(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("get-two-dcartesian-zone", credsIssuerConfig) + { + AddArgument("ZoneID", 0, UINT16_MAX, &mRequest.zoneID); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ZoneManagement::Commands::GetTwoDCartesianZone::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ZoneManagement::Commands::GetTwoDCartesianZone::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::ZoneManagement::Commands::GetTwoDCartesianZone::Type mRequest; +}; + +/* + * Command RemoveZone + */ +class ZoneManagementRemoveZone : public ClusterCommand +{ +public: + ZoneManagementRemoveZone(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("remove-zone", credsIssuerConfig) + { + AddArgument("ZoneID", 0, UINT16_MAX, &mRequest.zoneID); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ZoneManagement::Commands::RemoveZone::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ZoneManagement::Commands::RemoveZone::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::ZoneManagement::Commands::RemoveZone::Type mRequest; +}; + /*----------------------------------------------------------------------------*\ | Cluster WebRTCTransportProvider | 0x0553 | |------------------------------------------------------------------------------| @@ -26643,6 +26824,84 @@ void registerClusterContentAppObserver(Commands & commands, CredentialIssuerComm commands.RegisterCluster(clusterName, clusterCommands); } +void registerClusterZoneManagement(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) +{ + using namespace chip::app::Clusters::ZoneManagement; + + const char * clusterName = "ZoneManagement"; + + commands_list clusterCommands = { + // + // Commands + // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + // + // Attributes + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "supported-zone-sources", Attributes::SupportedZoneSources::Id, credsIssuerConfig), // + make_unique(Id, "zones", Attributes::Zones::Id, credsIssuerConfig), // + make_unique(Id, "time-control", Attributes::TimeControl::Id, credsIssuerConfig), // + make_unique(Id, "sensitivity", Attributes::Sensitivity::Id, credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + make_unique>(Id, credsIssuerConfig), // + make_unique>>( + Id, "supported-zone-sources", Attributes::SupportedZoneSources::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>>( + Id, "zones", Attributes::Zones::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "time-control", Attributes::TimeControl::Id, WriteCommandType::kWrite, credsIssuerConfig), // + make_unique>(Id, "sensitivity", 0, UINT8_MAX, Attributes::Sensitivity::Id, WriteCommandType::kWrite, + credsIssuerConfig), // + make_unique>>( + Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>>( + Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "event-list", Attributes::EventList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "attribute-list", Attributes::AttributeList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "feature-map", 0, UINT32_MAX, Attributes::FeatureMap::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "cluster-revision", 0, UINT16_MAX, Attributes::ClusterRevision::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "supported-zone-sources", Attributes::SupportedZoneSources::Id, credsIssuerConfig), // + make_unique(Id, "zones", Attributes::Zones::Id, credsIssuerConfig), // + make_unique(Id, "time-control", Attributes::TimeControl::Id, credsIssuerConfig), // + make_unique(Id, "sensitivity", Attributes::Sensitivity::Id, credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + // + // Events + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "zone-triggered", Events::ZoneTriggered::Id, credsIssuerConfig), // + make_unique(Id, "zone-stopped", Events::ZoneStopped::Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "zone-triggered", Events::ZoneTriggered::Id, credsIssuerConfig), // + make_unique(Id, "zone-stopped", Events::ZoneStopped::Id, credsIssuerConfig), // + }; + + commands.RegisterCluster(clusterName, clusterCommands); +} void registerClusterWebRTCTransportProvider(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) { using namespace chip::app::Clusters::WebRTCTransportProvider; @@ -27692,6 +27951,7 @@ void registerClusters(Commands & commands, CredentialIssuerCommands * credsIssue registerClusterAccountLogin(commands, credsIssuerConfig); registerClusterContentControl(commands, credsIssuerConfig); registerClusterContentAppObserver(commands, credsIssuerConfig); + registerClusterZoneManagement(commands, credsIssuerConfig); registerClusterWebRTCTransportProvider(commands, credsIssuerConfig); registerClusterWebRTCTransportRequestor(commands, credsIssuerConfig); registerClusterChime(commands, credsIssuerConfig); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp index 76313bf47a..0f63549bee 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp @@ -5784,6 +5784,168 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::ContentControl::Struct ComplexArgumentParser::Finalize(request.ratingNameDesc); } +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::ZoneManagement::Structs::TwoDCartesianVertexStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("TwoDCartesianVertexStruct.x", "x", value.isMember("x"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("TwoDCartesianVertexStruct.y", "y", value.isMember("y"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "x"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.x, value["x"])); + valueCopy.removeMember("x"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "y"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.y, value["y"])); + valueCopy.removeMember("y"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::ZoneManagement::Structs::TwoDCartesianVertexStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.x); + ComplexArgumentParser::Finalize(request.y); +} + +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::ZoneManagement::Structs::TwoDCartesianZoneStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("TwoDCartesianZoneStruct.name", "name", value.isMember("name"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("TwoDCartesianZoneStruct.use", "use", value.isMember("use"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("TwoDCartesianZoneStruct.vertices", "vertices", value.isMember("vertices"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "name"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.name, value["name"])); + valueCopy.removeMember("name"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "use"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.use, value["use"])); + valueCopy.removeMember("use"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "vertices"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.vertices, value["vertices"])); + valueCopy.removeMember("vertices"); + + if (value.isMember("color")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "color"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.color, value["color"])); + } + valueCopy.removeMember("color"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::ZoneManagement::Structs::TwoDCartesianZoneStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.name); + ComplexArgumentParser::Finalize(request.use); + ComplexArgumentParser::Finalize(request.vertices); + ComplexArgumentParser::Finalize(request.color); +} + +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::ZoneManagement::Structs::ZoneInformationStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("ZoneInformationStruct.zoneID", "zoneID", value.isMember("zoneID"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("ZoneInformationStruct.zoneType", "zoneType", value.isMember("zoneType"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("ZoneInformationStruct.zoneSource", "zoneSource", value.isMember("zoneSource"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "zoneID"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.zoneID, value["zoneID"])); + valueCopy.removeMember("zoneID"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "zoneType"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.zoneType, value["zoneType"])); + valueCopy.removeMember("zoneType"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "zoneSource"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.zoneSource, value["zoneSource"])); + valueCopy.removeMember("zoneSource"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::ZoneManagement::Structs::ZoneInformationStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.zoneID); + ComplexArgumentParser::Finalize(request.zoneType); + ComplexArgumentParser::Finalize(request.zoneSource); +} + +CHIP_ERROR +ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::ZoneManagement::Structs::ZoneTriggeringTimeControlStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ZoneTriggeringTimeControlStruct.initialDuration", + "initialDuration", value.isMember("initialDuration"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ZoneTriggeringTimeControlStruct.augmentationDuration", + "augmentationDuration", value.isMember("augmentationDuration"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ZoneTriggeringTimeControlStruct.maxDuration", "maxDuration", + value.isMember("maxDuration"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ZoneTriggeringTimeControlStruct.blindDuration", "blindDuration", + value.isMember("blindDuration"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "initialDuration"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.initialDuration, value["initialDuration"])); + valueCopy.removeMember("initialDuration"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "augmentationDuration"); + ReturnErrorOnFailure( + ComplexArgumentParser::Setup(labelWithMember, request.augmentationDuration, value["augmentationDuration"])); + valueCopy.removeMember("augmentationDuration"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "maxDuration"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.maxDuration, value["maxDuration"])); + valueCopy.removeMember("maxDuration"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "blindDuration"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.blindDuration, value["blindDuration"])); + valueCopy.removeMember("blindDuration"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::ZoneManagement::Structs::ZoneTriggeringTimeControlStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.initialDuration); + ComplexArgumentParser::Finalize(request.augmentationDuration); + ComplexArgumentParser::Finalize(request.maxDuration); + ComplexArgumentParser::Finalize(request.blindDuration); +} + CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::Chime::Structs::ChimeSoundStruct::Type & request, Json::Value & value) { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h index 777f61afb9..009a4f8904 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h @@ -668,6 +668,27 @@ static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ContentControl: static void Finalize(chip::app::Clusters::ContentControl::Structs::RatingNameStruct::Type & request); +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ZoneManagement::Structs::TwoDCartesianVertexStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::ZoneManagement::Structs::TwoDCartesianVertexStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ZoneManagement::Structs::TwoDCartesianZoneStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::ZoneManagement::Structs::TwoDCartesianZoneStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ZoneManagement::Structs::ZoneInformationStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::ZoneManagement::Structs::ZoneInformationStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, + chip::app::Clusters::ZoneManagement::Structs::ZoneTriggeringTimeControlStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::ZoneManagement::Structs::ZoneTriggeringTimeControlStruct::Type & request); + static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Chime::Structs::ChimeSoundStruct::Type & request, Json::Value & value); 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 c6682c0350..738f6e74a8 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -5103,6 +5103,150 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } +CHIP_ERROR +DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::ZoneManagement::Structs::TwoDCartesianVertexStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("X", indent + 1, value.x); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'X'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("Y", indent + 1, value.y); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Y'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR +DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::ZoneManagement::Structs::TwoDCartesianZoneStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("Name", indent + 1, value.name); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Name'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("Use", indent + 1, value.use); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Use'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("Vertices", indent + 1, value.vertices); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Vertices'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("Color", indent + 1, value.color); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Color'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR +DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::ZoneManagement::Structs::ZoneInformationStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("ZoneID", indent + 1, value.zoneID); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ZoneID'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("ZoneType", indent + 1, value.zoneType); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ZoneType'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("ZoneSource", indent + 1, value.zoneSource); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ZoneSource'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR DataModelLogger::LogValue( + const char * label, size_t indent, + const chip::app::Clusters::ZoneManagement::Structs::ZoneTriggeringTimeControlStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("InitialDuration", indent + 1, value.initialDuration); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'InitialDuration'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("AugmentationDuration", indent + 1, value.augmentationDuration); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'AugmentationDuration'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("MaxDuration", indent + 1, value.maxDuration); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MaxDuration'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("BlindDuration", indent + 1, value.blindDuration); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'BlindDuration'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const chip::app::Clusters::Chime::Structs::ChimeSoundStruct::DecodableType & value) { @@ -8027,6 +8171,54 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const ZoneManagement::Events::ZoneTriggered::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("Zones", indent + 1, value.zones); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Zones'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("Reason", indent + 1, value.reason); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Reason'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const ZoneManagement::Events::ZoneStopped::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("Zones", indent + 1, value.zones); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Zones'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("Reason", indent + 1, value.reason); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Reason'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const CommissionerControl::Events::CommissioningRequestResult::DecodableType & value) { @@ -8847,6 +9039,22 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; } +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const ZoneManagement::Commands::CreateTwoDCartesianZoneResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("zoneID", indent + 1, value.zoneID)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const ZoneManagement::Commands::GetTwoDCartesianZoneResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("zones", indent + 1, value.zones)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const WebRTCTransportProvider::Commands::SolicitOfferResponse::DecodableType & value) { @@ -18075,6 +18283,65 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } + case ZoneManagement::Id: { + switch (path.mAttributeId) + { + case ZoneManagement::Attributes::SupportedZoneSources::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("SupportedZoneSources", 1, value); + } + case ZoneManagement::Attributes::Zones::Id: { + chip::app::DataModel::DecodableList + value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("Zones", 1, value); + } + case ZoneManagement::Attributes::TimeControl::Id: { + chip::app::DataModel::DecodableList< + chip::app::Clusters::ZoneManagement::Structs::ZoneTriggeringTimeControlStruct::DecodableType> + value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("TimeControl", 1, value); + } + case ZoneManagement::Attributes::Sensitivity::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("Sensitivity", 1, value); + } + case ZoneManagement::Attributes::GeneratedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ZoneManagement::Id); + } + case ZoneManagement::Attributes::AcceptedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ZoneManagement::Id); + } + case ZoneManagement::Attributes::EventList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("EventList", 1, value); + } + case ZoneManagement::Attributes::AttributeList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ZoneManagement::Id); + } + case ZoneManagement::Attributes::FeatureMap::Id: { + uint32_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("FeatureMap", 1, value); + } + case ZoneManagement::Attributes::ClusterRevision::Id: { + uint16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ClusterRevision", 1, value); + } + } + break; + } case WebRTCTransportProvider::Id: { switch (path.mAttributeId) { @@ -19468,6 +19735,22 @@ CHIP_ERROR DataModelLogger::LogCommand(const chip::app::ConcreteCommandPath & pa } break; } + case ZoneManagement::Id: { + switch (path.mCommandId) + { + case ZoneManagement::Commands::CreateTwoDCartesianZoneResponse::Id: { + ZoneManagement::Commands::CreateTwoDCartesianZoneResponse::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("CreateTwoDCartesianZoneResponse", 1, value); + } + case ZoneManagement::Commands::GetTwoDCartesianZoneResponse::Id: { + ZoneManagement::Commands::GetTwoDCartesianZoneResponse::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("GetTwoDCartesianZoneResponse", 1, value); + } + } + break; + } case WebRTCTransportProvider::Id: { switch (path.mCommandId) { @@ -20397,6 +20680,22 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip } break; } + case ZoneManagement::Id: { + switch (header.mPath.mEventId) + { + case ZoneManagement::Events::ZoneTriggered::Id: { + chip::app::Clusters::ZoneManagement::Events::ZoneTriggered::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ZoneTriggered", 1, value); + } + case ZoneManagement::Events::ZoneStopped::Id: { + chip::app::Clusters::ZoneManagement::Events::ZoneStopped::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ZoneStopped", 1, value); + } + } + break; + } case CommissionerControl::Id: { switch (header.mPath.mEventId) { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h index 05432564bf..2960cbc896 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -410,6 +410,19 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::ContentControl::Structs::RatingNameStruct::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::ZoneManagement::Structs::TwoDCartesianVertexStruct::DecodableType & value); + +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::ZoneManagement::Structs::TwoDCartesianZoneStruct::DecodableType & value); + +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::ZoneManagement::Structs::ZoneInformationStruct::DecodableType & value); + +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::ZoneManagement::Structs::ZoneTriggeringTimeControlStruct::DecodableType & value); + static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::Chime::Structs::ChimeSoundStruct::DecodableType & value); @@ -681,6 +694,10 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::AccountLogin::Events::LoggedOut::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::ContentControl::Events::RemainingScreenTimeExpired::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::ZoneManagement::Events::ZoneTriggered::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::ZoneManagement::Events::ZoneStopped::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::CommissionerControl::Events::CommissioningRequestResult::DecodableType & value); @@ -854,6 +871,12 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::ContentAppObserver::Commands::ContentAppMessageResponse::DecodableType & value); static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::ZoneManagement::Commands::CreateTwoDCartesianZoneResponse::DecodableType & value); +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::ZoneManagement::Commands::GetTwoDCartesianZoneResponse::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::WebRTCTransportProvider::Commands::SolicitOfferResponse::DecodableType & value); static CHIP_ERROR diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp index 1ff61d2e84..b4f5366038 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp @@ -259,6 +259,8 @@ char const * ClusterIdToText(chip::ClusterId id) return "ContentControl"; case chip::app::Clusters::ContentAppObserver::Id: return "ContentAppObserver"; + case chip::app::Clusters::ZoneManagement::Id: + return "ZoneManagement"; case chip::app::Clusters::WebRTCTransportProvider::Id: return "WebRTCTransportProvider"; case chip::app::Clusters::WebRTCTransportRequestor::Id: @@ -4383,6 +4385,33 @@ char const * AttributeIdToText(chip::ClusterId cluster, chip::AttributeId id) return "Unknown"; } } + case chip::app::Clusters::ZoneManagement::Id: { + switch (id) + { + case chip::app::Clusters::ZoneManagement::Attributes::SupportedZoneSources::Id: + return "SupportedZoneSources"; + case chip::app::Clusters::ZoneManagement::Attributes::Zones::Id: + return "Zones"; + case chip::app::Clusters::ZoneManagement::Attributes::TimeControl::Id: + return "TimeControl"; + case chip::app::Clusters::ZoneManagement::Attributes::Sensitivity::Id: + return "Sensitivity"; + case chip::app::Clusters::ZoneManagement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::ZoneManagement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::ZoneManagement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::ZoneManagement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::ZoneManagement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::ZoneManagement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } case chip::app::Clusters::WebRTCTransportProvider::Id: { switch (id) { @@ -5776,6 +5805,21 @@ char const * AcceptedCommandIdToText(chip::ClusterId cluster, chip::CommandId id return "Unknown"; } } + case chip::app::Clusters::ZoneManagement::Id: { + switch (id) + { + case chip::app::Clusters::ZoneManagement::Commands::CreateTwoDCartesianZone::Id: + return "CreateTwoDCartesianZone"; + case chip::app::Clusters::ZoneManagement::Commands::UpdateTwoDCartesianZone::Id: + return "UpdateTwoDCartesianZone"; + case chip::app::Clusters::ZoneManagement::Commands::GetTwoDCartesianZone::Id: + return "GetTwoDCartesianZone"; + case chip::app::Clusters::ZoneManagement::Commands::RemoveZone::Id: + return "RemoveZone"; + default: + return "Unknown"; + } + } case chip::app::Clusters::WebRTCTransportProvider::Id: { switch (id) { @@ -6340,6 +6384,17 @@ char const * GeneratedCommandIdToText(chip::ClusterId cluster, chip::CommandId i return "Unknown"; } } + case chip::app::Clusters::ZoneManagement::Id: { + switch (id) + { + case chip::app::Clusters::ZoneManagement::Commands::CreateTwoDCartesianZoneResponse::Id: + return "CreateTwoDCartesianZoneResponse"; + case chip::app::Clusters::ZoneManagement::Commands::GetTwoDCartesianZoneResponse::Id: + return "GetTwoDCartesianZoneResponse"; + default: + return "Unknown"; + } + } case chip::app::Clusters::WebRTCTransportProvider::Id: { switch (id) { diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index 29dc7b342a..bff564e147 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -154,6 +154,7 @@ | AccountLogin | 0x050E | | ContentControl | 0x050F | | ContentAppObserver | 0x0510 | +| ZoneManagement | 0x0550 | | WebRTCTransportProvider | 0x0553 | | WebRTCTransportRequestor | 0x0554 | | Chime | 0x0556 | @@ -160117,6 +160118,1260 @@ class SubscribeAttributeContentAppObserverClusterRevision : public SubscribeAttr } }; +#endif // MTR_ENABLE_PROVISIONAL +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/*----------------------------------------------------------------------------*\ +| Cluster ZoneManagement | 0x0550 | +|------------------------------------------------------------------------------| +| Commands: | | +| * CreateTwoDCartesianZone | 0x00 | +| * UpdateTwoDCartesianZone | 0x02 | +| * GetTwoDCartesianZone | 0x03 | +| * RemoveZone | 0x05 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * SupportedZoneSources | 0x0000 | +| * Zones | 0x0001 | +| * TimeControl | 0x0002 | +| * Sensitivity | 0x0003 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +| * ZoneTriggered | 0x0000 | +| * ZoneStopped | 0x0001 | +\*----------------------------------------------------------------------------*/ + +#if MTR_ENABLE_PROVISIONAL +/* + * Command CreateTwoDCartesianZone + */ +class ZoneManagementCreateTwoDCartesianZone : public ClusterCommand { +public: + ZoneManagementCreateTwoDCartesianZone() + : ClusterCommand("create-two-dcartesian-zone") + , mComplex_Zone(&mRequest.zone) + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("Zone", &mComplex_Zone); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ZoneManagement::Commands::CreateTwoDCartesianZone::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRZoneManagementClusterCreateTwoDCartesianZoneParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.zone = [MTRZoneManagementClusterTwoDCartesianZoneStruct new]; + params.zone.name = [[NSString alloc] initWithBytes:mRequest.zone.name.data() length:mRequest.zone.name.size() encoding:NSUTF8StringEncoding]; + params.zone.use = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.zone.use)]; + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + for (auto & entry_1 : mRequest.zone.vertices) { + MTRZoneManagementClusterTwoDCartesianVertexStruct * newElement_1; + newElement_1 = [MTRZoneManagementClusterTwoDCartesianVertexStruct new]; + newElement_1.x = [NSNumber numberWithUnsignedShort:entry_1.x]; + newElement_1.y = [NSNumber numberWithUnsignedShort:entry_1.y]; + [array_1 addObject:newElement_1]; + } + params.zone.vertices = array_1; + } + if (mRequest.zone.color.HasValue()) { + params.zone.color = [[NSString alloc] initWithBytes:mRequest.zone.color.Value().data() length:mRequest.zone.color.Value().size() encoding:NSUTF8StringEncoding]; + } else { + params.zone.color = nil; + } +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster createTwoDCartesianZoneWithParams:params completion: + ^(MTRZoneManagementClusterCreateTwoDCartesianZoneResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::ZoneManagement::Commands::CreateTwoDCartesianZoneResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::ZoneManagement::Commands::CreateTwoDCartesianZoneResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::ZoneManagement::Commands::CreateTwoDCartesianZone::Type mRequest; + TypedComplexArgument mComplex_Zone; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command UpdateTwoDCartesianZone + */ +class ZoneManagementUpdateTwoDCartesianZone : public ClusterCommand { +public: + ZoneManagementUpdateTwoDCartesianZone() + : ClusterCommand("update-two-dcartesian-zone") + , mComplex_Zone(&mRequest.zone) + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("ZoneID", 0, UINT16_MAX, &mRequest.zoneID); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("Zone", &mComplex_Zone); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ZoneManagement::Commands::UpdateTwoDCartesianZone::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRZoneManagementClusterUpdateTwoDCartesianZoneParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.zoneID = [NSNumber numberWithUnsignedShort:mRequest.zoneID]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.zone = [MTRZoneManagementClusterTwoDCartesianZoneStruct new]; + params.zone.name = [[NSString alloc] initWithBytes:mRequest.zone.name.data() length:mRequest.zone.name.size() encoding:NSUTF8StringEncoding]; + params.zone.use = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.zone.use)]; + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + for (auto & entry_1 : mRequest.zone.vertices) { + MTRZoneManagementClusterTwoDCartesianVertexStruct * newElement_1; + newElement_1 = [MTRZoneManagementClusterTwoDCartesianVertexStruct new]; + newElement_1.x = [NSNumber numberWithUnsignedShort:entry_1.x]; + newElement_1.y = [NSNumber numberWithUnsignedShort:entry_1.y]; + [array_1 addObject:newElement_1]; + } + params.zone.vertices = array_1; + } + if (mRequest.zone.color.HasValue()) { + params.zone.color = [[NSString alloc] initWithBytes:mRequest.zone.color.Value().data() length:mRequest.zone.color.Value().size() encoding:NSUTF8StringEncoding]; + } else { + params.zone.color = nil; + } +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster updateTwoDCartesianZoneWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::ZoneManagement::Commands::UpdateTwoDCartesianZone::Type mRequest; + TypedComplexArgument mComplex_Zone; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command GetTwoDCartesianZone + */ +class ZoneManagementGetTwoDCartesianZone : public ClusterCommand { +public: + ZoneManagementGetTwoDCartesianZone() + : ClusterCommand("get-two-dcartesian-zone") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("ZoneID", 0, UINT16_MAX, &mRequest.zoneID); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ZoneManagement::Commands::GetTwoDCartesianZone::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRZoneManagementClusterGetTwoDCartesianZoneParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + if (mRequest.zoneID.HasValue()) { + if (mRequest.zoneID.Value().IsNull()) { + params.zoneID = nil; + } else { + params.zoneID = [NSNumber numberWithUnsignedShort:mRequest.zoneID.Value().Value()]; + } + } else { + params.zoneID = nil; + } +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster getTwoDCartesianZoneWithParams:params completion: + ^(MTRZoneManagementClusterGetTwoDCartesianZoneResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::ZoneManagement::Commands::GetTwoDCartesianZoneResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::ZoneManagement::Commands::GetTwoDCartesianZoneResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::ZoneManagement::Commands::GetTwoDCartesianZone::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command RemoveZone + */ +class ZoneManagementRemoveZone : public ClusterCommand { +public: + ZoneManagementRemoveZone() + : ClusterCommand("remove-zone") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("ZoneID", 0, UINT16_MAX, &mRequest.zoneID); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ZoneManagement::Commands::RemoveZone::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRZoneManagementClusterRemoveZoneParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.zoneID = [NSNumber numberWithUnsignedShort:mRequest.zoneID]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster removeZoneWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::ZoneManagement::Commands::RemoveZone::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL + +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute SupportedZoneSources + */ +class ReadZoneManagementSupportedZoneSources : public ReadAttribute { +public: + ReadZoneManagementSupportedZoneSources() + : ReadAttribute("supported-zone-sources") + { + } + + ~ReadZoneManagementSupportedZoneSources() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ZoneManagement::Attributes::SupportedZoneSources::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeSupportedZoneSourcesWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ZoneManagement.SupportedZoneSources response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("ZoneManagement SupportedZoneSources read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeZoneManagementSupportedZoneSources : public SubscribeAttribute { +public: + SubscribeAttributeZoneManagementSupportedZoneSources() + : SubscribeAttribute("supported-zone-sources") + { + } + + ~SubscribeAttributeZoneManagementSupportedZoneSources() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::ZoneManagement::Attributes::SupportedZoneSources::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeSupportedZoneSourcesWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ZoneManagement.SupportedZoneSources response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute Zones + */ +class ReadZoneManagementZones : public ReadAttribute { +public: + ReadZoneManagementZones() + : ReadAttribute("zones") + { + } + + ~ReadZoneManagementZones() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ZoneManagement::Attributes::Zones::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeZonesWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ZoneManagement.Zones response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("ZoneManagement Zones read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeZoneManagementZones : public SubscribeAttribute { +public: + SubscribeAttributeZoneManagementZones() + : SubscribeAttribute("zones") + { + } + + ~SubscribeAttributeZoneManagementZones() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::ZoneManagement::Attributes::Zones::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeZonesWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ZoneManagement.Zones response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute TimeControl + */ +class ReadZoneManagementTimeControl : public ReadAttribute { +public: + ReadZoneManagementTimeControl() + : ReadAttribute("time-control") + { + } + + ~ReadZoneManagementTimeControl() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ZoneManagement::Attributes::TimeControl::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeTimeControlWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ZoneManagement.TimeControl response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("ZoneManagement TimeControl read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteZoneManagementTimeControl : public WriteAttribute { +public: + WriteZoneManagementTimeControl() + : WriteAttribute("time-control") + , mComplex(&mValue) + { + AddArgument("attr-name", "time-control"); + AddArgument("attr-value", &mComplex); + WriteAttribute::AddArguments(); + } + + ~WriteZoneManagementTimeControl() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ZoneManagement::Attributes::TimeControl::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + for (auto & entry_0 : mValue) { + MTRZoneManagementClusterZoneTriggeringTimeControlStruct * newElement_0; + newElement_0 = [MTRZoneManagementClusterZoneTriggeringTimeControlStruct new]; + newElement_0.initialDuration = [NSNumber numberWithUnsignedShort:entry_0.initialDuration]; + newElement_0.augmentationDuration = [NSNumber numberWithUnsignedShort:entry_0.augmentationDuration]; + newElement_0.maxDuration = [NSNumber numberWithUnsignedInt:entry_0.maxDuration]; + newElement_0.blindDuration = [NSNumber numberWithUnsignedShort:entry_0.blindDuration]; + [array_0 addObject:newElement_0]; + } + value = array_0; + } + + [cluster writeAttributeTimeControlWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("ZoneManagement TimeControl write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + chip::app::DataModel::List mValue; + TypedComplexArgument> mComplex; +}; + +class SubscribeAttributeZoneManagementTimeControl : public SubscribeAttribute { +public: + SubscribeAttributeZoneManagementTimeControl() + : SubscribeAttribute("time-control") + { + } + + ~SubscribeAttributeZoneManagementTimeControl() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::ZoneManagement::Attributes::TimeControl::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeTimeControlWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ZoneManagement.TimeControl response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute Sensitivity + */ +class ReadZoneManagementSensitivity : public ReadAttribute { +public: + ReadZoneManagementSensitivity() + : ReadAttribute("sensitivity") + { + } + + ~ReadZoneManagementSensitivity() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ZoneManagement::Attributes::Sensitivity::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeSensitivityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ZoneManagement.Sensitivity response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("ZoneManagement Sensitivity read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteZoneManagementSensitivity : public WriteAttribute { +public: + WriteZoneManagementSensitivity() + : WriteAttribute("sensitivity") + { + AddArgument("attr-name", "sensitivity"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteZoneManagementSensitivity() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ZoneManagement::Attributes::Sensitivity::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeSensitivityWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("ZoneManagement Sensitivity write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeZoneManagementSensitivity : public SubscribeAttribute { +public: + SubscribeAttributeZoneManagementSensitivity() + : SubscribeAttribute("sensitivity") + { + } + + ~SubscribeAttributeZoneManagementSensitivity() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::ZoneManagement::Attributes::Sensitivity::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeSensitivityWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ZoneManagement.Sensitivity response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute GeneratedCommandList + */ +class ReadZoneManagementGeneratedCommandList : public ReadAttribute { +public: + ReadZoneManagementGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadZoneManagementGeneratedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ZoneManagement::Attributes::GeneratedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ZoneManagement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("ZoneManagement GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeZoneManagementGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeZoneManagementGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributeZoneManagementGeneratedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::ZoneManagement::Attributes::GeneratedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeGeneratedCommandListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ZoneManagement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute AcceptedCommandList + */ +class ReadZoneManagementAcceptedCommandList : public ReadAttribute { +public: + ReadZoneManagementAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadZoneManagementAcceptedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ZoneManagement::Attributes::AcceptedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ZoneManagement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("ZoneManagement AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeZoneManagementAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeZoneManagementAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributeZoneManagementAcceptedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::ZoneManagement::Attributes::AcceptedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAcceptedCommandListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ZoneManagement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute EventList + */ +class ReadZoneManagementEventList : public ReadAttribute { +public: + ReadZoneManagementEventList() + : ReadAttribute("event-list") + { + } + + ~ReadZoneManagementEventList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ZoneManagement::Attributes::EventList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ZoneManagement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("ZoneManagement EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeZoneManagementEventList : public SubscribeAttribute { +public: + SubscribeAttributeZoneManagementEventList() + : SubscribeAttribute("event-list") + { + } + + ~SubscribeAttributeZoneManagementEventList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::ZoneManagement::Attributes::EventList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeEventListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ZoneManagement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute AttributeList + */ +class ReadZoneManagementAttributeList : public ReadAttribute { +public: + ReadZoneManagementAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadZoneManagementAttributeList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ZoneManagement::Attributes::AttributeList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ZoneManagement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("ZoneManagement AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeZoneManagementAttributeList : public SubscribeAttribute { +public: + SubscribeAttributeZoneManagementAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributeZoneManagementAttributeList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::ZoneManagement::Attributes::AttributeList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAttributeListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ZoneManagement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute FeatureMap + */ +class ReadZoneManagementFeatureMap : public ReadAttribute { +public: + ReadZoneManagementFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadZoneManagementFeatureMap() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ZoneManagement::Attributes::FeatureMap::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ZoneManagement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("ZoneManagement FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeZoneManagementFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeZoneManagementFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeZoneManagementFeatureMap() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::ZoneManagement::Attributes::FeatureMap::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeFeatureMapWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ZoneManagement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute ClusterRevision + */ +class ReadZoneManagementClusterRevision : public ReadAttribute { +public: + ReadZoneManagementClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadZoneManagementClusterRevision() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ZoneManagement::Attributes::ClusterRevision::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ZoneManagement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("ZoneManagement ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeZoneManagementClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributeZoneManagementClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributeZoneManagementClusterRevision() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::ZoneManagement::Attributes::ClusterRevision::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeClusterRevisionWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ZoneManagement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + #endif // MTR_ENABLE_PROVISIONAL #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL @@ -186051,6 +187306,79 @@ void registerClusterContentAppObserver(Commands & commands) commands.RegisterCluster(clusterName, clusterCommands); #endif // MTR_ENABLE_PROVISIONAL } +void registerClusterZoneManagement(Commands & commands) +{ +#if MTR_ENABLE_PROVISIONAL + using namespace chip::app::Clusters::ZoneManagement; + + const char * clusterName = "ZoneManagement"; + + commands_list clusterCommands = { + make_unique(Id), // +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL + make_unique(Id), // + make_unique(Id), // + make_unique(Id), // +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL + make_unique(Id), // + make_unique(Id), // + }; + + commands.RegisterCluster(clusterName, clusterCommands); +#endif // MTR_ENABLE_PROVISIONAL +} void registerClusterWebRTCTransportProvider(Commands & commands) { #if MTR_ENABLE_PROVISIONAL @@ -186866,6 +188194,7 @@ void registerClusters(Commands & commands) registerClusterAccountLogin(commands); registerClusterContentControl(commands); registerClusterContentAppObserver(commands); + registerClusterZoneManagement(commands); registerClusterWebRTCTransportProvider(commands); registerClusterWebRTCTransportRequestor(commands); registerClusterChime(commands); From 24fd0d6625c6900854f862e63f41b95767cd6533 Mon Sep 17 00:00:00 2001 From: Junior Martinez <67972863+jmartinez-silabs@users.noreply.github.com> Date: Wed, 9 Oct 2024 17:06:33 -0400 Subject: [PATCH 063/127] Add a GenericPlatformManager implementation based on CMSISOS V2 API (#35924) * Add a GenericPlatformManager implementation based on CMSISOS V2 API * Restyled by gn * Fix efr32 test_driver build by including the needed headers as they were previously available through the freertos genericPlatformImplementation * Address comments --------- Co-authored-by: Restyled.io --- src/include/platform/ConnectivityManager.h | 4 + src/include/platform/PlatformManager.h | 4 + src/include/platform/ThreadStackManager.h | 4 + .../GenericPlatformManagerImpl_CMSISOS.h | 182 +++++++++ .../GenericPlatformManagerImpl_CMSISOS.ipp | 375 ++++++++++++++++++ src/platform/BUILD.gn | 2 + src/platform/FreeRTOS/SystemTimeSupport.cpp | 1 + .../silabs/CHIPDevicePlatformConfig.h | 6 + src/platform/silabs/CHIPPlatformConfig.h | 10 +- .../silabs/ConfigurationManagerImpl.cpp | 3 +- src/platform/silabs/Logging.cpp | 13 - src/platform/silabs/PlatformManagerImpl.cpp | 7 +- src/platform/silabs/PlatformManagerImpl.h | 8 +- 13 files changed, 592 insertions(+), 27 deletions(-) create mode 100644 src/include/platform/internal/GenericPlatformManagerImpl_CMSISOS.h create mode 100644 src/include/platform/internal/GenericPlatformManagerImpl_CMSISOS.ipp diff --git a/src/include/platform/ConnectivityManager.h b/src/include/platform/ConnectivityManager.h index 209d7484b9..cac22ed0da 100644 --- a/src/include/platform/ConnectivityManager.h +++ b/src/include/platform/ConnectivityManager.h @@ -52,6 +52,8 @@ namespace Internal { template class GenericPlatformManagerImpl; template +class GenericPlatformManagerImpl_CMSISOS; +template class GenericPlatformManagerImpl_FreeRTOS; template class GenericPlatformManagerImpl_POSIX; @@ -249,6 +251,8 @@ class ConnectivityManager template friend class Internal::GenericPlatformManagerImpl; template + friend class Internal::GenericPlatformManagerImpl_CMSISOS; + template friend class Internal::GenericPlatformManagerImpl_FreeRTOS; template friend class Internal::GenericPlatformManagerImpl_POSIX; diff --git a/src/include/platform/PlatformManager.h b/src/include/platform/PlatformManager.h index 4ce673ec41..c5fc1f1c08 100644 --- a/src/include/platform/PlatformManager.h +++ b/src/include/platform/PlatformManager.h @@ -53,6 +53,8 @@ class GenericConfigurationManagerImpl; template class GenericPlatformManagerImpl; template +class GenericPlatformManagerImpl_CMSISOS; +template class GenericPlatformManagerImpl_FreeRTOS; template class GenericPlatformManagerImpl_POSIX; @@ -261,6 +263,8 @@ class PlatformManager template friend class Internal::GenericPlatformManagerImpl; template + friend class Internal::GenericPlatformManagerImpl_CMSISOS; + template friend class Internal::GenericPlatformManagerImpl_FreeRTOS; template friend class Internal::GenericPlatformManagerImpl_POSIX; diff --git a/src/include/platform/ThreadStackManager.h b/src/include/platform/ThreadStackManager.h index f9f7aed04e..9498ad894c 100644 --- a/src/include/platform/ThreadStackManager.h +++ b/src/include/platform/ThreadStackManager.h @@ -55,6 +55,8 @@ class GenericPlatformManagerImpl; template class GenericConfigurationManagerImpl; template +class GenericPlatformManagerImpl_CMSISOS; +template class GenericPlatformManagerImpl_FreeRTOS; template class GenericConnectivityManagerImpl_Thread; @@ -168,6 +170,8 @@ class ThreadStackManager template friend class Internal::GenericConfigurationManagerImpl; template + friend class Internal::GenericPlatformManagerImpl_CMSISOS; + template friend class Internal::GenericPlatformManagerImpl_FreeRTOS; template friend class Internal::GenericConnectivityManagerImpl_Thread; diff --git a/src/include/platform/internal/GenericPlatformManagerImpl_CMSISOS.h b/src/include/platform/internal/GenericPlatformManagerImpl_CMSISOS.h new file mode 100644 index 0000000000..e40281527a --- /dev/null +++ b/src/include/platform/internal/GenericPlatformManagerImpl_CMSISOS.h @@ -0,0 +1,182 @@ +/* + * + * Copyright (c) 2021-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. + */ + +/** + * @file + * Provides an generic implementation of PlatformManager features + * for platform using CMSISOS 2 OS Abstraction APIs. + */ + +#pragma once + +#include +#include + +#include +#include + +namespace chip { +namespace DeviceLayer { +namespace Internal { + +/** + * Provides a generic implementation of PlatformManager features for platforms using CMSISOS 2 OS Abstraction APIs + * + * This template contains implementations of select features from the PlatformManager abstract + * interface that are suitable for use on CMSISOS-based platforms. It is intended to be inherited + * (directly or indirectly) by the PlatformManagerImpl class, which also appears as the template's + * ImplClass parameter. + */ +template +class GenericPlatformManagerImpl_CMSISOS : public GenericPlatformManagerImpl +{ + +protected: + osMutexId_t mChipStackLock = nullptr; + osMessageQueueId_t mChipEventQueue = nullptr; + osThreadId_t mEventLoopTask = nullptr; + bool mChipTimerActive; + +#if defined(CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING) && CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING + osMessageQueueId_t mBackgroundEventQueue = nullptr; + osThreadId_t mBackgroundEventLoopTask = nullptr; +#endif + + // ===== Methods that implement the PlatformManager abstract interface. + + CHIP_ERROR _InitChipStack(); + + void _LockChipStack(void); + bool _TryLockChipStack(void); + void _UnlockChipStack(void); + + CHIP_ERROR _PostEvent(const ChipDeviceEvent * event); + void _RunEventLoop(void); + CHIP_ERROR _StartEventLoopTask(void); + CHIP_ERROR _StopEventLoopTask(); + CHIP_ERROR _StartChipTimer(System::Clock::Timeout duration); + void _Shutdown(void); + +#if CHIP_STACK_LOCK_TRACKING_ENABLED + bool _IsChipStackLockedByCurrentThread() const; +#endif + + CHIP_ERROR _PostBackgroundEvent(const ChipDeviceEvent * event); + void _RunBackgroundEventLoop(void); + CHIP_ERROR _StartBackgroundEventLoopTask(void); + CHIP_ERROR _StopBackgroundEventLoopTask(); + + // ===== Methods available to the implementation subclass. + +private: + // ===== Private members for use by this class only. + + inline ImplClass * Impl() { return static_cast(this); } + + static void EventLoopTaskMain(void * pvParameter); + uint32_t SyncNextChipTimerHandling(); + uint32_t mNextTimerBaseTime = 0; + uint32_t mNextTimerDurationTicks = 0; + std::atomic mShouldRunEventLoop; + +#if defined(CHIP_CONFIG_CMSISOS_USE_STATIC_QUEUE) && CHIP_CONFIG_CMSISOS_USE_STATIC_QUEUE + uint8_t mEventQueueBuffer[CHIP_DEVICE_CONFIG_MAX_EVENT_QUEUE_SIZE * sizeof(ChipDeviceEvent)]; + osMessageQueue_t mEventQueueStruct; + const osMessageQueueAttr_t mEventQueueAttr = { .cb_mem = &mEventQueueStruct, + .cb_size = osMessageQueueCbSize, + .mq_mem = mEventQueueBuffer, + .mq_size = sizeof(mEventQueueBuffer) }; + + const osMessageQueueAttr_t * mEventQueueAttrPtr = &mEventQueueAttr; +#else + // Nothing to configure for queues, Just use this to avoid #ifdef in the class implementation + const osMessageQueueAttr_t * mEventQueueAttrPtr = nullptr; +#endif // CHIP_CONFIG_CMSISOS_USE_STATIC_QUEUE + +#if defined(CHIP_CONFIG_CMSISOS_USE_STATIC_TASK) && CHIP_CONFIG_CMSISOS_USE_STATIC_TASK + uint8_t mEventLoopStack[CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE]; + osThread_t mEventLoopTaskControlBlock; +#endif // CHIP_CONFIG_CMSISOS_USE_STATIC_TASK + + const osThreadAttr_t mEventLoopTaskAttr = { + .name = CHIP_DEVICE_CONFIG_CHIP_TASK_NAME, + .attr_bits = osThreadDetached, +#if defined(CHIP_CONFIG_CMSISOS_USE_STATIC_TASK) && CHIP_CONFIG_CMSISOS_USE_STATIC_TASK + .cb_mem = &mEventLoopTaskControlBlock, + .cb_size = osThreadCbSize, + .stack_mem = mEventLoopStack, +#endif // CHIP_CONFIG_CMSISOS_USE_STATIC_TASK + .stack_size = CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE, + .priority = CHIP_DEVICE_CONFIG_CHIP_TASK_PRIORITY + }; + +#if defined(CHIP_CONFIG_CMSISOS_USE_STATIC_MUTEX) && CHIP_CONFIG_CMSISOS_USE_STATIC_MUTEX + osMutexCbSize uint8_t mMutexControlBlock[osMutexCbSize]; +#endif // CHIP_CONFIG_CMSISOS_USE_STATIC_MUTEX + const osMutexAttr_t mChipStackMutexAttr = { + .name = "", +#if defined(CHIP_CONFIG_CMSISOS_USE_STATIC_MUTEX) && CHIP_CONFIG_CMSISOS_USE_STATIC_MUTEX + .cb_mem = &mMutexControlBlock, + .cb_size = osMutexCbSize, +#endif // CHIP_CONFIG_CMSISOS_USE_STATIC_MUTEX + .attr_bits = osMutexRecursive | osMutexPrioInherit, + }; + +#if defined(CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING) && CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING + static void BackgroundEventLoopTaskMain(void * pvParameter); + std::atomic mShouldRunBackgroundEventLoop; + +#if defined(CHIP_CONFIG_CMSISOS_USE_STATIC_QUEUE) && CHIP_CONFIG_CMSISOS_USE_STATIC_QUEUE + uint8_t mBackgroundQueueBuffer[CHIP_DEVICE_CONFIG_BG_MAX_EVENT_QUEUE_SIZE * sizeof(ChipDeviceEvent)]; + osMessageQueue_t mBackgroundQueueStruct; + const osMessageQueueAttr_t mBgQueueAttr = { .cb_mem = &mBackgroundQueueStruct, + .cb_size = osMessageQueueCbSize, + .mq_mem = mBackgroundQueueBuffer, + .mq_size = sizeof(mBackgroundQueueBuffer) }; + + const osMessageQueueAttr_t * mBgQueueAttrPtr = &mBgQueueAttr; +#else + // Nothing to configure for queues, Just use this to avoid #ifdef in the class implementation + const osMessageQueueAttr_t * mBgQueueAttrPtr = nullptr; +#endif // CHIP_CONFIG_CMSISOS_USE_STATIC_QUEUE + +#if defined(CHIP_CONFIG_CMSISOS_USE_STATIC_TASK) && CHIP_CONFIG_CMSISOS_USE_STATIC_TASK + uint8_t mBackgroundEventLoopStack[CHIP_DEVICE_CONFIG_BG_TASK_STACK_SIZE]; + osThread_t mBackgroundEventLoopTaskControlBlock; +#endif // CHIP_CONFIG_CMSISOS_USE_STATIC_TASK + + const osThreadAttr_t mBgEventLoopTaskAttr = { + .name = CHIP_DEVICE_CONFIG_BG_TASK_NAME, + .attr_bits = osThreadDetached, +#if defined(CHIP_CONFIG_CMSISOS_USE_STATIC_TASK) && CHIP_CONFIG_CMSISOS_USE_STATIC_TASK + .cb_mem = &mBackgroundEventLoopTaskControlBlock, + .cb_size = osThreadCbSize, + .stack_mem = mBackgroundEventLoopStack, +#endif // CHIP_CONFIG_CMSISOS_USE_STATIC_TASK + .stack_size = CHIP_DEVICE_CONFIG_BG_TASK_STACK_SIZE, + .priority = CHIP_DEVICE_CONFIG_BG_TASK_PRIORITY + }; +#endif // CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING +}; + +// Instruct the compiler to instantiate the template only when explicitly told to do so. +extern template class GenericPlatformManagerImpl_CMSISOS; + +} // namespace Internal +} // namespace DeviceLayer +} // namespace chip diff --git a/src/include/platform/internal/GenericPlatformManagerImpl_CMSISOS.ipp b/src/include/platform/internal/GenericPlatformManagerImpl_CMSISOS.ipp new file mode 100644 index 0000000000..b75fcbe0c2 --- /dev/null +++ b/src/include/platform/internal/GenericPlatformManagerImpl_CMSISOS.ipp @@ -0,0 +1,375 @@ +/* + * + * Copyright (c) 2021-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. + */ + +/** + * @file + * Contains non-inline method definitions for the + * GenericPlatformManagerImpl_CMSISOS<> template. + */ + +#ifndef GENERIC_PLATFORM_MANAGER_IMPL_CMSISOS_CPP +#define GENERIC_PLATFORM_MANAGER_IMPL_CMSISOS_CPP + +#include +#include +#include + +#include + +// Include the non-inline definitions for the GenericPlatformManagerImpl<> template, +// from which the GenericPlatformManagerImpl_CMSISOS<> template inherits. +#include + +namespace chip { +namespace DeviceLayer { +namespace Internal { + +template +CHIP_ERROR GenericPlatformManagerImpl_CMSISOS::_InitChipStack(void) +{ + mNextTimerBaseTime = osKernelGetTickCount(); + mNextTimerDurationTicks = 0; + mChipTimerActive = false; + + // We support calling Shutdown followed by InitChipStack, because some tests + // do that. To keep things simple for existing consumers, we do not + // destroy our lock and queue at shutdown, but rather check whether they + // already exist here before trying to create them. + if (mChipStackLock == nullptr) + { + mChipStackLock = osMutexNew(&mChipStackMutexAttr); + VerifyOrReturnError(mChipStackLock != nullptr, CHIP_ERROR_NO_MEMORY, + ChipLogError(DeviceLayer, "Failed to create CHIP stack lock")); + } + + if (mChipEventQueue == nullptr) + { + mChipEventQueue = osMessageQueueNew(CHIP_DEVICE_CONFIG_MAX_EVENT_QUEUE_SIZE, sizeof(ChipDeviceEvent), mEventQueueAttrPtr); + VerifyOrReturnError(mChipEventQueue != nullptr, CHIP_ERROR_NO_MEMORY, + ChipLogError(DeviceLayer, "Failed to allocate CHIP main event queue")); + } + else + { + // Clear out any events that might be stuck in the queue, so we start + // with a clean slate, as if we had just re-created the queue. + osMessageQueueReset(mChipEventQueue); + } + + mShouldRunEventLoop.store(false); + +#if defined(CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING) && CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING + if (mBackgroundEventQueue == nullptr) + { + mBackgroundEventQueue = + osMessageQueueNew(CHIP_DEVICE_CONFIG_BG_MAX_EVENT_QUEUE_SIZE, sizeof(ChipDeviceEvent), mBgQueueAttrPtr); + VerifyOrReturnError(mBackgroundEventQueue != nullptr, CHIP_ERROR_NO_MEMORY, + ChipLogError(DeviceLayer, "Failed to allocate CHIP background event queue")); + } + else + { + osMessageQueueReset(mBackgroundEventQueue); + } + + mShouldRunBackgroundEventLoop.store(false); +#endif + + // Call up to the base class _InitChipStack() to perform the bulk of the initialization. + return GenericPlatformManagerImpl::_InitChipStack(); +} + +template +void GenericPlatformManagerImpl_CMSISOS::_LockChipStack(void) +{ + osMutexAcquire(mChipStackLock, osWaitForever); +} + +template +bool GenericPlatformManagerImpl_CMSISOS::_TryLockChipStack(void) +{ + return osMutexAcquire(mChipStackLock, 0) == osOK; +} + +template +void GenericPlatformManagerImpl_CMSISOS::_UnlockChipStack(void) +{ + osMutexRelease(mChipStackLock); +} + +#if CHIP_STACK_LOCK_TRACKING_ENABLED +template +bool GenericPlatformManagerImpl_CMSISOS::_IsChipStackLockedByCurrentThread() const +{ + // If we have not started our event loop yet, return true because in that + // case we can't be racing against the (not yet started) event loop. + // + // Similarly, if mChipStackLock has not been created yet, might as well + // return true. + return (mEventLoopTask == nullptr) || (mChipStackLock == nullptr) || (osMutexGetOwner(mChipStackLock) == osThreadGetId()); +} +#endif // CHIP_STACK_LOCK_TRACKING_ENABLED + +template +CHIP_ERROR GenericPlatformManagerImpl_CMSISOS::_PostEvent(const ChipDeviceEvent * event) +{ + VerifyOrReturnError(mChipEventQueue != nullptr, CHIP_ERROR_UNINITIALIZED); + + osStatus_t status = osMessageQueuePut(mChipEventQueue, event, osPriorityNormal, 1); + if (status != osOK) + { + ChipLogError(DeviceLayer, "Failed to post event to CHIP Platform event queue"); + return CHIP_ERROR(chip::ChipError::Range::kOS, status); + } + return CHIP_NO_ERROR; +} + +template +void GenericPlatformManagerImpl_CMSISOS::_RunEventLoop(void) +{ + // Lock the CHIP stack. + StackLock lock; + + bool oldShouldRunEventLoop = false; + if (!mShouldRunEventLoop.compare_exchange_strong(oldShouldRunEventLoop /* expected */, true /* desired */)) + { + ChipLogError(DeviceLayer, "Error trying to run the event loop while it is already running"); + return; + } + + while (mShouldRunEventLoop.load()) + { + uint32_t waitTimeInTicks; + + // If one or more CHIP timers are active... + if (mChipTimerActive) + { + // Adjust the base time and remaining duration for the next scheduled timer based on the + // amount of time that has elapsed since it was started. + // When the timer's expiration time elapses, Handle the platform Timer + // else wait for a queue event for timer remaining time. + waitTimeInTicks = SyncNextChipTimerHandling(); + if (waitTimeInTicks == 0) + { + // Reset the 'timer active' flag. This will be set to true again by _StartChipTimer() + // if there are further timers beyond the expired one that are still active. + mChipTimerActive = false; + + // Call into the system layer to dispatch the callback functions for all timers + // that have expired. + // TODO We use the same SystemLayer implementation as FreeRTOS, Nothing in it is freeRTOS specific. We should + // it. + CHIP_ERROR err = static_cast(DeviceLayer::SystemLayer()).HandlePlatformTimer(); + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "Error handling CHIP timers: %" CHIP_ERROR_FORMAT, err.Format()); + } + } + } + else + { + // No CHIP timers are active, so we wait indefinitely for an event to arrive on the event + // queue. + waitTimeInTicks = osWaitForever; + } + + // Unlock the CHIP stack, allowing other threads to enter CHIP while + // the event loop thread is sleeping. + StackUnlock unlock; + ChipDeviceEvent event; + osStatus_t eventReceived = osMessageQueueGet(mChipEventQueue, &event, nullptr, waitTimeInTicks); + + // If an event was received, dispatch it and continue until the queue is empty. + while (eventReceived == osOK) + { + StackLock lock; + Impl()->DispatchEvent(&event); + StackUnlock unlock; + eventReceived = osMessageQueueGet(mChipEventQueue, &event, nullptr, 0); + } + } +} + +template +CHIP_ERROR GenericPlatformManagerImpl_CMSISOS::_StartEventLoopTask(void) +{ + mEventLoopTask = osThreadNew(EventLoopTaskMain, this, &mEventLoopTaskAttr); + return (mEventLoopTask != nullptr) ? CHIP_NO_ERROR : CHIP_ERROR_NO_MEMORY; +} + +template +void GenericPlatformManagerImpl_CMSISOS::EventLoopTaskMain(void * pvParameter) +{ + ChipLogDetail(DeviceLayer, "CHIP event task running"); + static_cast *>(pvParameter)->Impl()->RunEventLoop(); +} + +/** + * @brief Calculate the elapsed time of the active chip platform timer since it has been started, + * as set in mNextTimerBaseTime, and adjust its remaining time with the mNextTimerDurationTicks member + * + * @return The next Timer remaining time in ticks + */ +template +uint32_t GenericPlatformManagerImpl_CMSISOS::SyncNextChipTimerHandling() +{ + uint32_t elapsedTime = 0; + uint32_t timerBaseTime = mNextTimerBaseTime; + uint32_t currentTime = osKernelGetTickCount(); + if (currentTime < timerBaseTime) + { + // TickCount has wrapped around + elapsedTime = (UINT32_MAX - timerBaseTime) + currentTime; + } + else + { + elapsedTime = currentTime - timerBaseTime; + } + + if (elapsedTime < mNextTimerDurationTicks) + { + // We didn't timeout yet, adjust the remaining time + mNextTimerDurationTicks -= elapsedTime; + mNextTimerBaseTime = osKernelGetTickCount(); + } + else + { + mNextTimerDurationTicks = 0; + } + return mNextTimerDurationTicks; +} + +template +CHIP_ERROR GenericPlatformManagerImpl_CMSISOS::_PostBackgroundEvent(const ChipDeviceEvent * event) +{ +#if defined(CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING) && CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING + VerifyOrReturnError(mBackgroundEventQueue != nullptr, CHIP_ERROR_UNINITIALIZED); + if (!(event->Type == DeviceEventType::kCallWorkFunct || event->Type == DeviceEventType::kNoOp)) + { + return CHIP_ERROR_INVALID_ARGUMENT; + } + + osStatus_t status = osMessageQueuePut(mBackgroundEventQueue, event, osPriorityNormal, 1); + VerifyOrReturnError(status == osOk, CHIP_ERROR_NO_MEMORY, + ChipLogError(DeviceLayer, "Failed to post event to CHIP background event queue")); + return CHIP_NO_ERROR; +#else + // Use foreground event loop for background events + return _PostEvent(event); +#endif +} + +template +void GenericPlatformManagerImpl_CMSISOS::_RunBackgroundEventLoop(void) +{ +#if defined(CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING) && CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING + bool oldShouldRunBackgroundEventLoop = false; + VerifyOrReturn( + mShouldRunBackgroundEventLoop.compare_exchange_strong(oldShouldRunBackgroundEventLoop /* expected */, true /* desired */), + ChipLogError(DeviceLayer, "Error trying to run the background event loop while it is already running")); + + while (mShouldRunBackgroundEventLoop.load()) + { + ChipDeviceEvent event; + osStatus_t eventReceived = osMessageQueueGet(mBackgroundEventQueue, &event, NULL, osWaitForever); + while (eventReceived == osOK) + { + Impl()->DispatchEvent(&event); + eventReceived = osMessageQueueGet(mBackgroundEventQueue, &event, portMAX_DELAY); + } + } +#endif +} + +template +CHIP_ERROR GenericPlatformManagerImpl_CMSISOS::_StartBackgroundEventLoopTask(void) +{ +#if defined(CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING) && CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING + mBackgroundEventLoopTask = osThreadNew(BackgroundEventLoopTaskMain, this, &mBgEventLoopTaskAttr); + return (mBackgroundEventLoopTask != NULL) ? CHIP_NO_ERROR : CHIP_ERROR_NO_MEMORY; +#else + // Use foreground event loop for background events + return CHIP_NO_ERROR; +#endif +} + +template +CHIP_ERROR GenericPlatformManagerImpl_CMSISOS::_StopBackgroundEventLoopTask(void) +{ +#if defined(CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING) && CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING + bool oldShouldRunBackgroundEventLoop = true; + if (mShouldRunBackgroundEventLoop.compare_exchange_strong(oldShouldRunBackgroundEventLoop /* expected */, false /* desired */)) + { + ChipDeviceEvent noop{ .Type = DeviceEventType::kNoOp }; + osMessageQueuePut(mBackgroundEventQueue, &noop, osPriorityNormal, 0); + } + return CHIP_NO_ERROR; +#else + // Use foreground event loop for background events + return CHIP_NO_ERROR; +#endif +} + +#if defined(CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING) && CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING +template +void GenericPlatformManagerImpl_CMSISOS::BackgroundEventLoopTaskMain(void * pvParameter) +{ + ChipLogDetail(DeviceLayer, "CHIP background task running"); + static_cast *>(pvParameter)->Impl()->RunBackgroundEventLoop(); +} +#endif + +template +CHIP_ERROR GenericPlatformManagerImpl_CMSISOS::_StartChipTimer(System::Clock::Timeout delay) +{ + mChipTimerActive = true; + mNextTimerBaseTime = osKernelGetTickCount(); + mNextTimerDurationTicks = (System::Clock::Milliseconds64(delay).count() * osKernelGetTickFreq()) / 1000; + + // If the platform timer is being updated by a thread other than the event loop thread, + // trigger the event loop thread to recalculate its wait time by posting a no-op event + // to the event queue. + if (osThreadGetId() != mEventLoopTask) + { + ChipDeviceEvent noop{ .Type = DeviceEventType::kNoOp }; + ReturnErrorOnFailure(Impl()->PostEvent(&noop)); + } + + return CHIP_NO_ERROR; +} + +template +void GenericPlatformManagerImpl_CMSISOS::_Shutdown(void) +{ + GenericPlatformManagerImpl::_Shutdown(); +} + +template +CHIP_ERROR GenericPlatformManagerImpl_CMSISOS::_StopEventLoopTask(void) +{ + mShouldRunEventLoop.store(false); + return CHIP_NO_ERROR; +} + +// Fully instantiate the generic implementation class in whatever compilation unit includes this file. +// NB: This must come after all templated class members are defined. +template class GenericPlatformManagerImpl_CMSISOS; + +} // namespace Internal +} // namespace DeviceLayer +} // namespace chip + +#endif // GENERIC_PLATFORM_MANAGER_IMPL_CMSISOS_CPP diff --git a/src/platform/BUILD.gn b/src/platform/BUILD.gn index d379bd0e1f..7f0b7ff87a 100644 --- a/src/platform/BUILD.gn +++ b/src/platform/BUILD.gn @@ -496,6 +496,8 @@ if (chip_device_platform != "none") { "../include/platform/internal/GenericDeviceInstanceInfoProvider.ipp", "../include/platform/internal/GenericPlatformManagerImpl.h", "../include/platform/internal/GenericPlatformManagerImpl.ipp", + "../include/platform/internal/GenericPlatformManagerImpl_CMSISOS.h", + "../include/platform/internal/GenericPlatformManagerImpl_CMSISOS.ipp", "../include/platform/internal/GenericPlatformManagerImpl_FreeRTOS.h", "../include/platform/internal/GenericPlatformManagerImpl_FreeRTOS.ipp", "../include/platform/internal/GenericPlatformManagerImpl_POSIX.h", diff --git a/src/platform/FreeRTOS/SystemTimeSupport.cpp b/src/platform/FreeRTOS/SystemTimeSupport.cpp index a14c0527b4..12fa8e636d 100644 --- a/src/platform/FreeRTOS/SystemTimeSupport.cpp +++ b/src/platform/FreeRTOS/SystemTimeSupport.cpp @@ -28,6 +28,7 @@ #include #include "FreeRTOS.h" +#include "task.h" namespace chip { namespace System { diff --git a/src/platform/silabs/CHIPDevicePlatformConfig.h b/src/platform/silabs/CHIPDevicePlatformConfig.h index d8c58a9368..7e86c64694 100644 --- a/src/platform/silabs/CHIPDevicePlatformConfig.h +++ b/src/platform/silabs/CHIPDevicePlatformConfig.h @@ -23,6 +23,8 @@ */ #pragma once +#include +#include // ==================== Platform Adaptations ==================== @@ -129,6 +131,10 @@ // ========== Platform-specific Configuration Overrides ========= +#ifndef CHIP_DEVICE_CONFIG_CHIP_TASK_PRIORITY +#define CHIP_DEVICE_CONFIG_CHIP_TASK_PRIORITY osPriorityHigh +#endif + #ifndef CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE #if SLI_SI91X_MCU_INTERFACE #define CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE (7 * 1024) diff --git a/src/platform/silabs/CHIPPlatformConfig.h b/src/platform/silabs/CHIPPlatformConfig.h index c6c855ee9c..c72c7fa20c 100644 --- a/src/platform/silabs/CHIPPlatformConfig.h +++ b/src/platform/silabs/CHIPPlatformConfig.h @@ -129,13 +129,13 @@ #define CHIP_SHELL_MAX_LINE_SIZE 256 #endif // CHIP_SHELL_MAX_LINE_SIZE -// ==================== FreeRTOS Configuration Overrides ==================== -#ifndef CHIP_CONFIG_FREERTOS_USE_STATIC_TASK -#define CHIP_CONFIG_FREERTOS_USE_STATIC_TASK 1 +// ==================== CMSISOS Configuration Overrides ==================== +#ifndef CHIP_CONFIG_CMSISOS_USE_STATIC_TASK +#define CHIP_CONFIG_CMSISOS_USE_STATIC_TASK 1 #endif -#ifndef CHIP_CONFIG_FREERTOS_USE_STATIC_QUEUE -#define CHIP_CONFIG_FREERTOS_USE_STATIC_QUEUE 1 +#ifndef CHIP_CONFIG_CMSISOS_USE_STATIC_QUEUE +#define CHIP_CONFIG_CMSISOS_USE_STATIC_QUEUE 1 #endif #ifndef CHIP_SHELL_MAX_TOKENS diff --git a/src/platform/silabs/ConfigurationManagerImpl.cpp b/src/platform/silabs/ConfigurationManagerImpl.cpp index 122799952a..b4dd5c9c52 100644 --- a/src/platform/silabs/ConfigurationManagerImpl.cpp +++ b/src/platform/silabs/ConfigurationManagerImpl.cpp @@ -22,6 +22,7 @@ * for Silabs platforms using the Silicon Labs SDK. */ /* this file behaves like a config.h, comes first */ +#include #include #include #include @@ -304,7 +305,7 @@ void ConfigurationManagerImpl::DoFactoryReset(intptr_t arg) // When called from an RPC, the following reset occurs before the RPC can respond, // which breaks tests (because it looks like the RPC hasn't successfully completed). // Block the task for 500 ms before the reset occurs to allow RPC response to be sent - vTaskDelay(pdMS_TO_TICKS(500)); + osDelay(pdMS_TO_TICKS(500)); NVIC_SystemReset(); } diff --git a/src/platform/silabs/Logging.cpp b/src/platform/silabs/Logging.cpp index 339bc8ae07..dea8913791 100644 --- a/src/platform/silabs/Logging.cpp +++ b/src/platform/silabs/Logging.cpp @@ -293,13 +293,6 @@ extern "C" void LwIPLog(const char * aFormat, ...) } PrintLog(formattedMsg); - -#if configCHECK_FOR_STACK_OVERFLOW - // Force a stack overflow check. - if (xTaskGetSchedulerState() != taskSCHEDULER_NOT_STARTED) - taskYIELD(); -#endif - // Let the application know that a log message has been emitted. chip::DeviceLayer::OnLogOutput(); #endif // SILABS_LOG_ENABLED @@ -348,12 +341,6 @@ extern "C" void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const ch } PrintLog(formattedMsg); - -#if configCHECK_FOR_STACK_OVERFLOW - // Force a stack overflow check. - if (xTaskGetSchedulerState() != taskSCHEDULER_NOT_STARTED) - taskYIELD(); -#endif } // Let the application know that a log message has been emitted. diff --git a/src/platform/silabs/PlatformManagerImpl.cpp b/src/platform/silabs/PlatformManagerImpl.cpp index 14dd4f78f2..dccb5db765 100644 --- a/src/platform/silabs/PlatformManagerImpl.cpp +++ b/src/platform/silabs/PlatformManagerImpl.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #if defined(SL_MBEDTLS_USE_TINYCRYPT) @@ -104,7 +104,7 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack(void) // Call _InitChipStack() on the generic implementation base class // to finish the initialization process. - err = Internal::GenericPlatformManagerImpl_FreeRTOS::_InitChipStack(); + err = Internal::GenericPlatformManagerImpl_CMSISOS::_InitChipStack(); SuccessOrExit(err); // Start timer to increment TotalOperationalHours every hour @@ -129,9 +129,10 @@ void PlatformManagerImpl::UpdateOperationalHours(System::Layer * systemLayer, vo SystemLayer().StartTimer(System::Clock::Seconds32(kSecondsPerHour), UpdateOperationalHours, NULL); } + void PlatformManagerImpl::_Shutdown() { - Internal::GenericPlatformManagerImpl_FreeRTOS::_Shutdown(); + Internal::GenericPlatformManagerImpl_CMSISOS::_Shutdown(); } #if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION diff --git a/src/platform/silabs/PlatformManagerImpl.h b/src/platform/silabs/PlatformManagerImpl.h index 25813afb48..1abbb9f07f 100644 --- a/src/platform/silabs/PlatformManagerImpl.h +++ b/src/platform/silabs/PlatformManagerImpl.h @@ -24,7 +24,7 @@ #pragma once -#include +#include #if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION #include "wfx_host_events.h" #endif @@ -36,7 +36,7 @@ namespace DeviceLayer { /** * Concrete implementation of the PlatformManager singleton object for the SILABS platform. */ -class PlatformManagerImpl final : public PlatformManager, public Internal::GenericPlatformManagerImpl_FreeRTOS +class PlatformManagerImpl final : public PlatformManager, public Internal::GenericPlatformManagerImpl_CMSISOS { // Allow the PlatformManager interface class to delegate method calls to // the implementation methods provided by this class. @@ -57,7 +57,7 @@ class PlatformManagerImpl final : public PlatformManager, public Internal::Gener // Allow the generic implementation base class to call helper methods on // this class. #ifndef DOXYGEN_SHOULD_SKIP_THIS - friend Internal::GenericPlatformManagerImpl_FreeRTOS; + friend Internal::GenericPlatformManagerImpl_CMSISOS; #endif public: @@ -87,8 +87,6 @@ class PlatformManagerImpl final : public PlatformManager, public Internal::Gener System::Clock::Timestamp mStartTime = System::Clock::kZero; static PlatformManagerImpl sInstance; - - using Internal::GenericPlatformManagerImpl_FreeRTOS::PostEventFromISR; }; /** From f2b8a876d2af2f834354b800e5e5d582e10be8c1 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Wed, 9 Oct 2024 18:09:58 -0400 Subject: [PATCH 064/127] Use DataModel::Provider provided command information to handle command validation (#35897) * A first pass to implement better invoke logic decoupling * Fix some includes * Fix some includes * More include fixes * Fix dependency to make things build * Fixed tests * Fix includes * Restyle * Fix naming typo * Fix tizen build * Fix condition typo * Keep group command logic to use continue instead of status return ... there is no status to return * Minor update to kick restyler * one more decoupling update: sligtly more inefficient, however likely this is not important * Renamed based on code review feedback * Restyled by clang-format * Fix some code review comments * Review comment: default privilege to operate * Fix up renames * Fix hex prefix * Restyled by clang-format * Fix cirque after log formatting change. Load bearing log .... * Revert file change that I did not mean to change * Update src/app/CommandHandlerImpl.cpp Co-authored-by: Boris Zbarsky * Remove separate member for accessing fabric index * Restyled by clang-format --------- Co-authored-by: Andrei Litvin Co-authored-by: Restyled.io Co-authored-by: Boris Zbarsky --- .../lighting-app/tizen/src/DBusInterface.cpp | 9 +- src/app/BUILD.gn | 1 + src/app/CommandHandlerImpl.cpp | 87 +++++------------ src/app/CommandHandlerImpl.h | 27 ++++-- src/app/CommandResponseSender.cpp | 6 +- src/app/CommandResponseSender.h | 2 +- src/app/InteractionModelEngine.cpp | 94 ++++++++++++++++++- src/app/InteractionModelEngine.h | 7 +- src/app/data-model-provider/OperationTypes.h | 10 ++ src/app/tests/TestCommandInteraction.cpp | 18 +++- .../linux-cirque/MobileDeviceTest.py | 2 +- 11 files changed, 176 insertions(+), 87 deletions(-) diff --git a/examples/lighting-app/tizen/src/DBusInterface.cpp b/examples/lighting-app/tizen/src/DBusInterface.cpp index 36c0f19c35..5484c7daff 100644 --- a/examples/lighting-app/tizen/src/DBusInterface.cpp +++ b/examples/lighting-app/tizen/src/DBusInterface.cpp @@ -42,9 +42,12 @@ class CommandHandlerImplCallback : public CommandHandlerImpl::Callback { public: using Status = Protocols::InteractionModel::Status; - void OnDone(CommandHandlerImpl & apCommandObj) {} - void DispatchCommand(CommandHandlerImpl & apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & apPayload) {} - Status CommandExists(const ConcreteCommandPath & aCommandPath) { return Status::Success; } + + void OnDone(CommandHandlerImpl & apCommandObj) override {} + void DispatchCommand(CommandHandlerImpl & apCommandObj, const ConcreteCommandPath & aCommandPath, + TLV::TLVReader & apPayload) override + {} + Status ValidateCommandCanBeDispatched(const DataModel::InvokeRequest & request) override { return Status::Success; } }; DBusInterface::DBusInterface(chip::EndpointId endpointId) : mEndpointId(endpointId) diff --git a/src/app/BUILD.gn b/src/app/BUILD.gn index 98e7225549..f3565cf5d9 100644 --- a/src/app/BUILD.gn +++ b/src/app/BUILD.gn @@ -417,6 +417,7 @@ source_set("command-handler-impl") { "${chip_root}/src/access:types", "${chip_root}/src/app/MessageDef", "${chip_root}/src/app/data-model", + "${chip_root}/src/app/data-model-provider", "${chip_root}/src/app/util:callbacks", "${chip_root}/src/lib/support", "${chip_root}/src/messaging", diff --git a/src/app/CommandHandlerImpl.cpp b/src/app/CommandHandlerImpl.cpp index 366199a3b9..2142af6349 100644 --- a/src/app/CommandHandlerImpl.cpp +++ b/src/app/CommandHandlerImpl.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -390,55 +391,16 @@ Status CommandHandlerImpl::ProcessCommandDataIB(CommandDataIB::Parser & aCommand VerifyOrReturnError(err == CHIP_NO_ERROR, Status::InvalidAction); { - Status commandExists = mpCallback->CommandExists(concretePath); - if (commandExists != Status::Success) - { - ChipLogDetail(DataManagement, "No command " ChipLogFormatMEI " in Cluster " ChipLogFormatMEI " on Endpoint 0x%x", - ChipLogValueMEI(concretePath.mCommandId), ChipLogValueMEI(concretePath.mClusterId), - concretePath.mEndpointId); - return FallibleAddStatus(concretePath, commandExists) != CHIP_NO_ERROR ? Status::Failure : Status::Success; - } - } - - { - Access::SubjectDescriptor subjectDescriptor = GetSubjectDescriptor(); - Access::RequestPath requestPath{ .cluster = concretePath.mClusterId, - .endpoint = concretePath.mEndpointId, - .requestType = Access::RequestType::kCommandInvokeRequest, - .entityId = concretePath.mCommandId }; - Access::Privilege requestPrivilege = RequiredPrivilege::ForInvokeCommand(concretePath); - err = Access::GetAccessControl().Check(subjectDescriptor, requestPath, requestPrivilege); - if (err != CHIP_NO_ERROR) - { - if ((err != CHIP_ERROR_ACCESS_DENIED) && (err != CHIP_ERROR_ACCESS_RESTRICTED_BY_ARL)) - { - return FallibleAddStatus(concretePath, Status::Failure) != CHIP_NO_ERROR ? Status::Failure : Status::Success; - } - // TODO: when wildcard invokes are supported, handle them to discard rather than fail with status - Status status = err == CHIP_ERROR_ACCESS_DENIED ? Status::UnsupportedAccess : Status::AccessRestricted; - return FallibleAddStatus(concretePath, status) != CHIP_NO_ERROR ? Status::Failure : Status::Success; - } - } + DataModel::InvokeRequest request; - if (CommandNeedsTimedInvoke(concretePath.mClusterId, concretePath.mCommandId) && !IsTimedInvoke()) - { - // TODO: when wildcard invokes are supported, discard a - // wildcard-expanded path instead of returning a status. - return FallibleAddStatus(concretePath, Status::NeedsTimedInteraction) != CHIP_NO_ERROR ? Status::Failure : Status::Success; - } - - if (CommandIsFabricScoped(concretePath.mClusterId, concretePath.mCommandId)) - { - // SPEC: Else if the command in the path is fabric-scoped and there is no accessing fabric, - // a CommandStatusIB SHALL be generated with the UNSUPPORTED_ACCESS Status Code. + request.path = concretePath; + request.subjectDescriptor = GetSubjectDescriptor(); + request.invokeFlags.Set(DataModel::InvokeFlags::kTimed, IsTimedInvoke()); - // Fabric-scoped commands are not allowed before a specific accessing fabric is available. - // This is mostly just during a PASE session before AddNOC. - if (GetAccessingFabricIndex() == kUndefinedFabricIndex) + Status preCheckStatus = mpCallback->ValidateCommandCanBeDispatched(request); + if (preCheckStatus != Status::Success) { - // TODO: when wildcard invokes are supported, discard a - // wildcard-expanded path instead of returning a status. - return FallibleAddStatus(concretePath, Status::UnsupportedAccess) != CHIP_NO_ERROR ? Status::Failure : Status::Success; + return FallibleAddStatus(concretePath, preCheckStatus) != CHIP_NO_ERROR ? Status::Failure : Status::Success; } } @@ -516,11 +478,19 @@ Status CommandHandlerImpl::ProcessGroupCommandDataIB(CommandDataIB::Parser & aCo // once up front and discard all the paths at once. Ordering with respect // to ACL and command presence checks does not matter, because the behavior // is the same for all of them: ignore the path. +#if !CHIP_CONFIG_USE_DATA_MODEL_INTERFACE + + // Without data model interface, we can query individual commands. + // Data model interface queries commands by a full path so we need endpointID as well. + // + // Since this is a performance update and group commands are never timed, + // missing this should not be that noticeable. if (CommandNeedsTimedInvoke(clusterId, commandId)) { // Group commands are never timed. return Status::Success; } +#endif // No check for `CommandIsFabricScoped` unlike in `ProcessCommandDataIB()` since group commands // always have an accessing fabric, by definition. @@ -542,30 +512,21 @@ Status CommandHandlerImpl::ProcessGroupCommandDataIB(CommandDataIB::Parser & aCo const ConcreteCommandPath concretePath(mapping.endpoint_id, clusterId, commandId); - if (mpCallback->CommandExists(concretePath) != Status::Success) { - ChipLogDetail(DataManagement, "No command " ChipLogFormatMEI " in Cluster " ChipLogFormatMEI " on Endpoint 0x%x", - ChipLogValueMEI(commandId), ChipLogValueMEI(clusterId), mapping.endpoint_id); + DataModel::InvokeRequest request; - continue; - } + request.path = concretePath; + request.subjectDescriptor = GetSubjectDescriptor(); + request.invokeFlags.Set(DataModel::InvokeFlags::kTimed, IsTimedInvoke()); - { - Access::SubjectDescriptor subjectDescriptor = GetSubjectDescriptor(); - Access::RequestPath requestPath{ .cluster = concretePath.mClusterId, - .endpoint = concretePath.mEndpointId, - .requestType = Access::RequestType::kCommandInvokeRequest, - .entityId = concretePath.mCommandId }; - Access::Privilege requestPrivilege = RequiredPrivilege::ForInvokeCommand(concretePath); - err = Access::GetAccessControl().Check(subjectDescriptor, requestPath, requestPrivilege); - if (err != CHIP_NO_ERROR) + Status preCheckStatus = mpCallback->ValidateCommandCanBeDispatched(request); + if (preCheckStatus != Status::Success) { - // NOTE: an expected error is CHIP_ERROR_ACCESS_DENIED, but there could be other unexpected errors; - // therefore, keep processing subsequent commands, and if any errors continue, those subsequent - // commands will likewise fail. + // Command failed for a specific path, but keep trying the rest of the paths. continue; } } + if ((err = DataModelCallbacks::GetInstance()->PreCommandReceived(concretePath, GetSubjectDescriptor())) == CHIP_NO_ERROR) { TLV::TLVReader dataReader(commandDataReader); diff --git a/src/app/CommandHandlerImpl.h b/src/app/CommandHandlerImpl.h index ddd499658e..2603b96f22 100644 --- a/src/app/CommandHandlerImpl.h +++ b/src/app/CommandHandlerImpl.h @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -50,21 +51,29 @@ class CommandHandlerImpl : public CommandHandler */ virtual void OnDone(CommandHandlerImpl & apCommandObj) = 0; + /** + * Perform pre-validation that the command dispatch can be performed. In particular: + * - check command existence/validity + * - validate ACL + * - validate timed-invoke and fabric-scoped requirements + * + * Returns Status::Success if the command can be dispatched, otherwise it will + * return the status to be forwarded to the client on failure. + * + * Possible error return codes: + * - UnsupportedEndpoint/UnsupportedCluster/UnsupportedCommand if the command path is invalid + * - NeedsTimedInteraction + * - UnsupportedAccess (ACL failure or fabric scoped without a valid fabric index) + * - AccessRestricted + */ + virtual Protocols::InteractionModel::Status ValidateCommandCanBeDispatched(const DataModel::InvokeRequest & request) = 0; + /* * Upon processing of a CommandDataIB, this method is invoked to dispatch the command * to the right server-side handler provided by the application. */ virtual void DispatchCommand(CommandHandlerImpl & apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & apPayload) = 0; - - /* - * Check to see if a command implementation exists for a specific - * concrete command path. If it does, Success will be returned. If - * not, one of UnsupportedEndpoint, UnsupportedCluster, or - * UnsupportedCommand will be returned, depending on how the command - * fails to exist. - */ - virtual Protocols::InteractionModel::Status CommandExists(const ConcreteCommandPath & aCommandPath) = 0; }; struct InvokeResponseParameters diff --git a/src/app/CommandResponseSender.cpp b/src/app/CommandResponseSender.cpp index f23786e28d..0b028510c0 100644 --- a/src/app/CommandResponseSender.cpp +++ b/src/app/CommandResponseSender.cpp @@ -132,10 +132,10 @@ void CommandResponseSender::DispatchCommand(CommandHandlerImpl & apCommandObj, c mpCommandHandlerCallback->DispatchCommand(apCommandObj, aCommandPath, apPayload); } -Status CommandResponseSender::CommandExists(const ConcreteCommandPath & aCommandPath) +Protocols::InteractionModel::Status CommandResponseSender::ValidateCommandCanBeDispatched(const DataModel::InvokeRequest & request) { - VerifyOrReturnValue(mpCommandHandlerCallback, Protocols::InteractionModel::Status::UnsupportedCommand); - return mpCommandHandlerCallback->CommandExists(aCommandPath); + VerifyOrReturnValue(mpCommandHandlerCallback, Protocols::InteractionModel::Status::Failure); + return mpCommandHandlerCallback->ValidateCommandCanBeDispatched(request); } CHIP_ERROR CommandResponseSender::SendCommandResponse() diff --git a/src/app/CommandResponseSender.h b/src/app/CommandResponseSender.h index 0e03a87f1e..f0b8f11d40 100644 --- a/src/app/CommandResponseSender.h +++ b/src/app/CommandResponseSender.h @@ -64,7 +64,7 @@ class CommandResponseSender : public Messaging::ExchangeDelegate, void DispatchCommand(CommandHandlerImpl & apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & apPayload) override; - Protocols::InteractionModel::Status CommandExists(const ConcreteCommandPath & aCommandPath) override; + Protocols::InteractionModel::Status ValidateCommandCanBeDispatched(const DataModel::InvokeRequest & request) override; /** * Gets the inner exchange context object, without ownership. diff --git a/src/app/InteractionModelEngine.cpp b/src/app/InteractionModelEngine.cpp index 59888feaf9..5f0e392c26 100644 --- a/src/app/InteractionModelEngine.cpp +++ b/src/app/InteractionModelEngine.cpp @@ -32,6 +32,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -42,10 +45,9 @@ #include #include #include +#include #if CHIP_CONFIG_USE_DATA_MODEL_INTERFACE -#include - // TODO: defaulting to codegen should eventually be an application choice and not // hard-coded in the interaction model #include @@ -1652,6 +1654,8 @@ void InteractionModelEngine::DispatchCommand(CommandHandlerImpl & apCommandObj, DataModel::InvokeRequest request; request.path = aCommandPath; + request.invokeFlags.Set(DataModel::InvokeFlags::kTimed, apCommandObj.IsTimedInvoke()); + request.subjectDescriptor = apCommandObj.GetSubjectDescriptor(); std::optional status = GetDataModelProvider()->Invoke(request, apPayload, &apCommandObj); @@ -1684,7 +1688,91 @@ void InteractionModelEngine::DispatchCommand(CommandHandlerImpl & apCommandObj, #endif // CHIP_CONFIG_USE_DATA_MODEL_INTERFACE } -Protocols::InteractionModel::Status InteractionModelEngine::CommandExists(const ConcreteCommandPath & aCommandPath) +Protocols::InteractionModel::Status InteractionModelEngine::ValidateCommandCanBeDispatched(const DataModel::InvokeRequest & request) +{ + + Status status = CheckCommandExistence(request.path); + + if (status != Status::Success) + { + ChipLogDetail(DataManagement, "No command " ChipLogFormatMEI " in Cluster " ChipLogFormatMEI " on Endpoint %u", + ChipLogValueMEI(request.path.mCommandId), ChipLogValueMEI(request.path.mClusterId), request.path.mEndpointId); + return status; + } + + status = CheckCommandAccess(request); + VerifyOrReturnValue(status == Status::Success, status); + + return CheckCommandFlags(request); +} + +Protocols::InteractionModel::Status InteractionModelEngine::CheckCommandAccess(const DataModel::InvokeRequest & aRequest) +{ + if (!aRequest.subjectDescriptor.has_value()) + { + return Status::UnsupportedAccess; // we require a subject for invoke + } + + Access::RequestPath requestPath{ .cluster = aRequest.path.mClusterId, + .endpoint = aRequest.path.mEndpointId, + .requestType = Access::RequestType::kCommandInvokeRequest, + .entityId = aRequest.path.mCommandId }; +#if CHIP_CONFIG_USE_DATA_MODEL_INTERFACE + std::optional commandInfo = mDataModelProvider->GetAcceptedCommandInfo(aRequest.path); + Access::Privilege minimumRequiredPrivilege = + commandInfo.has_value() ? commandInfo->invokePrivilege : Access::Privilege::kOperate; +#else + Access::Privilege minimumRequiredPrivilege = RequiredPrivilege::ForInvokeCommand(aRequest.path); +#endif + CHIP_ERROR err = Access::GetAccessControl().Check(*aRequest.subjectDescriptor, requestPath, minimumRequiredPrivilege); + if (err != CHIP_NO_ERROR) + { + if ((err != CHIP_ERROR_ACCESS_DENIED) && (err != CHIP_ERROR_ACCESS_RESTRICTED_BY_ARL)) + { + return Status::Failure; + } + return err == CHIP_ERROR_ACCESS_DENIED ? Status::UnsupportedAccess : Status::AccessRestricted; + } + + return Status::Success; +} + +Protocols::InteractionModel::Status InteractionModelEngine::CheckCommandFlags(const DataModel::InvokeRequest & aRequest) +{ +#if CHIP_CONFIG_USE_DATA_MODEL_INTERFACE + std::optional commandInfo = mDataModelProvider->GetAcceptedCommandInfo(aRequest.path); + // This is checked by previous validations, so it should not happen + VerifyOrDie(commandInfo.has_value()); + + const bool commandNeedsTimedInvoke = commandInfo->flags.Has(DataModel::CommandQualityFlags::kTimed); + const bool commandIsFabricScoped = commandInfo->flags.Has(DataModel::CommandQualityFlags::kFabricScoped); +#else + const bool commandNeedsTimedInvoke = CommandNeedsTimedInvoke(aRequest.path.mClusterId, aRequest.path.mCommandId); + const bool commandIsFabricScoped = CommandIsFabricScoped(aRequest.path.mClusterId, aRequest.path.mCommandId); +#endif + + if (commandNeedsTimedInvoke && !aRequest.invokeFlags.Has(DataModel::InvokeFlags::kTimed)) + { + return Status::NeedsTimedInteraction; + } + + if (commandIsFabricScoped) + { + // SPEC: Else if the command in the path is fabric-scoped and there is no accessing fabric, + // a CommandStatusIB SHALL be generated with the UNSUPPORTED_ACCESS Status Code. + + // Fabric-scoped commands are not allowed before a specific accessing fabric is available. + // This is mostly just during a PASE session before AddNOC. + if (aRequest.GetAccessingFabricIndex() == kUndefinedFabricIndex) + { + return Status::UnsupportedAccess; + } + } + + return Status::Success; +} + +Protocols::InteractionModel::Status InteractionModelEngine::CheckCommandExistence(const ConcreteCommandPath & aCommandPath) { #if CHIP_CONFIG_USE_DATA_MODEL_INTERFACE auto provider = GetDataModelProvider(); diff --git a/src/app/InteractionModelEngine.h b/src/app/InteractionModelEngine.h index b52b4eb451..ef4b041f19 100644 --- a/src/app/InteractionModelEngine.h +++ b/src/app/InteractionModelEngine.h @@ -49,6 +49,7 @@ #include #include #include +#include #include #include #include @@ -508,7 +509,7 @@ class InteractionModelEngine : public Messaging::UnsolicitedMessageHandler, void DispatchCommand(CommandHandlerImpl & apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & apPayload) override; - Protocols::InteractionModel::Status CommandExists(const ConcreteCommandPath & aCommandPath) override; + Protocols::InteractionModel::Status ValidateCommandCanBeDispatched(const DataModel::InvokeRequest & request) override; bool HasActiveRead(); @@ -612,6 +613,10 @@ class InteractionModelEngine : public Messaging::UnsolicitedMessageHandler, void ShutdownMatchingSubscriptions(const Optional & aFabricIndex = NullOptional, const Optional & aPeerNodeId = NullOptional); + Status CheckCommandExistence(const ConcreteCommandPath & aCommandPath); + Status CheckCommandAccess(const DataModel::InvokeRequest & aRequest); + Status CheckCommandFlags(const DataModel::InvokeRequest & aRequest); + /** * Check if the given attribute path is a valid path in the data model provider. */ diff --git a/src/app/data-model-provider/OperationTypes.h b/src/app/data-model-provider/OperationTypes.h index 8758e02ef8..6bfffccc65 100644 --- a/src/app/data-model-provider/OperationTypes.h +++ b/src/app/data-model-provider/OperationTypes.h @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -55,6 +56,15 @@ struct OperationRequest /// /// NOTE: once kInternal flag is removed, this will become non-optional std::optional subjectDescriptor; + + /// Accessing fabric index is the subjectDescriptor fabric index (if any). + /// This is a readability convenience function. + /// + /// Returns kUndefinedFabricIndex if no subject descriptor is available + FabricIndex GetAccessingFabricIndex() const + { + return subjectDescriptor.has_value() ? subjectDescriptor->fabricIndex : kUndefinedFabricIndex; + } }; enum class ReadFlags : uint32_t diff --git a/src/app/tests/TestCommandInteraction.cpp b/src/app/tests/TestCommandInteraction.cpp index e4465c119d..a44d76d1fc 100644 --- a/src/app/tests/TestCommandInteraction.cpp +++ b/src/app/tests/TestCommandInteraction.cpp @@ -25,7 +25,6 @@ #include #include -#include #include #include @@ -38,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -372,9 +372,21 @@ class MockCommandHandlerCallback : public CommandHandlerImpl::Callback { DispatchSingleClusterCommand(aCommandPath, apPayload, &apCommandObj); } - Protocols::InteractionModel::Status CommandExists(const ConcreteCommandPath & aCommandPath) + + Protocols::InteractionModel::Status ValidateCommandCanBeDispatched(const DataModel::InvokeRequest & request) override { - return ServerClusterCommandExists(aCommandPath); + using Protocols::InteractionModel::Status; + + Status status = ServerClusterCommandExists(request.path); + if (status != Status::Success) + { + return status; + } + + // NOTE: IM does more validation here, however for now we do minimal options + // to pass the test. + + return Status::Success; } void ResetCounter() { onFinalCalledTimes = 0; } diff --git a/src/test_driver/linux-cirque/MobileDeviceTest.py b/src/test_driver/linux-cirque/MobileDeviceTest.py index a206dc31c2..c8a73baf0c 100755 --- a/src/test_driver/linux-cirque/MobileDeviceTest.py +++ b/src/test_driver/linux-cirque/MobileDeviceTest.py @@ -126,7 +126,7 @@ def run_controller_test(self): "Toggle ep1 on/off from state 0 to 1", "Received command for Endpoint=1 Cluster=0x0000_0006 Command=0x0000_0000", "Toggle ep1 on/off from state 1 to 0", - "No command 0x0000_0001 in Cluster 0x0000_0006 on Endpoint 0xe9"]), + "No command 0x0000_0001 in Cluster 0x0000_0006 on Endpoint 233"]), "Datamodel test failed: cannot find matching string from device {}".format(device_id)) From a7bbd7b83591fa3e1861e527909153c30390a642 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Thu, 10 Oct 2024 00:11:28 +0200 Subject: [PATCH 065/127] [Matter.framework] Clear all device controller delegates on controller shutdown (#35935) --- src/darwin/Framework/CHIP/MTRDeviceController.mm | 10 +++++++++- .../Framework/CHIP/MTRDeviceController_Concrete.mm | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm index 013e892873..5695ef23c7 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm @@ -313,7 +313,7 @@ - (void)_controllerResumed - (void)shutdown { - // Subclass hook; nothing to do. + [self _clearDeviceControllerDelegates]; } - (nullable NSNumber *)controllerNodeID @@ -671,6 +671,14 @@ - (void)removeDeviceControllerDelegate:(id)delegate } } +- (void)_clearDeviceControllerDelegates +{ + @synchronized(self) { + _strongDelegateForSetDelegateAPI = nil; + [_delegates removeAllObjects]; + } +} + // Iterates the delegates, and remove delegate info objects if the delegate object has dealloc'ed // Returns number of delegates called - (NSUInteger)_iterateDelegateInfoWithBlock:(void (^_Nullable)(MTRDeviceControllerDelegateInfo * delegateInfo))block diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm index 42ee83d523..eb7881bfd1 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm @@ -418,6 +418,7 @@ - (void)shutdown return; } [self finalShutdown]; + [super shutdown]; } - (void)finalShutdown From 88bf4388d6022643fa984cd957914dc82a3f7723 Mon Sep 17 00:00:00 2001 From: yunhanw-google Date: Wed, 9 Oct 2024 17:09:59 -0700 Subject: [PATCH 066/127] Fix crash when handling jStayActiveMsec (#35997) --- src/controller/java/AndroidDeviceControllerWrapper.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/controller/java/AndroidDeviceControllerWrapper.cpp b/src/controller/java/AndroidDeviceControllerWrapper.cpp index fccb1ba7cb..ba0342629a 100644 --- a/src/controller/java/AndroidDeviceControllerWrapper.cpp +++ b/src/controller/java/AndroidDeviceControllerWrapper.cpp @@ -519,9 +519,15 @@ CHIP_ERROR AndroidDeviceControllerWrapper::ApplyICDRegistrationInfo(chip::Contro "()Ljava/lang/Long;", &getICDStayActiveDurationMsecMethod); ReturnErrorOnFailure(err); jobject jStayActiveMsec = env->CallObjectMethod(icdRegistrationInfo, getICDStayActiveDurationMsecMethod); - if (jStayActiveMsec != 0) + if (jStayActiveMsec != nullptr) { - params.SetICDStayActiveDurationMsec(chip::JniReferences::GetInstance().IntegerToPrimitive(jStayActiveMsec)); + jlong stayActiveMsec = chip::JniReferences::GetInstance().LongToPrimitive(jStayActiveMsec); + if (!chip::CanCastTo(stayActiveMsec)) + { + ChipLogError(Controller, "Failed to process stayActiveMsec in %s since this is not a valid 32-bit integer.", __func__); + return CHIP_ERROR_INVALID_ARGUMENT; + } + params.SetICDStayActiveDurationMsec(static_cast(stayActiveMsec)); } jmethodID getCheckInNodeIdMethod; From 8a01f93835700bf96acd47d246024bbfd4370602 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 9 Oct 2024 22:29:01 -0400 Subject: [PATCH 067/127] Remove no-op ShutdownOnExit. (#36002) --- .../CHIP/MTRDeviceControllerFactory.mm | 17 ----------------- src/darwin/Framework/CHIP/MTRSetupPayload.mm | 2 +- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm index 815d7ae2a9..750ab648cb 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm @@ -70,12 +70,6 @@ using namespace chip::Controller; using namespace chip::Tracing::DarwinFramework; -static bool sExitHandlerRegistered = false; -static void ShutdownOnExit() -{ - // Don't do anything here, period -} - @interface MTRDeviceControllerFactoryParams () // Flag to keep track of whether our .storage is real consumer-provided storage @@ -389,17 +383,6 @@ - (BOOL)_startControllerFactory:(MTRDeviceControllerFactoryParams *)startupParam SuccessOrExit(err = _controllerFactory->Init(params)); } - // This needs to happen after DeviceControllerFactory::Init, - // because that creates (lazily, by calling functions with - // static variables in them) some static-lifetime objects. - if (!sExitHandlerRegistered) { - if (atexit(ShutdownOnExit) != 0) { - char error[128]; - strerror_r(errno, error, sizeof(error)); - MTR_LOG_ERROR("Warning: Failed to register atexit handler: %s", error); - } - sExitHandlerRegistered = true; - } HeapObjectPoolExitHandling::IgnoreLeaksOnExit(); // Make sure we don't leave a system state running while we have no diff --git a/src/darwin/Framework/CHIP/MTRSetupPayload.mm b/src/darwin/Framework/CHIP/MTRSetupPayload.mm index 98d9f2b342..c4694884ea 100644 --- a/src/darwin/Framework/CHIP/MTRSetupPayload.mm +++ b/src/darwin/Framework/CHIP/MTRSetupPayload.mm @@ -607,7 +607,7 @@ + (NSUInteger)generateRandomPIN return setupPIN; } - // We got pretty unlikely with our random number generation. Just try + // We got pretty unlucky with our random number generation. Just try // again. The chance that this loop does not terminate in a reasonable // amount of time is astronomically low, assuming arc4random_uniform is not // broken. From d3f33ba347bc15e8e08c9f551f06ab7a935d7daa Mon Sep 17 00:00:00 2001 From: andrei-menzopol <96489227+andrei-menzopol@users.noreply.github.com> Date: Thu, 10 Oct 2024 13:05:21 +0300 Subject: [PATCH 068/127] [NXP][common][mcxw71_k32w1] Add MML support to DiagnosticDataProviderImpl (#35990) * [nxp][platform][common] Add MML suppport for heap diagnostics * add SupportsWatermarks * add NXP_USE_MML define * add MML support for heap diagnostics Signed-off-by: Andrei Menzopol * [nxp][platform][mcxw71_k32w1] Use MML support for heap diagnostics * switch to common DiagnosticDataProviderImpl * enable MML support for heap diagnostics Signed-off-by: Andrei Menzopol * Restyled by whitespace * Restyled by clang-format * Restyled by gn --------- Signed-off-by: Andrei Menzopol Co-authored-by: Restyled.io --- .../nxp/common/CHIPNXPPlatformDefaultConfig.h | 5 ++++ .../nxp/common/DiagnosticDataProviderImpl.cpp | 28 +++++++++++++++---- .../nxp/common/DiagnosticDataProviderImpl.h | 4 +++ src/platform/nxp/mcxw71_k32w1/BUILD.gn | 9 ++++-- 4 files changed, 37 insertions(+), 9 deletions(-) diff --git a/src/platform/nxp/common/CHIPNXPPlatformDefaultConfig.h b/src/platform/nxp/common/CHIPNXPPlatformDefaultConfig.h index 0c263fc6ae..c90619bddd 100644 --- a/src/platform/nxp/common/CHIPNXPPlatformDefaultConfig.h +++ b/src/platform/nxp/common/CHIPNXPPlatformDefaultConfig.h @@ -253,3 +253,8 @@ */ #define CHIP_CONFIG_RMP_DEFAULT_MAX_RETRANS 10 #endif + +#ifndef NXP_USE_MML +/* Do not use Memory Manager Light for dynamic memory allocation by default. */ +#define NXP_USE_MML 0 +#endif // NXP_USE_MML diff --git a/src/platform/nxp/common/DiagnosticDataProviderImpl.cpp b/src/platform/nxp/common/DiagnosticDataProviderImpl.cpp index dd10221748..09d8a7d266 100644 --- a/src/platform/nxp/common/DiagnosticDataProviderImpl.cpp +++ b/src/platform/nxp/common/DiagnosticDataProviderImpl.cpp @@ -42,6 +42,17 @@ extern "C" { } #endif +#if NXP_USE_MML +#include "fsl_component_mem_manager.h" +#define GetFreeHeapSize MEM_GetFreeHeapSize +#define HEAP_SIZE MinimalHeapSize_c +#define GetMinimumEverFreeHeapSize MEM_GetFreeHeapSizeLowWaterMark +#else +#define GetFreeHeapSize xPortGetFreeHeapSize +#define HEAP_SIZE configTOTAL_HEAP_SIZE +#define GetMinimumEverFreeHeapSize xPortGetMinimumEverFreeHeapSize +#endif // NXP_USE_MML + // Not implement into the SDK // extern "C" void xPortResetHeapMinimumEverFreeHeapSize(void); @@ -57,8 +68,8 @@ DiagnosticDataProviderImpl & DiagnosticDataProviderImpl::GetDefaultInstance() CHIP_ERROR DiagnosticDataProviderImpl::GetCurrentHeapFree(uint64_t & currentHeapFree) { size_t freeHeapSize; + freeHeapSize = GetFreeHeapSize(); - freeHeapSize = xPortGetFreeHeapSize(); currentHeapFree = static_cast(freeHeapSize); return CHIP_NO_ERROR; } @@ -68,8 +79,8 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetCurrentHeapUsed(uint64_t & currentHeap size_t freeHeapSize; size_t usedHeapSize; - freeHeapSize = xPortGetFreeHeapSize(); - usedHeapSize = configTOTAL_HEAP_SIZE - freeHeapSize; + freeHeapSize = GetFreeHeapSize(); + usedHeapSize = HEAP_SIZE - freeHeapSize; currentHeapUsed = static_cast(usedHeapSize); return CHIP_NO_ERROR; @@ -79,7 +90,8 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetCurrentHeapHighWatermark(uint64_t & cu { size_t highWatermarkHeapSize; - highWatermarkHeapSize = configTOTAL_HEAP_SIZE - xPortGetMinimumEverFreeHeapSize(); + highWatermarkHeapSize = HEAP_SIZE - GetMinimumEverFreeHeapSize(); + currentHeapHighWatermark = static_cast(highWatermarkHeapSize); return CHIP_NO_ERROR; } @@ -89,12 +101,16 @@ CHIP_ERROR DiagnosticDataProviderImpl::ResetWatermarks() // If implemented, the server SHALL set the value of the CurrentHeapHighWatermark attribute to the // value of the CurrentHeapUsed. +#if NXP_USE_MML + MEM_ResetFreeHeapSizeLowWaterMark(); + + return CHIP_NO_ERROR; +#else // Not implement into the SDK // xPortResetHeapMinimumEverFreeHeapSize(); - // return CHIP_NO_ERROR; - return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#endif } CHIP_ERROR DiagnosticDataProviderImpl::GetThreadMetrics(ThreadMetrics ** threadMetricsOut) diff --git a/src/platform/nxp/common/DiagnosticDataProviderImpl.h b/src/platform/nxp/common/DiagnosticDataProviderImpl.h index 5b9fc4c9ae..27b2e35365 100644 --- a/src/platform/nxp/common/DiagnosticDataProviderImpl.h +++ b/src/platform/nxp/common/DiagnosticDataProviderImpl.h @@ -39,6 +39,10 @@ class DiagnosticDataProviderImpl : public DiagnosticDataProvider static DiagnosticDataProviderImpl & GetDefaultInstance(); // ===== Methods that implement the PlatformManager abstract interface. + +#if NXP_USE_MML + bool SupportsWatermarks() override { return true; } +#endif CHIP_ERROR GetCurrentHeapFree(uint64_t & currentHeapFree) override; CHIP_ERROR GetCurrentHeapUsed(uint64_t & currentHeapUsed) override; CHIP_ERROR GetCurrentHeapHighWatermark(uint64_t & currentHeapHighWatermark) override; diff --git a/src/platform/nxp/mcxw71_k32w1/BUILD.gn b/src/platform/nxp/mcxw71_k32w1/BUILD.gn index 253e21e4ef..6b399a1c1d 100644 --- a/src/platform/nxp/mcxw71_k32w1/BUILD.gn +++ b/src/platform/nxp/mcxw71_k32w1/BUILD.gn @@ -90,10 +90,15 @@ config("nxp_platform_config") { static_library("nxp_platform") { deps = [] - defines = [ "CHIP_DEVICE_K32W1=1" ] + defines = [ + "CHIP_DEVICE_K32W1=1", + "NXP_USE_MML=1", + ] sources = [ "../../SingletonConfigurationManager.cpp", + "../common/DiagnosticDataProviderImpl.cpp", + "../common/DiagnosticDataProviderImpl.h", "../common/ble/BLEManagerCommon.cpp", "../common/ble/BLEManagerCommon.h", "../common/ble/BLEManagerImpl.cpp", @@ -104,8 +109,6 @@ static_library("nxp_platform") { "ConfigurationManagerImpl.h", "ConnectivityManagerImpl.cpp", "ConnectivityManagerImpl.h", - "DiagnosticDataProviderImpl.cpp", - "DiagnosticDataProviderImpl.h", "PlatformManagerImpl.cpp", "PlatformManagerImpl.h", "SystemTimeSupport.cpp", From afcfba0e9e5ad8ed7afccf2171ada0b61c8d7362 Mon Sep 17 00:00:00 2001 From: Arkadiusz Bokowy Date: Thu, 10 Oct 2024 13:08:15 +0200 Subject: [PATCH 069/127] [Tizen] Enable QEMU RTC driver to sync time on boot (#35964) --- .../docker/images/base/chip-build/version | 2 +- .../stage-3/chip-build-tizen-qemu/Dockerfile | 22 ++++++++++--------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/integrations/docker/images/base/chip-build/version b/integrations/docker/images/base/chip-build/version index 9f5456cec0..2b7aeef2b7 100644 --- a/integrations/docker/images/base/chip-build/version +++ b/integrations/docker/images/base/chip-build/version @@ -1 +1 @@ -81 : [Telink] Update Docker image (Zephyr update) +82 : [Tizen] Enable RTC driver to sync time on boot diff --git a/integrations/docker/images/stage-3/chip-build-tizen-qemu/Dockerfile b/integrations/docker/images/stage-3/chip-build-tizen-qemu/Dockerfile index 26b9183da6..d731ab2dc6 100644 --- a/integrations/docker/images/stage-3/chip-build-tizen-qemu/Dockerfile +++ b/integrations/docker/images/stage-3/chip-build-tizen-qemu/Dockerfile @@ -46,23 +46,25 @@ RUN set -x \ && cd *linux-kernel-* \ && zcat ../*-to-*.diff.gz | patch -p1 \ && patch -p1 < $TIZEN_SDK_ROOT/files/0001-smack-add-permissive-mode.patch \ - # Compile + # Configure && export MAKEFLAGS=-j$(nproc) \ && export ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- \ && make tizen_bcm2711_defconfig \ - && ./scripts/config -e ARCH_VIRT \ - && ./scripts/config -e VIRTIO_MMIO -e HW_RANDOM_VIRTIO \ + # Add support for QEMU VirtIO devices + && ./scripts/config -e ARCH_VIRT -e VIRTIO_MMIO \ && ./scripts/config -e VIRTIO_PCI -e VIRTIO_BLK \ && ./scripts/config -e VIRTIO_NET -e VETH \ - && ./scripts/config -e IKCONFIG -e IKCONFIG_PROC \ + && ./scripts/config -e HW_RANDOM_VIRTIO \ + # Use ARM PL031 RTC and synchronize time during boot + && ./scripts/config -e RTC_DRV_PL031 -e RTC_HCTOSYS \ + # Enable vHCI driver to add support for Bluetooth virtualization && ./scripts/config -e BT_HCIVHCI -e CRYPTO_USER_API_HASH -e CRYPTO_USER_API_SKCIPHER \ - && ./scripts/config -e OVERLAY_FS \ - && ./scripts/config -e SECURITY_SMACK_PERMISSIVE_MODE \ - && ./scripts/config -e NET_9P -e NET_9P_VIRTIO \ - && ./scripts/config -e INET \ - && ./scripts/config -e 9P_FS -e 9P_FS_POSIX_ACL \ - && ./scripts/config -e PCI_HOST_GENERIC \ + # Enable overlay FS and disable SMACK to workaround permission issues + && ./scripts/config -e OVERLAY_FS -e SECURITY_SMACK_PERMISSIVE_MODE \ + # Enable 9P filesystem support to share files between host and guest + && ./scripts/config -e INET -e PCI_HOST_GENERIC -e NET_9P -e NET_9P_VIRTIO -e 9P_FS \ && make olddefconfig \ + # Compile && make -j$(nproc) zImage \ && mv arch/arm/boot/zImage $TIZEN_IOT_QEMU_KERNEL \ # Cleanup From b1cd9fdc010748e6fa52dc5043f4b842952fe284 Mon Sep 17 00:00:00 2001 From: Vatsal Ghelani <152916324+vatsalghelani-csa@users.noreply.github.com> Date: Thu, 10 Oct 2024 07:14:10 -0400 Subject: [PATCH 070/127] Refactoring of support test scripts to enhance matter testing infrastructure (#34785) * Refactoring of the matter testing infrastructure * Restyled by shfmt * Manually fix restyle * Manually fix restyle * Manually restyle * Manually fix restyle * Manually fix restyle * Renamed testing_support to matter_testing _support * Fixed the support scripts from matter_testing_support * Fixed TC_OVENOPSTATE_2_6.py for import command * replace all os.path.join and such (using _file_) with their own method * Fixed paths.py for import * Fixed imports for TC_DeviceConformace.py * Fixed the broken import for matter_testing * Make sure modules match master * Debug the data model files for spec_parsing * Try to guess data model root * Restyle * Moving Test* from python_testing to matter_testing_support * Removed the tests moved from glob python scripts * Restyled by isort * Added taglist_and_topology_test.py to the support tests list * Restyled by isort * Fixed the structure for accessing example_pics_xml_basic_info.xml * Fixing the TC_RVCCLEANM_2_2.py script according to master changes * Changes according to master * Fixing structuring of TestMatterTestingSupport.py and TestSpecParsingSupport.py * Restyled by isort * Fixed typo on src/python_testing/matter_testing_infrastructure/BUILD.gn tests section * Fixed import for TC_ICDM_3_2.py * Fix Import for TC_RVCCLEANM_2_2.py * Restyled by autopep8 * Update line formatting in TestSpecParsingSupport.py * Fixed comment on execute_python_tests.py * tests.yaml test * Test to fix src/python_testing/test_testing directory imports * Restyled by isort * Fixed code lints * Fix imports for test_testing directory * Fixed imports on test_TC_ICDM_2_1.py * Restyled by autopep8 * Restyled by isort * Updated imported fixes on test_TC_ICDM_2_1.py * Restyled by autopep8 * Restyled by isort * Import fixes for parent directory test imports * Fixing try-except imports for test_testing directory scripts * Remove unwanted import os from 2 scripts * Restyled by isort * Restyled by isort * Restyled by autopep8 * Restyled by isort * Updated paths and spec_xml scripts * Fixed unused imports * Restyled by isort * Try to guess data model root * Fixed wrong string via GUI that was set in vscode * Fix matter_testing imports * Comment * Remove comment * Fixed import and improved logging via flush of stdout * Fixed matter support import for test scripts * Restyled by isort * Fixed "os.environ is not callable, it is a dictionary" Co-authored-by: Andrei Litvin * Import fixed for TC_CCTRL_2_3.py * Update logic to match master * Fixed multiple executions of the same tests * Fixed test_testing scripts with master * Restyled by isort * Fixing code lints * Restyled by autopep8 * Fix formate changes happened with autosave on TestSpecParsingSupport.py * Fixed module import in MockTestRunner script * Restructured the tasks.py scripts in matter_testing_support * Fixed formatting * Restyled by shfmt * Restyled by isort * Fixed code lints * Fixed imports for the new scripts added * Fixed k1_4 for the test script * Restyled by autopep8 * Fixed import for new scripts added * Added support for v1_4 * Update TestSpecParsingSupport.py * Added the missed part of the code after hard reset from commit d0e36909af460b490565b1798bc7b4f0042a8545 * Print statements to test * Update TestSpecParsingSupport.py * Added in_progress for DEFAULT_OUTPUT_DIR_IN_PROGRESS * Added support for conformance_support in atomic attributes * Removing test prints statements * Restyled by isort * Checking in Thermostat's Revision * Check and Verified Cluster Thermostats's Revision * Restyled by isort * Fixed improts with news supports apps.py * Restyled by isort * Fixed imports for ECOINFO scripts * Restyled by isort * Renamed matter_testing_support to chip.testing * Update TestSpecParsingSupport.py * Restyled by shfmt * Restyled by isort * Update build_python.sh * Fix imports for TC_SWITCH.py script * Restyled by isort --------- Co-authored-by: Restyled.io Co-authored-by: Andrei Litvin --- docs/testing/python.md | 10 +- scripts/spec_xml/generate_spec_xml.py | 60 ++++------ scripts/spec_xml/paths.py | 109 ++++++++++++++++++ src/python_testing/MinimalRepresentation.py | 6 +- src/python_testing/TCP_Tests.py | 2 +- src/python_testing/TC_ACE_1_2.py | 2 +- src/python_testing/TC_ACE_1_3.py | 2 +- src/python_testing/TC_ACE_1_4.py | 2 +- src/python_testing/TC_ACE_1_5.py | 2 +- src/python_testing/TC_ACL_2_11.py | 4 +- src/python_testing/TC_ACL_2_2.py | 2 +- src/python_testing/TC_AccessChecker.py | 10 +- src/python_testing/TC_BOOLCFG_2_1.py | 2 +- src/python_testing/TC_BOOLCFG_3_1.py | 2 +- src/python_testing/TC_BOOLCFG_4_1.py | 2 +- src/python_testing/TC_BOOLCFG_4_2.py | 2 +- src/python_testing/TC_BOOLCFG_4_3.py | 2 +- src/python_testing/TC_BOOLCFG_4_4.py | 2 +- src/python_testing/TC_BOOLCFG_5_1.py | 2 +- src/python_testing/TC_BOOLCFG_5_2.py | 2 +- src/python_testing/TC_BRBINFO_4_1.py | 2 +- src/python_testing/TC_CADMIN_1_9.py | 2 +- src/python_testing/TC_CCTRL_2_1.py | 2 +- src/python_testing/TC_CCTRL_2_2.py | 4 +- src/python_testing/TC_CCTRL_2_3.py | 4 +- src/python_testing/TC_CC_10_1.py | 2 +- src/python_testing/TC_CC_2_2.py | 7 +- src/python_testing/TC_CGEN_2_4.py | 2 +- src/python_testing/TC_CNET_1_4.py | 2 +- src/python_testing/TC_CNET_4_4.py | 2 +- src/python_testing/TC_DA_1_2.py | 5 +- src/python_testing/TC_DA_1_5.py | 2 +- src/python_testing/TC_DA_1_7.py | 4 +- src/python_testing/TC_DEMTestBase.py | 2 +- src/python_testing/TC_DEM_2_1.py | 2 +- src/python_testing/TC_DEM_2_10.py | 4 +- src/python_testing/TC_DEM_2_2.py | 2 +- src/python_testing/TC_DEM_2_3.py | 2 +- src/python_testing/TC_DEM_2_4.py | 2 +- src/python_testing/TC_DEM_2_5.py | 2 +- src/python_testing/TC_DEM_2_6.py | 2 +- src/python_testing/TC_DEM_2_7.py | 2 +- src/python_testing/TC_DEM_2_8.py | 2 +- src/python_testing/TC_DEM_2_9.py | 2 +- src/python_testing/TC_DGGEN_2_4.py | 5 +- src/python_testing/TC_DGGEN_3_2.py | 2 +- src/python_testing/TC_DGSW_2_1.py | 2 +- src/python_testing/TC_DRLK_2_12.py | 2 +- src/python_testing/TC_DRLK_2_13.py | 2 +- src/python_testing/TC_DRLK_2_2.py | 2 +- src/python_testing/TC_DRLK_2_3.py | 2 +- src/python_testing/TC_DRLK_2_5.py | 2 +- src/python_testing/TC_DRLK_2_9.py | 2 +- .../TC_DeviceBasicComposition.py | 23 ++-- src/python_testing/TC_DeviceConformance.py | 18 +-- src/python_testing/TC_ECOINFO_2_1.py | 2 +- src/python_testing/TC_ECOINFO_2_2.py | 2 +- src/python_testing/TC_EEM_2_1.py | 2 +- src/python_testing/TC_EEM_2_2.py | 2 +- src/python_testing/TC_EEM_2_3.py | 2 +- src/python_testing/TC_EEM_2_4.py | 2 +- src/python_testing/TC_EEM_2_5.py | 2 +- src/python_testing/TC_EEVSE_2_2.py | 2 +- src/python_testing/TC_EEVSE_2_3.py | 4 +- src/python_testing/TC_EEVSE_2_4.py | 2 +- src/python_testing/TC_EEVSE_2_5.py | 2 +- src/python_testing/TC_EEVSE_2_6.py | 4 +- src/python_testing/TC_EPM_2_1.py | 5 +- src/python_testing/TC_EPM_2_2.py | 2 +- src/python_testing/TC_EWATERHTR_2_1.py | 2 +- src/python_testing/TC_EWATERHTR_2_2.py | 2 +- src/python_testing/TC_EWATERHTR_2_3.py | 2 +- src/python_testing/TC_FAN_3_1.py | 2 +- src/python_testing/TC_FAN_3_2.py | 2 +- src/python_testing/TC_FAN_3_3.py | 2 +- src/python_testing/TC_FAN_3_4.py | 2 +- src/python_testing/TC_FAN_3_5.py | 2 +- src/python_testing/TC_ICDM_2_1.py | 2 +- src/python_testing/TC_ICDM_3_1.py | 2 +- src/python_testing/TC_ICDM_3_2.py | 2 +- src/python_testing/TC_ICDM_3_3.py | 2 +- src/python_testing/TC_ICDM_3_4.py | 4 +- src/python_testing/TC_ICDM_5_1.py | 2 +- src/python_testing/TC_ICDManagementCluster.py | 2 +- src/python_testing/TC_IDM_1_2.py | 2 +- src/python_testing/TC_IDM_1_4.py | 2 +- src/python_testing/TC_IDM_4_2.py | 2 +- src/python_testing/TC_LVL_2_3.py | 4 +- src/python_testing/TC_MCORE_FS_1_1.py | 2 +- src/python_testing/TC_MCORE_FS_1_2.py | 2 +- src/python_testing/TC_MCORE_FS_1_3.py | 2 +- src/python_testing/TC_MCORE_FS_1_4.py | 2 +- src/python_testing/TC_MCORE_FS_1_5.py | 2 +- src/python_testing/TC_MWOCTRL_2_1.py | 2 +- src/python_testing/TC_MWOCTRL_2_2.py | 2 +- src/python_testing/TC_MWOCTRL_2_4.py | 2 +- src/python_testing/TC_MWOM_1_2.py | 2 +- src/python_testing/TC_OCC_2_1.py | 2 +- src/python_testing/TC_OCC_2_2.py | 5 +- src/python_testing/TC_OCC_2_3.py | 2 +- src/python_testing/TC_OCC_3_1.py | 4 +- src/python_testing/TC_OCC_3_2.py | 4 +- src/python_testing/TC_OPCREDS_3_1.py | 2 +- src/python_testing/TC_OPCREDS_3_2.py | 2 +- src/python_testing/TC_OPSTATE_2_1.py | 2 +- src/python_testing/TC_OPSTATE_2_2.py | 2 +- src/python_testing/TC_OPSTATE_2_3.py | 2 +- src/python_testing/TC_OPSTATE_2_4.py | 2 +- src/python_testing/TC_OPSTATE_2_5.py | 2 +- src/python_testing/TC_OPSTATE_2_6.py | 2 +- src/python_testing/TC_OVENOPSTATE_2_1.py | 2 +- src/python_testing/TC_OVENOPSTATE_2_2.py | 2 +- src/python_testing/TC_OVENOPSTATE_2_3.py | 2 +- src/python_testing/TC_OVENOPSTATE_2_4.py | 2 +- src/python_testing/TC_OVENOPSTATE_2_5.py | 2 +- src/python_testing/TC_OVENOPSTATE_2_6.py | 2 +- src/python_testing/TC_OpstateCommon.py | 2 +- src/python_testing/TC_PS_2_3.py | 4 +- src/python_testing/TC_PWRTL_2_1.py | 2 +- src/python_testing/TC_RR_1_1.py | 2 +- src/python_testing/TC_RVCCLEANM_1_2.py | 2 +- src/python_testing/TC_RVCCLEANM_2_1.py | 2 +- src/python_testing/TC_RVCCLEANM_2_2.py | 2 +- src/python_testing/TC_RVCOPSTATE_2_1.py | 2 +- src/python_testing/TC_RVCOPSTATE_2_3.py | 2 +- src/python_testing/TC_RVCOPSTATE_2_4.py | 2 +- src/python_testing/TC_RVCRUNM_1_2.py | 2 +- src/python_testing/TC_RVCRUNM_2_1.py | 2 +- src/python_testing/TC_RVCRUNM_2_2.py | 2 +- src/python_testing/TC_SC_3_6.py | 2 +- src/python_testing/TC_SC_7_1.py | 5 +- src/python_testing/TC_SEAR_1_2.py | 2 +- src/python_testing/TC_SEAR_1_3.py | 8 +- src/python_testing/TC_SEAR_1_4.py | 2 +- src/python_testing/TC_SEAR_1_5.py | 2 +- src/python_testing/TC_SEAR_1_6.py | 2 +- src/python_testing/TC_SWTCH.py | 9 +- src/python_testing/TC_TIMESYNC_2_1.py | 4 +- src/python_testing/TC_TIMESYNC_2_10.py | 4 +- src/python_testing/TC_TIMESYNC_2_11.py | 4 +- src/python_testing/TC_TIMESYNC_2_12.py | 4 +- src/python_testing/TC_TIMESYNC_2_13.py | 2 +- src/python_testing/TC_TIMESYNC_2_2.py | 3 +- src/python_testing/TC_TIMESYNC_2_4.py | 3 +- src/python_testing/TC_TIMESYNC_2_5.py | 2 +- src/python_testing/TC_TIMESYNC_2_6.py | 2 +- src/python_testing/TC_TIMESYNC_2_7.py | 4 +- src/python_testing/TC_TIMESYNC_2_8.py | 4 +- src/python_testing/TC_TIMESYNC_2_9.py | 4 +- src/python_testing/TC_TIMESYNC_3_1.py | 2 +- src/python_testing/TC_TMP_2_1.py | 2 +- src/python_testing/TC_TSTAT_4_2.py | 2 +- src/python_testing/TC_TestEventTrigger.py | 2 +- src/python_testing/TC_VALCC_2_1.py | 2 +- src/python_testing/TC_VALCC_3_1.py | 2 +- src/python_testing/TC_VALCC_3_2.py | 2 +- src/python_testing/TC_VALCC_3_3.py | 2 +- src/python_testing/TC_VALCC_3_4.py | 2 +- src/python_testing/TC_VALCC_4_1.py | 2 +- src/python_testing/TC_VALCC_4_2.py | 2 +- src/python_testing/TC_VALCC_4_3.py | 2 +- src/python_testing/TC_VALCC_4_4.py | 3 +- src/python_testing/TC_VALCC_4_5.py | 2 +- src/python_testing/TC_WHM_1_2.py | 2 +- src/python_testing/TC_WHM_2_1.py | 2 +- src/python_testing/TC_pics_checker.py | 12 +- src/python_testing/TestBatchInvoke.py | 2 +- .../TestChoiceConformanceSupport.py | 8 +- .../TestCommissioningTimeSync.py | 2 +- src/python_testing/TestConformanceSupport.py | 8 +- src/python_testing/TestConformanceTest.py | 10 +- src/python_testing/TestGroupTableReports.py | 2 +- src/python_testing/TestIdChecks.py | 7 +- .../TestMatterTestingSupport.py | 13 ++- .../TestSpecParsingDeviceType.py | 6 +- src/python_testing/TestSpecParsingSupport.py | 17 ++- .../TestTimeSyncTrustedTimeSource.py | 2 +- .../TestUnitTestingErrorPath.py | 2 +- src/python_testing/drlk_2_x_common.py | 2 +- src/python_testing/execute_python_tests.py | 10 +- src/python_testing/hello_external_runner.py | 2 +- src/python_testing/hello_test.py | 2 +- .../matter_testing_infrastructure/BUILD.gn | 9 +- .../chip/testing/apps.py | 2 +- .../chip/testing/basic_composition.py} | 0 .../chip/testing/choice_conformance.py} | 8 +- .../chip/testing/conformance.py} | 0 .../chip/testing}/global_attribute_ids.py | 0 .../chip/testing/matter_testing.py} | 6 +- .../chip/testing/pics.py} | 0 .../chip/testing/spec_parsing.py} | 43 ++++--- .../testing/taglist_and_topology_test.py} | 0 .../production_device_checks.py | 12 +- .../test_plan_table_generator.py | 2 +- .../test_testing/MockTestRunner.py | 18 +-- .../test_testing/TestDecorators.py | 16 +-- .../test_testing/test_IDM_10_4.py | 8 +- .../test_testing/test_TC_CCNTL_2_2.py | 4 +- .../test_testing/test_TC_MCORE_FS_1_1.py | 4 +- .../test_testing/test_TC_SC_7_1.py | 9 +- src/tools/PICS-generator/PICSGenerator.py | 6 +- src/tools/PICS-generator/XMLPICSValidator.py | 2 +- src/tools/device-graph/matter-device-graph.py | 4 +- 203 files changed, 495 insertions(+), 391 deletions(-) create mode 100644 scripts/spec_xml/paths.py rename src/python_testing/{basic_composition_support.py => matter_testing_infrastructure/chip/testing/basic_composition.py} (100%) rename src/python_testing/{choice_conformance_support.py => matter_testing_infrastructure/chip/testing/choice_conformance.py} (93%) rename src/python_testing/{conformance_support.py => matter_testing_infrastructure/chip/testing/conformance.py} (100%) rename src/python_testing/{ => matter_testing_infrastructure/chip/testing}/global_attribute_ids.py (100%) rename src/python_testing/{matter_testing_support.py => matter_testing_infrastructure/chip/testing/matter_testing.py} (99%) rename src/python_testing/{pics_support.py => matter_testing_infrastructure/chip/testing/pics.py} (100%) rename src/python_testing/{spec_parsing_support.py => matter_testing_infrastructure/chip/testing/spec_parsing.py} (95%) rename src/python_testing/{taglist_and_topology_test_support.py => matter_testing_infrastructure/chip/testing/taglist_and_topology_test.py} (100%) diff --git a/docs/testing/python.md b/docs/testing/python.md index a957074e3c..4541871dcb 100644 --- a/docs/testing/python.md +++ b/docs/testing/python.md @@ -25,7 +25,7 @@ Python tests located in src/python_testing section should include various parameters and their respective values, which will guide the test runner on how to execute the tests. - All test classes inherit from `MatterBaseTest` in - [matter_testing_support.py](https://github.com/project-chip/connectedhomeip/blob/master/src/python_testing/matter_testing_support.py) + [matter_testing.py](https://github.com/project-chip/connectedhomeip/blob/master/src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py) - Support for commissioning using the python controller - Default controller (`self.default_controller`) of type `ChipDeviceCtrl` - `MatterBaseTest` inherits from the Mobly BaseTestClass @@ -38,7 +38,7 @@ Python tests located in src/python_testing decorated with the @async_test_body decorator - Use `ChipDeviceCtrl` to interact with the DUT - Controller API is in `ChipDeviceCtrl.py` (see API doc in file) - - Some support methods in `matter_testing_support.py` + - Some support methods in `matter_testing.py` - Use Mobly assertions for failing tests - `self.step()` along with a `steps_*` method to mark test plan steps for cert tests @@ -379,7 +379,7 @@ pai = await dev_ctrl.SendCommand(nodeid, 0, Clusters.OperationalCredentials.Comm ## Mobly helpers The test system is based on Mobly, and the -[matter_testing_support.py](https://github.com/project-chip/connectedhomeip/blob/master/src/python_testing/matter_testing_support.py) +[matter_testing.py](https://github.com/project-chip/connectedhomeip/blob/master/src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py) class provides some helpers for Mobly integration. - `default_matter_test_main` @@ -561,11 +561,11 @@ these steps to set this up: ## Other support utilities -- `basic_composition_support` +- `basic_composition` - wildcard read, whole device analysis - `CommissioningFlowBlocks` - various commissioning support for core tests -- `spec_parsing_support` +- `spec_parsing` - parsing data model XML into python readable format # Running tests locally diff --git a/scripts/spec_xml/generate_spec_xml.py b/scripts/spec_xml/generate_spec_xml.py index 0d41b3f519..43582fdb36 100755 --- a/scripts/spec_xml/generate_spec_xml.py +++ b/scripts/spec_xml/generate_spec_xml.py @@ -24,26 +24,17 @@ from pathlib import Path import click +from paths import Branch, get_chip_root, get_data_model_path, get_documentation_file_path, get_in_progress_defines -DEFAULT_CHIP_ROOT = os.path.abspath( - os.path.join(os.path.dirname(__file__), '..', '..')) -DEFAULT_OUTPUT_DIR_1_3 = os.path.abspath( - os.path.join(DEFAULT_CHIP_ROOT, 'data_model', '1.3')) -DEFAULT_OUTPUT_DIR_IN_PROGRESS = os.path.abspath( - os.path.join(DEFAULT_CHIP_ROOT, 'data_model', 'in_progress')) -DEFAULT_OUTPUT_DIR_TOT = os.path.abspath( - os.path.join(DEFAULT_CHIP_ROOT, 'data_model', 'master')) -DEFAULT_DOCUMENTATION_FILE = os.path.abspath( - os.path.join(DEFAULT_CHIP_ROOT, 'docs', 'spec_clusters.md')) - -# questions -# is energy-calendar still in? -# is heat-pump out? wasn't in 0.7 -# location-cluster - is this define gone now? -# queuedpreset - is this define gone now? -CURRENT_IN_PROGRESS_DEFINES = ['aliro', 'atomicwrites', 'battery-storage', 'device-location', 'e2e-jf', 'energy-calendar', 'energy-drlc', - 'energy-management', 'heat-pump', 'hrap-1', 'hvac', 'matter-fabric-synchronization', 'metering', 'secondary-net', - 'service-area-cluster', 'solar-power', 'tcp', 'water-heater', 'wifiSetup'] +# Use the get_in_progress_defines() function to fetch the in-progress defines +CURRENT_IN_PROGRESS_DEFINES = get_in_progress_defines() + +# Replace hardcoded paths with dynamic paths using paths.py functions +DEFAULT_CHIP_ROOT = get_chip_root() +DEFAULT_OUTPUT_DIR_1_3 = get_data_model_path(Branch.V1_3) +DEFAULT_OUTPUT_DIR_IN_PROGRESS = get_data_model_path(Branch.IN_PROGRESS) +DEFAULT_OUTPUT_DIR_TOT = get_data_model_path(Branch.MASTER) +DEFAULT_DOCUMENTATION_FILE = get_documentation_file_path() def get_xml_path(filename, output_dir): @@ -90,7 +81,6 @@ def make_asciidoc(target: str, include_in_progress: str, spec_dir: str, dry_run: '--include-in-progress', type=click.Choice(['All', 'None', 'Current']), default='All') def main(scraper, spec_root, output_dir, dry_run, include_in_progress): - # Clusters need to be scraped first because the cluster directory is passed to the device type directory if not output_dir: output_dir_map = {'All': DEFAULT_OUTPUT_DIR_TOT, 'None': DEFAULT_OUTPUT_DIR_1_3, 'Current': DEFAULT_OUTPUT_DIR_IN_PROGRESS} output_dir = output_dir_map[include_in_progress] @@ -103,30 +93,28 @@ def main(scraper, spec_root, output_dir, dry_run, include_in_progress): def scrape_clusters(scraper, spec_root, output_dir, dry_run, include_in_progress): src_dir = os.path.abspath(os.path.join(spec_root, 'src')) - sdm_clusters_dir = os.path.abspath( - os.path.join(src_dir, 'service_device_management')) + sdm_clusters_dir = os.path.abspath(os.path.join(src_dir, 'service_device_management')) app_clusters_dir = os.path.abspath(os.path.join(src_dir, 'app_clusters')) dm_clusters_dir = os.path.abspath(os.path.join(src_dir, 'data_model')) - media_clusters_dir = os.path.abspath( - os.path.join(app_clusters_dir, 'media')) - clusters_output_dir = os.path.abspath(os.path.join(output_dir, 'clusters')) + media_clusters_dir = os.path.abspath(os.path.join(app_clusters_dir, 'media')) + + clusters_output_dir = os.path.join(output_dir, 'clusters') if not os.path.exists(clusters_output_dir): os.makedirs(clusters_output_dir) - print('Generating main spec to get file include list - this make take a few minutes') + print('Generating main spec to get file include list - this may take a few minutes') main_out = make_asciidoc('pdf', include_in_progress, spec_root, dry_run) - print('Generating cluster spec to get file include list - this make take a few minutes') + print('Generating cluster spec to get file include list - this may take a few minutes') cluster_out = make_asciidoc('pdf-appclusters-book', include_in_progress, spec_root, dry_run) def scrape_cluster(filename: str) -> None: base = Path(filename).stem if base not in main_out and base not in cluster_out: - print(f'skipping file: {base} as it is not compiled into the asciidoc') + print(f'Skipping file: {base} as it is not compiled into the asciidoc') return xml_path = get_xml_path(filename, clusters_output_dir) - cmd = [scraper, 'cluster', '-i', filename, '-o', - xml_path, '-nd'] + cmd = [scraper, 'cluster', '-i', filename, '-o', xml_path, '-nd'] if include_in_progress == 'All': cmd.extend(['--define', 'in-progress']) elif include_in_progress == 'Current': @@ -150,33 +138,29 @@ def scrape_all_clusters(dir: str, exclude_list: list[str] = []) -> None: tree = ElementTree.parse(f'{xml_path}') root = tree.getroot() cluster = next(root.iter('cluster')) - # If there's no cluster ID table, this isn't a cluster try: next(cluster.iter('clusterIds')) except StopIteration: - # If there's no cluster ID table, this isn't a cluster just some kind of intro adoc print(f'Removing file {xml_path} as it does not include any cluster definitions') os.remove(xml_path) continue def scrape_device_types(scraper, spec_root, output_dir, dry_run, include_in_progress): - device_type_dir = os.path.abspath( - os.path.join(spec_root, 'src', 'device_types')) - device_types_output_dir = os.path.abspath( - os.path.join(output_dir, 'device_types')) + device_type_dir = os.path.abspath(os.path.join(spec_root, 'src', 'device_types')) + device_types_output_dir = os.path.abspath(os.path.join(output_dir, 'device_types')) clusters_output_dir = os.path.abspath(os.path.join(output_dir, 'clusters')) if not os.path.exists(device_types_output_dir): os.makedirs(device_types_output_dir) - print('Generating device type library to get file include list - this make take a few minutes') + print('Generating device type library to get file include list - this may take a few minutes') device_type_output = make_asciidoc('pdf-devicelibrary-book', include_in_progress, spec_root, dry_run) def scrape_device_type(filename: str) -> None: base = Path(filename).stem if base not in device_type_output: - print(f'skipping file: {filename} as it is not compiled into the asciidoc') + print(f'Skipping file: {filename} as it is not compiled into the asciidoc') return xml_path = get_xml_path(filename, device_types_output_dir) cmd = [scraper, 'devicetype', '-c', '-cls', clusters_output_dir, diff --git a/scripts/spec_xml/paths.py b/scripts/spec_xml/paths.py new file mode 100644 index 0000000000..3a5159cc51 --- /dev/null +++ b/scripts/spec_xml/paths.py @@ -0,0 +1,109 @@ +#!/usr/bin/env python3 + +# Copyright (c) 2024 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os +from enum import Enum + +# Define a branch enum for different versions or branches + + +class Branch(Enum): + MASTER = "master" + V1_3 = "v1_3" + V1_4 = "v1_4" + IN_PROGRESS = "in_progress" + + +def get_chip_root(): + """ + Returns the CHIP root directory, trying the environment variable first + and falling back if necessary. + """ + chip_root = os.getenv('PW_PROJECT_ROOT') + if chip_root: + return chip_root + else: + try: + return os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')) + except Exception as e: + raise EnvironmentError( + "Unable to determine CHIP root directory. Please ensure the environment is activated." + ) from e + + +def get_data_model_path(branch: Branch): + """ + Returns the path to the data model directory for a given branch. + """ + chip_root = get_chip_root() + data_model_path = os.path.join(chip_root, 'data_model', branch.value) + if not os.path.exists(data_model_path): + raise FileNotFoundError(f"Data model path for branch {branch} does not exist: {data_model_path}") + return data_model_path + + +def get_spec_xml_output_path(): + """ + Returns the path to the output directory for generated XML files. + """ + chip_root = get_chip_root() + output_dir = os.path.join(chip_root, 'out', 'spec_xml') + if not os.path.exists(output_dir): + os.makedirs(output_dir) # Automatically create the directory if it doesn't exist + return output_dir + + +def get_documentation_file_path(): + """ + Returns the path to the documentation file. + """ + chip_root = get_chip_root() + documentation_file = os.path.join(chip_root, 'docs', 'spec_clusters.md') + if not os.path.exists(documentation_file): + raise FileNotFoundError(f"Documentation file does not exist: {documentation_file}") + return documentation_file + + +def get_python_testing_path(): + """ + Returns the path to the python_testing directory. + """ + chip_root = get_chip_root() + python_testing_path = os.path.join(chip_root, 'src', 'python_testing') + if not os.path.exists(python_testing_path): + raise FileNotFoundError(f"Python testing directory does not exist: {python_testing_path}") + return python_testing_path + + +def get_in_progress_defines(): + """ + Returns a list of defines that are currently in progress. + This can be updated dynamically as needed. + """ + return [ + 'aliro', 'atomicwrites', 'battery-storage', 'device-location', 'e2e-jf', + 'energy-calendar', 'energy-drlc', 'energy-management', 'heat-pump', 'hrap-1', + 'hvac', 'matter-fabric-synchronization', 'metering', 'secondary-net', + 'service-area-cluster', 'solar-power', 'tcp', 'water-heater', 'wifiSetup' + ] + + +def get_available_branches(): + """ + Return a list of available branches for the data model. + This can be expanded or dynamically fetched if necessary. + """ + return [Branch.MASTER, Branch.V1_3, Branch.V1_4] diff --git a/src/python_testing/MinimalRepresentation.py b/src/python_testing/MinimalRepresentation.py index c99919a908..93ce543e09 100644 --- a/src/python_testing/MinimalRepresentation.py +++ b/src/python_testing/MinimalRepresentation.py @@ -17,10 +17,10 @@ from dataclasses import dataclass, field +from chip.testing.conformance import ConformanceDecision +from chip.testing.global_attribute_ids import GlobalAttributeIds +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from chip.tlv import uint -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 TC_DeviceConformance import DeviceConformanceTests diff --git a/src/python_testing/TCP_Tests.py b/src/python_testing/TCP_Tests.py index 849b3a9c07..10209346a0 100644 --- a/src/python_testing/TCP_Tests.py +++ b/src/python_testing/TCP_Tests.py @@ -33,7 +33,7 @@ import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.interaction_model import InteractionModelError -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_ACE_1_2.py b/src/python_testing/TC_ACE_1_2.py index 4955cbd3ff..5a38120561 100644 --- a/src/python_testing/TC_ACE_1_2.py +++ b/src/python_testing/TC_ACE_1_2.py @@ -42,7 +42,7 @@ from chip.clusters.Attribute import EventReadResult, SubscriptionTransaction, TypedAttributePath from chip.exceptions import ChipStackError from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_ACE_1_3.py b/src/python_testing/TC_ACE_1_3.py index 9e2108896d..2868d9548f 100644 --- a/src/python_testing/TC_ACE_1_3.py +++ b/src/python_testing/TC_ACE_1_3.py @@ -38,7 +38,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_ACE_1_4.py b/src/python_testing/TC_ACE_1_4.py index 0afdf03ede..37577b6270 100644 --- a/src/python_testing/TC_ACE_1_4.py +++ b/src/python_testing/TC_ACE_1_4.py @@ -42,7 +42,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts # This test requires several additional command line arguments diff --git a/src/python_testing/TC_ACE_1_5.py b/src/python_testing/TC_ACE_1_5.py index 9766e9a0c6..15c7380d23 100644 --- a/src/python_testing/TC_ACE_1_5.py +++ b/src/python_testing/TC_ACE_1_5.py @@ -40,7 +40,7 @@ import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_ACL_2_11.py b/src/python_testing/TC_ACL_2_11.py index 9f4aea3218..e8aa253ae7 100644 --- a/src/python_testing/TC_ACL_2_11.py +++ b/src/python_testing/TC_ACL_2_11.py @@ -42,13 +42,13 @@ import queue import chip.clusters as Clusters -from basic_composition_support import arls_populated from chip.clusters.Attribute import EventReadResult, SubscriptionTransaction, ValueDecodeFailure from chip.clusters.ClusterObjects import ALL_ACCEPTED_COMMANDS, ALL_ATTRIBUTES, ALL_CLUSTERS, ClusterEvent from chip.clusters.Objects import AccessControl from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.basic_composition import arls_populated +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_ACL_2_2.py b/src/python_testing/TC_ACL_2_2.py index 219be92b35..6f5ed4760c 100644 --- a/src/python_testing/TC_ACL_2_2.py +++ b/src/python_testing/TC_ACL_2_2.py @@ -32,7 +32,7 @@ # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_AccessChecker.py b/src/python_testing/TC_AccessChecker.py index 23e8535f51..5f3b3d69ec 100644 --- a/src/python_testing/TC_AccessChecker.py +++ b/src/python_testing/TC_AccessChecker.py @@ -23,13 +23,13 @@ from typing import Optional import chip.clusters as Clusters -from basic_composition_support import BasicCompositionTests from chip.interaction_model import Status +from chip.testing.basic_composition import BasicCompositionTests +from chip.testing.global_attribute_ids import GlobalAttributeIds +from chip.testing.matter_testing import (AttributePathLocation, ClusterPathLocation, MatterBaseTest, TestStep, async_test_body, + default_matter_test_main) +from chip.testing.spec_parsing import XmlCluster, build_xml_clusters from chip.tlv import uint -from global_attribute_ids import GlobalAttributeIds -from matter_testing_support import (AttributePathLocation, ClusterPathLocation, MatterBaseTest, TestStep, async_test_body, - default_matter_test_main) -from spec_parsing_support import XmlCluster, build_xml_clusters class AccessTestType(Enum): diff --git a/src/python_testing/TC_BOOLCFG_2_1.py b/src/python_testing/TC_BOOLCFG_2_1.py index 27e016da52..2e90245f47 100644 --- a/src/python_testing/TC_BOOLCFG_2_1.py +++ b/src/python_testing/TC_BOOLCFG_2_1.py @@ -36,7 +36,7 @@ from operator import ior import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_BOOLCFG_3_1.py b/src/python_testing/TC_BOOLCFG_3_1.py index 4b3156bbe9..8ed77f6ba8 100644 --- a/src/python_testing/TC_BOOLCFG_3_1.py +++ b/src/python_testing/TC_BOOLCFG_3_1.py @@ -36,7 +36,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_BOOLCFG_4_1.py b/src/python_testing/TC_BOOLCFG_4_1.py index 3cd7f3a9b2..dfe6aac340 100644 --- a/src/python_testing/TC_BOOLCFG_4_1.py +++ b/src/python_testing/TC_BOOLCFG_4_1.py @@ -34,7 +34,7 @@ import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_BOOLCFG_4_2.py b/src/python_testing/TC_BOOLCFG_4_2.py index 7897847acc..093e389dcf 100644 --- a/src/python_testing/TC_BOOLCFG_4_2.py +++ b/src/python_testing/TC_BOOLCFG_4_2.py @@ -40,7 +40,7 @@ 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 chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts sensorTrigger = 0x0080_0000_0000_0000 diff --git a/src/python_testing/TC_BOOLCFG_4_3.py b/src/python_testing/TC_BOOLCFG_4_3.py index aeb245a9be..845d8e9d4a 100644 --- a/src/python_testing/TC_BOOLCFG_4_3.py +++ b/src/python_testing/TC_BOOLCFG_4_3.py @@ -40,7 +40,7 @@ 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 chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts sensorTrigger = 0x0080_0000_0000_0000 diff --git a/src/python_testing/TC_BOOLCFG_4_4.py b/src/python_testing/TC_BOOLCFG_4_4.py index 66a1d06c05..c585b14a84 100644 --- a/src/python_testing/TC_BOOLCFG_4_4.py +++ b/src/python_testing/TC_BOOLCFG_4_4.py @@ -40,7 +40,7 @@ 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 chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts sensorTrigger = 0x0080_0000_0000_0000 diff --git a/src/python_testing/TC_BOOLCFG_5_1.py b/src/python_testing/TC_BOOLCFG_5_1.py index cef0eae01b..ec31d8341b 100644 --- a/src/python_testing/TC_BOOLCFG_5_1.py +++ b/src/python_testing/TC_BOOLCFG_5_1.py @@ -40,7 +40,7 @@ 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 chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts sensorTrigger = 0x0080_0000_0000_0000 diff --git a/src/python_testing/TC_BOOLCFG_5_2.py b/src/python_testing/TC_BOOLCFG_5_2.py index 6ab8c82be6..fd6b88370d 100644 --- a/src/python_testing/TC_BOOLCFG_5_2.py +++ b/src/python_testing/TC_BOOLCFG_5_2.py @@ -40,7 +40,7 @@ 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 chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts sensorTrigger = 0x0080_0000_0000_0000 diff --git a/src/python_testing/TC_BRBINFO_4_1.py b/src/python_testing/TC_BRBINFO_4_1.py index 07b6fc2745..f5eeec3344 100644 --- a/src/python_testing/TC_BRBINFO_4_1.py +++ b/src/python_testing/TC_BRBINFO_4_1.py @@ -53,7 +53,7 @@ from chip import ChipDeviceCtrl from chip.interaction_model import InteractionModelError, Status from chip.testing.apps import IcdAppServerSubprocess -from matter_testing_support import MatterBaseTest, SimpleEventCallback, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, SimpleEventCallback, TestStep, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_CADMIN_1_9.py b/src/python_testing/TC_CADMIN_1_9.py index 060a540017..b3b09afad3 100644 --- a/src/python_testing/TC_CADMIN_1_9.py +++ b/src/python_testing/TC_CADMIN_1_9.py @@ -40,7 +40,7 @@ from chip.ChipDeviceCtrl import CommissioningParameters from chip.exceptions import ChipStackError from chip.native import PyChipError -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_CCTRL_2_1.py b/src/python_testing/TC_CCTRL_2_1.py index c689dd649b..b656973f6a 100644 --- a/src/python_testing/TC_CCTRL_2_1.py +++ b/src/python_testing/TC_CCTRL_2_1.py @@ -38,7 +38,7 @@ # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, default_matter_test_main, has_cluster, run_if_endpoint_matches +from chip.testing.matter_testing import MatterBaseTest, TestStep, default_matter_test_main, has_cluster, run_if_endpoint_matches from mobly import asserts diff --git a/src/python_testing/TC_CCTRL_2_2.py b/src/python_testing/TC_CCTRL_2_2.py index 9ccb50b387..7e7937d86f 100644 --- a/src/python_testing/TC_CCTRL_2_2.py +++ b/src/python_testing/TC_CCTRL_2_2.py @@ -50,8 +50,8 @@ from chip import ChipDeviceCtrl from chip.interaction_model import InteractionModelError, Status from chip.testing.apps import AppServerSubprocess -from matter_testing_support import (MatterBaseTest, TestStep, async_test_body, default_matter_test_main, has_cluster, - run_if_endpoint_matches) +from chip.testing.matter_testing import (MatterBaseTest, TestStep, async_test_body, default_matter_test_main, has_cluster, + run_if_endpoint_matches) from mobly import asserts diff --git a/src/python_testing/TC_CCTRL_2_3.py b/src/python_testing/TC_CCTRL_2_3.py index 07d5706a22..fe7ed3de40 100644 --- a/src/python_testing/TC_CCTRL_2_3.py +++ b/src/python_testing/TC_CCTRL_2_3.py @@ -50,8 +50,8 @@ from chip import ChipDeviceCtrl from chip.interaction_model import InteractionModelError, Status from chip.testing.apps import AppServerSubprocess -from matter_testing_support import (MatterBaseTest, TestStep, async_test_body, default_matter_test_main, has_cluster, - run_if_endpoint_matches) +from chip.testing.matter_testing import (MatterBaseTest, TestStep, async_test_body, default_matter_test_main, has_cluster, + run_if_endpoint_matches) from mobly import asserts diff --git a/src/python_testing/TC_CC_10_1.py b/src/python_testing/TC_CC_10_1.py index 2cbbf0fe9a..c2c76ecde0 100644 --- a/src/python_testing/TC_CC_10_1.py +++ b/src/python_testing/TC_CC_10_1.py @@ -41,7 +41,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts kCCAttributeValueIDs = [0x0001, 0x0003, 0x0004, 0x0007, 0x4000, 0x4001, 0x4002, 0x4003, 0x4004] diff --git a/src/python_testing/TC_CC_2_2.py b/src/python_testing/TC_CC_2_2.py index 647bee1528..f974364115 100644 --- a/src/python_testing/TC_CC_2_2.py +++ b/src/python_testing/TC_CC_2_2.py @@ -41,8 +41,8 @@ import chip.clusters as Clusters from chip.clusters import ClusterObjects as ClusterObjects -from matter_testing_support import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, default_matter_test_main, - has_cluster, run_if_endpoint_matches) +from chip.testing.matter_testing import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, default_matter_test_main, + has_cluster, run_if_endpoint_matches) from mobly import asserts from test_plan_support import commission_if_required, read_attribute, verify_success @@ -88,7 +88,8 @@ def entry_count_verification(reportList: str) -> str: 14, f'{THcommand} MoveHue with _MoveMode_ field set to Down, _Rate_ field set to 255 and remaining fields set to 0', verify_success()), TestStep( 15, f'{THcommand} MoveSaturation with _MoveMode_ field set to Down, _Rate_ field set to 255 and remaining fields set to 0', verify_success()), - TestStep(16, f'{THcommand} MoveToHue with _Hue_ field set to 254, _TransitionTime_ field set to 100, _Direction_ field set to Shortest and remaining fields set to 0', verify_success()), + TestStep(16, f'{ + THcommand} MoveToHue with _Hue_ field set to 254, _TransitionTime_ field set to 100, _Direction_ field set to Shortest and remaining fields set to 0', verify_success()), TestStep(17, store_values('reportedCurrentHueValuesList', 'CurrentHue')), TestStep(18, verify_entry_count('reportedCurrentHueValuesList', 'CurrentHue'), entry_count_verification('reportedCurrentHueValuesList')), diff --git a/src/python_testing/TC_CGEN_2_4.py b/src/python_testing/TC_CGEN_2_4.py index 1cf2f7e8a0..7db0ddca28 100644 --- a/src/python_testing/TC_CGEN_2_4.py +++ b/src/python_testing/TC_CGEN_2_4.py @@ -46,7 +46,7 @@ from chip.ChipDeviceCtrl import CommissioningParameters from chip.exceptions import ChipStackError from chip.native import PyChipError -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts # Commissioning stage numbers - we should find a better way to match these to the C++ code diff --git a/src/python_testing/TC_CNET_1_4.py b/src/python_testing/TC_CNET_1_4.py index 7e19f8dee9..2c69456e86 100644 --- a/src/python_testing/TC_CNET_1_4.py +++ b/src/python_testing/TC_CNET_1_4.py @@ -38,7 +38,7 @@ import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts kRootEndpointId = 0 diff --git a/src/python_testing/TC_CNET_4_4.py b/src/python_testing/TC_CNET_4_4.py index 12407e6c5f..223cfdf588 100644 --- a/src/python_testing/TC_CNET_4_4.py +++ b/src/python_testing/TC_CNET_4_4.py @@ -22,7 +22,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts diff --git a/src/python_testing/TC_DA_1_2.py b/src/python_testing/TC_DA_1_2.py index 9fa60cd8bf..9bf08fe72a 100644 --- a/src/python_testing/TC_DA_1_2.py +++ b/src/python_testing/TC_DA_1_2.py @@ -40,8 +40,10 @@ import re import chip.clusters as Clusters -from basic_composition_support import BasicCompositionTests from chip.interaction_model import InteractionModelError, Status +from chip.testing.basic_composition import BasicCompositionTests +from chip.testing.matter_testing import (MatterBaseTest, TestStep, async_test_body, default_matter_test_main, hex_from_bytes, + type_matches) from chip.tlv import TLVReader from cryptography import x509 from cryptography.exceptions import InvalidSignature @@ -49,7 +51,6 @@ from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.asymmetric import ec, utils from ecdsa.curves import curve_by_name -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, hex_from_bytes, type_matches from mobly import asserts from pyasn1.codec.der.decoder import decode as der_decoder from pyasn1.error import PyAsn1Error diff --git a/src/python_testing/TC_DA_1_5.py b/src/python_testing/TC_DA_1_5.py index c08f4eb4ef..e8e6ce773c 100644 --- a/src/python_testing/TC_DA_1_5.py +++ b/src/python_testing/TC_DA_1_5.py @@ -40,12 +40,12 @@ import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.interaction_model import InteractionModelError, Status +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, hex_from_bytes, type_matches from chip.tlv import TLVReader from cryptography import x509 from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.asymmetric import ec, utils from ecdsa.curves import curve_by_name -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, hex_from_bytes, type_matches from mobly import asserts from pyasn1.codec.der.decoder import decode as der_decoder from pyasn1.error import PyAsn1Error diff --git a/src/python_testing/TC_DA_1_7.py b/src/python_testing/TC_DA_1_7.py index 1130a7b423..6678080a60 100644 --- a/src/python_testing/TC_DA_1_7.py +++ b/src/python_testing/TC_DA_1_7.py @@ -41,13 +41,13 @@ from typing import List, Optional import chip.clusters as Clusters +from chip.testing.matter_testing import (MatterBaseTest, TestStep, async_test_body, bytes_from_hex, default_matter_test_main, + hex_from_bytes) from cryptography.exceptions import InvalidSignature from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.asymmetric import ec from cryptography.hazmat.primitives.serialization import Encoding, PublicFormat from cryptography.x509 import AuthorityKeyIdentifier, Certificate, SubjectKeyIdentifier, load_der_x509_certificate -from matter_testing_support import (MatterBaseTest, TestStep, async_test_body, bytes_from_hex, default_matter_test_main, - hex_from_bytes) from mobly import asserts # Those are SDK samples that are known to be non-production. diff --git a/src/python_testing/TC_DEMTestBase.py b/src/python_testing/TC_DEMTestBase.py index da51ba2528..49c8c6a637 100644 --- a/src/python_testing/TC_DEMTestBase.py +++ b/src/python_testing/TC_DEMTestBase.py @@ -19,7 +19,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import utc_time_in_matter_epoch +from chip.testing.matter_testing import utc_time_in_matter_epoch from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_DEM_2_1.py b/src/python_testing/TC_DEM_2_1.py index 4975d3ae29..851099cb8e 100644 --- a/src/python_testing/TC_DEM_2_1.py +++ b/src/python_testing/TC_DEM_2_1.py @@ -49,7 +49,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_10.py b/src/python_testing/TC_DEM_2_10.py index 8f2e0baf35..810efdbfa2 100644 --- a/src/python_testing/TC_DEM_2_10.py +++ b/src/python_testing/TC_DEM_2_10.py @@ -50,8 +50,8 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, async_test_body, - default_matter_test_main) +from chip.testing.matter_testing import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, async_test_body, + default_matter_test_main) from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_2.py b/src/python_testing/TC_DEM_2_2.py index b5e26e4336..168417dd98 100644 --- a/src/python_testing/TC_DEM_2_2.py +++ b/src/python_testing/TC_DEM_2_2.py @@ -52,7 +52,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_3.py b/src/python_testing/TC_DEM_2_3.py index 25398b41ea..c5699c0318 100644 --- a/src/python_testing/TC_DEM_2_3.py +++ b/src/python_testing/TC_DEM_2_3.py @@ -46,7 +46,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_4.py b/src/python_testing/TC_DEM_2_4.py index 6a396fc3a3..1b591cd438 100644 --- a/src/python_testing/TC_DEM_2_4.py +++ b/src/python_testing/TC_DEM_2_4.py @@ -47,7 +47,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import Status -from matter_testing_support import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_5.py b/src/python_testing/TC_DEM_2_5.py index f7f7d75d53..c845ec1997 100644 --- a/src/python_testing/TC_DEM_2_5.py +++ b/src/python_testing/TC_DEM_2_5.py @@ -49,7 +49,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_6.py b/src/python_testing/TC_DEM_2_6.py index 2e2a96f92b..32dea4af4f 100644 --- a/src/python_testing/TC_DEM_2_6.py +++ b/src/python_testing/TC_DEM_2_6.py @@ -49,7 +49,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_7.py b/src/python_testing/TC_DEM_2_7.py index 36e7ab984a..44c65fbc58 100644 --- a/src/python_testing/TC_DEM_2_7.py +++ b/src/python_testing/TC_DEM_2_7.py @@ -49,7 +49,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_8.py b/src/python_testing/TC_DEM_2_8.py index 1f3d240b22..016778fdf1 100644 --- a/src/python_testing/TC_DEM_2_8.py +++ b/src/python_testing/TC_DEM_2_8.py @@ -49,7 +49,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_9.py b/src/python_testing/TC_DEM_2_9.py index 4541b9cc6e..05111e3b8f 100644 --- a/src/python_testing/TC_DEM_2_9.py +++ b/src/python_testing/TC_DEM_2_9.py @@ -48,7 +48,7 @@ import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DGGEN_2_4.py b/src/python_testing/TC_DGGEN_2_4.py index 27542e651d..17b068452c 100644 --- a/src/python_testing/TC_DGGEN_2_4.py +++ b/src/python_testing/TC_DGGEN_2_4.py @@ -40,8 +40,9 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError -from matter_testing_support import (MatterBaseTest, async_test_body, default_matter_test_main, matter_epoch_us_from_utc_datetime, - utc_datetime_from_matter_epoch_us, utc_datetime_from_posix_time_ms) +from chip.testing.matter_testing import (MatterBaseTest, async_test_body, default_matter_test_main, + matter_epoch_us_from_utc_datetime, utc_datetime_from_matter_epoch_us, + utc_datetime_from_posix_time_ms) from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_DGGEN_3_2.py b/src/python_testing/TC_DGGEN_3_2.py index 7e5af6c7a5..58c333e8b4 100644 --- a/src/python_testing/TC_DGGEN_3_2.py +++ b/src/python_testing/TC_DGGEN_3_2.py @@ -16,7 +16,7 @@ # import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_DGSW_2_1.py b/src/python_testing/TC_DGSW_2_1.py index 46ed696da9..6338932725 100644 --- a/src/python_testing/TC_DGSW_2_1.py +++ b/src/python_testing/TC_DGSW_2_1.py @@ -36,7 +36,7 @@ # import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_DRLK_2_12.py b/src/python_testing/TC_DRLK_2_12.py index cf63bd810a..342fbc64f6 100644 --- a/src/python_testing/TC_DRLK_2_12.py +++ b/src/python_testing/TC_DRLK_2_12.py @@ -35,8 +35,8 @@ # quiet: true # === END CI TEST ARGUMENTS === +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from drlk_2_x_common import DRLK_COMMON -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main # Configurable parameters: # - userIndex: userIndex to use when creating a user on the DUT for testing purposes diff --git a/src/python_testing/TC_DRLK_2_13.py b/src/python_testing/TC_DRLK_2_13.py index dc1b69da22..809e278517 100644 --- a/src/python_testing/TC_DRLK_2_13.py +++ b/src/python_testing/TC_DRLK_2_13.py @@ -43,7 +43,7 @@ from chip.clusters.Attribute import EventPriority from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_DRLK_2_2.py b/src/python_testing/TC_DRLK_2_2.py index 84a511b98d..f9f192f18e 100644 --- a/src/python_testing/TC_DRLK_2_2.py +++ b/src/python_testing/TC_DRLK_2_2.py @@ -35,8 +35,8 @@ # quiet: true # === END CI TEST ARGUMENTS === +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from drlk_2_x_common import DRLK_COMMON -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main # Configurable parameters: # - userIndex: userIndex to use when creating a user on the DUT for testing purposes diff --git a/src/python_testing/TC_DRLK_2_3.py b/src/python_testing/TC_DRLK_2_3.py index 75690865cf..114f41ab9c 100644 --- a/src/python_testing/TC_DRLK_2_3.py +++ b/src/python_testing/TC_DRLK_2_3.py @@ -35,8 +35,8 @@ # quiet: true # === END CI TEST ARGUMENTS === +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from drlk_2_x_common import DRLK_COMMON -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main # Configurable parameters: # - userIndex: userIndex to use when creating a user on the DUT for testing purposes diff --git a/src/python_testing/TC_DRLK_2_5.py b/src/python_testing/TC_DRLK_2_5.py index defe78eafd..84451d2600 100644 --- a/src/python_testing/TC_DRLK_2_5.py +++ b/src/python_testing/TC_DRLK_2_5.py @@ -38,7 +38,7 @@ 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, type_matches +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_DRLK_2_9.py b/src/python_testing/TC_DRLK_2_9.py index b92eaf42b5..fb294b724f 100644 --- a/src/python_testing/TC_DRLK_2_9.py +++ b/src/python_testing/TC_DRLK_2_9.py @@ -41,8 +41,8 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from drlk_2_x_common import DRLK_COMMON -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_DeviceBasicComposition.py b/src/python_testing/TC_DeviceBasicComposition.py index 9ff05d4ab0..e0e9d86320 100644 --- a/src/python_testing/TC_DeviceBasicComposition.py +++ b/src/python_testing/TC_DeviceBasicComposition.py @@ -103,19 +103,19 @@ import chip.clusters as Clusters import chip.clusters.ClusterObjects import chip.tlv -from basic_composition_support import BasicCompositionTests from chip import ChipUtility from chip.clusters.Attribute import ValueDecodeFailure from chip.clusters.ClusterObjects import ClusterAttributeDescriptor, ClusterObjectFieldDescriptor from chip.interaction_model import InteractionModelError, Status +from chip.testing.basic_composition import BasicCompositionTests +from chip.testing.global_attribute_ids import GlobalAttributeIds +from chip.testing.matter_testing import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, MatterBaseTest, TestStep, + async_test_body, default_matter_test_main) +from chip.testing.taglist_and_topology_test import (create_device_type_list_for_root, create_device_type_lists, + find_tag_list_problems, find_tree_roots, flat_list_ok, + get_direct_children_of_root, parts_list_cycles, separate_endpoint_types) from chip.tlv import uint -from global_attribute_ids import GlobalAttributeIds -from matter_testing_support import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, MatterBaseTest, TestStep, - async_test_body, default_matter_test_main) from mobly import asserts -from taglist_and_topology_test_support import (create_device_type_list_for_root, create_device_type_lists, find_tag_list_problems, - find_tree_roots, flat_list_ok, get_direct_children_of_root, parts_list_cycles, - separate_endpoint_types) def check_int_in_range(min_value: int, max_value: int, allow_null: bool = False) -> Callable: @@ -511,12 +511,14 @@ class RequiredMandatoryAttribute: attribute_id=manufacturer_value) if suffix > attribute_standard_range_max and suffix < global_range_min: self.record_error(self.get_test_name(), location=location, - problem=f"Manufacturer attribute in undefined range {manufacturer_value} in cluster {cluster_id}", + problem=f"Manufacturer attribute in undefined range { + manufacturer_value} in cluster {cluster_id}", spec_location=f"Cluster {cluster_id}") success = False elif suffix >= global_range_min: self.record_error(self.get_test_name(), location=location, - problem=f"Manufacturer attribute in global range {manufacturer_value} in cluster {cluster_id}", + problem=f"Manufacturer attribute in global range { + manufacturer_value} in cluster {cluster_id}", spec_location=f"Cluster {cluster_id}") success = False @@ -813,7 +815,8 @@ def test_TC_DESC_2_2(self): for ep, problem in problems.items(): location = AttributePathLocation(endpoint_id=ep, cluster_id=Clusters.Descriptor.id, attribute_id=Clusters.Descriptor.Attributes.TagList.attribute_id) - msg = f'problem on ep {ep}: missing feature = {problem.missing_feature}, missing attribute = {problem.missing_attribute}, duplicates = {problem.duplicates}, same_tags = {problem.same_tag}' + msg = f'problem on ep {ep}: missing feature = {problem.missing_feature}, missing attribute = { + problem.missing_attribute}, duplicates = {problem.duplicates}, same_tags = {problem.same_tag}' self.record_error(self.get_test_name(), location=location, problem=msg, spec_location="Descriptor TagList") self.print_step(2, "Identify all the direct children of the root node endpoint") diff --git a/src/python_testing/TC_DeviceConformance.py b/src/python_testing/TC_DeviceConformance.py index 8e700b49ab..a3e350bdfb 100644 --- a/src/python_testing/TC_DeviceConformance.py +++ b/src/python_testing/TC_DeviceConformance.py @@ -39,16 +39,16 @@ from typing import Callable import chip.clusters as Clusters -from basic_composition_support import BasicCompositionTests +from chip.testing.basic_composition import BasicCompositionTests +from chip.testing.choice_conformance import (evaluate_attribute_choice_conformance, evaluate_command_choice_conformance, + evaluate_feature_choice_conformance) +from chip.testing.conformance import ConformanceDecision, conformance_allowed +from chip.testing.global_attribute_ids import (ClusterIdType, DeviceTypeIdType, GlobalAttributeIds, cluster_id_type, + device_type_id_type, is_valid_device_type_id) +from chip.testing.matter_testing import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, DeviceTypePathLocation, + MatterBaseTest, ProblemNotice, ProblemSeverity, async_test_body, default_matter_test_main) +from chip.testing.spec_parsing import CommandType, build_xml_clusters, build_xml_device_types from chip.tlv import uint -from choice_conformance_support import (evaluate_attribute_choice_conformance, evaluate_command_choice_conformance, - evaluate_feature_choice_conformance) -from conformance_support import ConformanceDecision, conformance_allowed -from global_attribute_ids import (ClusterIdType, DeviceTypeIdType, GlobalAttributeIds, cluster_id_type, device_type_id_type, - is_valid_device_type_id) -from matter_testing_support import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, DeviceTypePathLocation, - MatterBaseTest, ProblemNotice, ProblemSeverity, async_test_body, default_matter_test_main) -from spec_parsing_support import CommandType, build_xml_clusters, build_xml_device_types class DeviceConformanceTests(BasicCompositionTests): diff --git a/src/python_testing/TC_ECOINFO_2_1.py b/src/python_testing/TC_ECOINFO_2_1.py index 1cb6ec203a..a0adf75ac4 100644 --- a/src/python_testing/TC_ECOINFO_2_1.py +++ b/src/python_testing/TC_ECOINFO_2_1.py @@ -47,8 +47,8 @@ from chip.clusters.Types import NullValue from chip.interaction_model import Status from chip.testing.apps import AppServerSubprocess +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from chip.tlv import uint -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts diff --git a/src/python_testing/TC_ECOINFO_2_2.py b/src/python_testing/TC_ECOINFO_2_2.py index 85868a9468..403544bf4f 100644 --- a/src/python_testing/TC_ECOINFO_2_2.py +++ b/src/python_testing/TC_ECOINFO_2_2.py @@ -46,7 +46,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status from chip.testing.apps import AppServerSubprocess -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts _DEVICE_TYPE_AGGREGGATOR = 0x000E diff --git a/src/python_testing/TC_EEM_2_1.py b/src/python_testing/TC_EEM_2_1.py index 0b6b4809a4..653bd942a9 100644 --- a/src/python_testing/TC_EEM_2_1.py +++ b/src/python_testing/TC_EEM_2_1.py @@ -43,7 +43,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EnergyReporting_Utils import EnergyReportingBaseTestHelper diff --git a/src/python_testing/TC_EEM_2_2.py b/src/python_testing/TC_EEM_2_2.py index 6058aa34c5..408cd85adb 100644 --- a/src/python_testing/TC_EEM_2_2.py +++ b/src/python_testing/TC_EEM_2_2.py @@ -41,7 +41,7 @@ import time -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EnergyReporting_Utils import EnergyReportingBaseTestHelper diff --git a/src/python_testing/TC_EEM_2_3.py b/src/python_testing/TC_EEM_2_3.py index 6e8bd7d9f5..69a41b08e0 100644 --- a/src/python_testing/TC_EEM_2_3.py +++ b/src/python_testing/TC_EEM_2_3.py @@ -41,7 +41,7 @@ import time -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EnergyReporting_Utils import EnergyReportingBaseTestHelper diff --git a/src/python_testing/TC_EEM_2_4.py b/src/python_testing/TC_EEM_2_4.py index fb5d5f6b36..0f67fb0405 100644 --- a/src/python_testing/TC_EEM_2_4.py +++ b/src/python_testing/TC_EEM_2_4.py @@ -41,7 +41,7 @@ import time -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EnergyReporting_Utils import EnergyReportingBaseTestHelper diff --git a/src/python_testing/TC_EEM_2_5.py b/src/python_testing/TC_EEM_2_5.py index 1408e2b9f6..43cb2cddf8 100644 --- a/src/python_testing/TC_EEM_2_5.py +++ b/src/python_testing/TC_EEM_2_5.py @@ -41,7 +41,7 @@ import time -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EnergyReporting_Utils import EnergyReportingBaseTestHelper diff --git a/src/python_testing/TC_EEVSE_2_2.py b/src/python_testing/TC_EEVSE_2_2.py index 61e52ed0be..144bfd82d3 100644 --- a/src/python_testing/TC_EEVSE_2_2.py +++ b/src/python_testing/TC_EEVSE_2_2.py @@ -46,7 +46,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EEVSE_Utils import EEVSEBaseTestHelper diff --git a/src/python_testing/TC_EEVSE_2_3.py b/src/python_testing/TC_EEVSE_2_3.py index 92005f345b..6494f4a7f1 100644 --- a/src/python_testing/TC_EEVSE_2_3.py +++ b/src/python_testing/TC_EEVSE_2_3.py @@ -46,7 +46,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import Status -from matter_testing_support import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EEVSE_Utils import EEVSEBaseTestHelper @@ -191,7 +191,7 @@ def compute_expected_target_time_as_epoch_s(self, minutes_past_midnight): logger.info( f"minutesPastMidnight = {minutes_past_midnight} => " - f"{int(minutes_past_midnight/60)}:{int(minutes_past_midnight%60)}" + f"{int(minutes_past_midnight/60)}:{int(minutes_past_midnight % 60)}" f" Expected target_time = {target_time}") target_time_delta = target_time - \ diff --git a/src/python_testing/TC_EEVSE_2_4.py b/src/python_testing/TC_EEVSE_2_4.py index aaebf642b1..10355debd0 100644 --- a/src/python_testing/TC_EEVSE_2_4.py +++ b/src/python_testing/TC_EEVSE_2_4.py @@ -45,7 +45,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_EEVSE_Utils import EEVSEBaseTestHelper logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_EEVSE_2_5.py b/src/python_testing/TC_EEVSE_2_5.py index b25cfe16ce..4571cfb363 100644 --- a/src/python_testing/TC_EEVSE_2_5.py +++ b/src/python_testing/TC_EEVSE_2_5.py @@ -45,7 +45,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import Status -from matter_testing_support import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_EEVSE_Utils import EEVSEBaseTestHelper logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_EEVSE_2_6.py b/src/python_testing/TC_EEVSE_2_6.py index 8f809b4ada..d66ff60bf6 100644 --- a/src/python_testing/TC_EEVSE_2_6.py +++ b/src/python_testing/TC_EEVSE_2_6.py @@ -45,8 +45,8 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import (ClusterAttributeChangeAccumulator, EventChangeCallback, MatterBaseTest, TestStep, - async_test_body, default_matter_test_main) +from chip.testing.matter_testing import (ClusterAttributeChangeAccumulator, EventChangeCallback, MatterBaseTest, TestStep, + async_test_body, default_matter_test_main) from mobly import asserts from TC_EEVSE_Utils import EEVSEBaseTestHelper diff --git a/src/python_testing/TC_EPM_2_1.py b/src/python_testing/TC_EPM_2_1.py index f12cafea66..0f3c74e662 100644 --- a/src/python_testing/TC_EPM_2_1.py +++ b/src/python_testing/TC_EPM_2_1.py @@ -42,7 +42,7 @@ import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EnergyReporting_Utils import EnergyReportingBaseTestHelper @@ -148,7 +148,8 @@ async def test_TC_EPM_2_1(self): "minMeasuredValue must be the same as 1st accuracyRange rangeMin") for index, range_entry in enumerate(measurement.accuracyRanges): - logging.info(f" [{index}] rangeMin:{range_entry.rangeMin} rangeMax:{range_entry.rangeMax} percentMax:{range_entry.percentMax} percentMin:{range_entry.percentMin} percentTypical:{range_entry.percentTypical} fixedMax:{range_entry.fixedMax} fixedMin:{range_entry.fixedMin} fixedTypical:{range_entry.fixedTypical}") + logging.info(f" [{index}] rangeMin: {range_entry.rangeMin} rangeMax: {range_entry.rangeMax} percentMax: {range_entry.percentMax} percentMin: { + range_entry.percentMin} percentTypical: {range_entry.percentTypical} fixedMax: {range_entry.fixedMax} fixedMin: {range_entry.fixedMin} fixedTypical: {range_entry.fixedTypical}") asserts.assert_greater( range_entry.rangeMax, range_entry.rangeMin, "rangeMax should be > rangeMin") if index == 0: diff --git a/src/python_testing/TC_EPM_2_2.py b/src/python_testing/TC_EPM_2_2.py index 97e9e047d2..d817042753 100644 --- a/src/python_testing/TC_EPM_2_2.py +++ b/src/python_testing/TC_EPM_2_2.py @@ -42,7 +42,7 @@ import logging import time -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EnergyReporting_Utils import EnergyReportingBaseTestHelper diff --git a/src/python_testing/TC_EWATERHTR_2_1.py b/src/python_testing/TC_EWATERHTR_2_1.py index ced3b16b3d..82c9e93dad 100644 --- a/src/python_testing/TC_EWATERHTR_2_1.py +++ b/src/python_testing/TC_EWATERHTR_2_1.py @@ -45,7 +45,7 @@ import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EWATERHTRBase import EWATERHTRBase diff --git a/src/python_testing/TC_EWATERHTR_2_2.py b/src/python_testing/TC_EWATERHTR_2_2.py index 11e8d545b5..1bd7185b1f 100644 --- a/src/python_testing/TC_EWATERHTR_2_2.py +++ b/src/python_testing/TC_EWATERHTR_2_2.py @@ -47,7 +47,7 @@ import time import chip.clusters as Clusters -from matter_testing_support import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EWATERHTRBase import EWATERHTRBase diff --git a/src/python_testing/TC_EWATERHTR_2_3.py b/src/python_testing/TC_EWATERHTR_2_3.py index 5f7df8c160..0f1c3deae6 100644 --- a/src/python_testing/TC_EWATERHTR_2_3.py +++ b/src/python_testing/TC_EWATERHTR_2_3.py @@ -45,7 +45,7 @@ import logging import chip.clusters as Clusters -from matter_testing_support import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EWATERHTRBase import EWATERHTRBase diff --git a/src/python_testing/TC_FAN_3_1.py b/src/python_testing/TC_FAN_3_1.py index f8322506e6..483be894ba 100644 --- a/src/python_testing/TC_FAN_3_1.py +++ b/src/python_testing/TC_FAN_3_1.py @@ -39,7 +39,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_FAN_3_2.py b/src/python_testing/TC_FAN_3_2.py index 736c97096e..799510eeea 100644 --- a/src/python_testing/TC_FAN_3_2.py +++ b/src/python_testing/TC_FAN_3_2.py @@ -39,7 +39,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_FAN_3_3.py b/src/python_testing/TC_FAN_3_3.py index 935811de21..7a4dde3f6c 100644 --- a/src/python_testing/TC_FAN_3_3.py +++ b/src/python_testing/TC_FAN_3_3.py @@ -38,7 +38,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_FAN_3_4.py b/src/python_testing/TC_FAN_3_4.py index 722339357b..989680ed6b 100644 --- a/src/python_testing/TC_FAN_3_4.py +++ b/src/python_testing/TC_FAN_3_4.py @@ -38,7 +38,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts # import time diff --git a/src/python_testing/TC_FAN_3_5.py b/src/python_testing/TC_FAN_3_5.py index d03f99e55f..26dfc3e52f 100644 --- a/src/python_testing/TC_FAN_3_5.py +++ b/src/python_testing/TC_FAN_3_5.py @@ -39,7 +39,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_ICDM_2_1.py b/src/python_testing/TC_ICDM_2_1.py index 35d1cb62c0..8d7f6d5ed8 100644 --- a/src/python_testing/TC_ICDM_2_1.py +++ b/src/python_testing/TC_ICDM_2_1.py @@ -39,7 +39,7 @@ import re import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_ICDM_3_1.py b/src/python_testing/TC_ICDM_3_1.py index d46d72553d..58181a6588 100644 --- a/src/python_testing/TC_ICDM_3_1.py +++ b/src/python_testing/TC_ICDM_3_1.py @@ -41,7 +41,7 @@ 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 chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_ICDM_3_2.py b/src/python_testing/TC_ICDM_3_2.py index 924c6f4a01..d9800d65b7 100644 --- a/src/python_testing/TC_ICDM_3_2.py +++ b/src/python_testing/TC_ICDM_3_2.py @@ -42,7 +42,7 @@ 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 chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_ICDM_3_3.py b/src/python_testing/TC_ICDM_3_3.py index bc1d698071..d261e53904 100644 --- a/src/python_testing/TC_ICDM_3_3.py +++ b/src/python_testing/TC_ICDM_3_3.py @@ -41,7 +41,7 @@ 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 chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_ICDM_3_4.py b/src/python_testing/TC_ICDM_3_4.py index 4ebb32525c..8ff2a57037 100644 --- a/src/python_testing/TC_ICDM_3_4.py +++ b/src/python_testing/TC_ICDM_3_4.py @@ -40,8 +40,8 @@ import time import chip.clusters as Clusters -from matter_testing_support import (MatterBaseTest, MatterStackState, MatterTestConfig, TestStep, async_test_body, - default_matter_test_main) +from chip.testing.matter_testing import (MatterBaseTest, MatterStackState, MatterTestConfig, TestStep, async_test_body, + default_matter_test_main) from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_ICDM_5_1.py b/src/python_testing/TC_ICDM_5_1.py index 4b7222b690..dacfe58c8b 100644 --- a/src/python_testing/TC_ICDM_5_1.py +++ b/src/python_testing/TC_ICDM_5_1.py @@ -40,7 +40,7 @@ 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 chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mdns_discovery import mdns_discovery from mobly import asserts diff --git a/src/python_testing/TC_ICDManagementCluster.py b/src/python_testing/TC_ICDManagementCluster.py index 07c889a6ea..c0437cb809 100644 --- a/src/python_testing/TC_ICDManagementCluster.py +++ b/src/python_testing/TC_ICDManagementCluster.py @@ -42,7 +42,7 @@ from enum import IntEnum import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts # Assumes `--enable-key 000102030405060708090a0b0c0d0e0f` on Linux app command line, or a DUT diff --git a/src/python_testing/TC_IDM_1_2.py b/src/python_testing/TC_IDM_1_2.py index 7bfb97c22e..a1db9bac83 100644 --- a/src/python_testing/TC_IDM_1_2.py +++ b/src/python_testing/TC_IDM_1_2.py @@ -44,7 +44,7 @@ from chip import ChipUtility from chip.exceptions import ChipStackError from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, type_matches +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, type_matches from mobly import asserts diff --git a/src/python_testing/TC_IDM_1_4.py b/src/python_testing/TC_IDM_1_4.py index b00de41f37..74194135de 100644 --- a/src/python_testing/TC_IDM_1_4.py +++ b/src/python_testing/TC_IDM_1_4.py @@ -44,7 +44,7 @@ import chip.clusters as Clusters from chip.exceptions import ChipStackError from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts # If DUT supports `MaxPathsPerInvoke > 1`, additional command line argument diff --git a/src/python_testing/TC_IDM_4_2.py b/src/python_testing/TC_IDM_4_2.py index d9e876bcd0..0f4cd513e3 100644 --- a/src/python_testing/TC_IDM_4_2.py +++ b/src/python_testing/TC_IDM_4_2.py @@ -44,7 +44,7 @@ from chip.clusters.Attribute import AttributePath, TypedAttributePath from chip.exceptions import ChipStackError from chip.interaction_model import Status -from matter_testing_support import AttributeChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import AttributeChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts ''' diff --git a/src/python_testing/TC_LVL_2_3.py b/src/python_testing/TC_LVL_2_3.py index 94c33d58c0..d120bb7169 100644 --- a/src/python_testing/TC_LVL_2_3.py +++ b/src/python_testing/TC_LVL_2_3.py @@ -41,8 +41,8 @@ import chip.clusters as Clusters import test_plan_support -from matter_testing_support import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, default_matter_test_main, - has_cluster, run_if_endpoint_matches) +from chip.testing.matter_testing import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, default_matter_test_main, + has_cluster, run_if_endpoint_matches) from mobly import asserts diff --git a/src/python_testing/TC_MCORE_FS_1_1.py b/src/python_testing/TC_MCORE_FS_1_1.py index bd33e693dc..3fd126fc52 100755 --- a/src/python_testing/TC_MCORE_FS_1_1.py +++ b/src/python_testing/TC_MCORE_FS_1_1.py @@ -48,7 +48,7 @@ import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.testing.apps import AppServerSubprocess -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_MCORE_FS_1_2.py b/src/python_testing/TC_MCORE_FS_1_2.py index a7d318ca65..f806db4d09 100644 --- a/src/python_testing/TC_MCORE_FS_1_2.py +++ b/src/python_testing/TC_MCORE_FS_1_2.py @@ -51,8 +51,8 @@ import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.testing.apps import AppServerSubprocess +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches 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 diff --git a/src/python_testing/TC_MCORE_FS_1_3.py b/src/python_testing/TC_MCORE_FS_1_3.py index 1b17aec1fd..39042271e1 100644 --- a/src/python_testing/TC_MCORE_FS_1_3.py +++ b/src/python_testing/TC_MCORE_FS_1_3.py @@ -51,7 +51,7 @@ from chip import ChipDeviceCtrl from chip.interaction_model import Status from chip.testing.apps import AppServerSubprocess -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts diff --git a/src/python_testing/TC_MCORE_FS_1_4.py b/src/python_testing/TC_MCORE_FS_1_4.py index 74a8becdf7..795e81cf2f 100644 --- a/src/python_testing/TC_MCORE_FS_1_4.py +++ b/src/python_testing/TC_MCORE_FS_1_4.py @@ -50,8 +50,8 @@ from chip import ChipDeviceCtrl from chip.interaction_model import Status from chip.testing.apps import AppServerSubprocess +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from chip.testing.tasks import Subprocess -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts diff --git a/src/python_testing/TC_MCORE_FS_1_5.py b/src/python_testing/TC_MCORE_FS_1_5.py index 57ae214a5d..59549fd0bc 100755 --- a/src/python_testing/TC_MCORE_FS_1_5.py +++ b/src/python_testing/TC_MCORE_FS_1_5.py @@ -51,8 +51,8 @@ import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.testing.apps import AppServerSubprocess +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches 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 diff --git a/src/python_testing/TC_MWOCTRL_2_1.py b/src/python_testing/TC_MWOCTRL_2_1.py index 57c51fa98d..6f913578cb 100644 --- a/src/python_testing/TC_MWOCTRL_2_1.py +++ b/src/python_testing/TC_MWOCTRL_2_1.py @@ -37,7 +37,7 @@ 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 chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts # This test requires several additional command line arguments diff --git a/src/python_testing/TC_MWOCTRL_2_2.py b/src/python_testing/TC_MWOCTRL_2_2.py index 35eef081a9..4559689640 100644 --- a/src/python_testing/TC_MWOCTRL_2_2.py +++ b/src/python_testing/TC_MWOCTRL_2_2.py @@ -39,7 +39,7 @@ 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 chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts # This test requires several additional command line arguments diff --git a/src/python_testing/TC_MWOCTRL_2_4.py b/src/python_testing/TC_MWOCTRL_2_4.py index 9e11724975..e05c4a5bd5 100644 --- a/src/python_testing/TC_MWOCTRL_2_4.py +++ b/src/python_testing/TC_MWOCTRL_2_4.py @@ -39,7 +39,7 @@ 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 chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts # This test requires several additional command line arguments diff --git a/src/python_testing/TC_MWOM_1_2.py b/src/python_testing/TC_MWOM_1_2.py index 8a7762337e..5cad6ce013 100644 --- a/src/python_testing/TC_MWOM_1_2.py +++ b/src/python_testing/TC_MWOM_1_2.py @@ -37,7 +37,7 @@ import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_OCC_2_1.py b/src/python_testing/TC_OCC_2_1.py index 885ec6b16c..d831d486d2 100644 --- a/src/python_testing/TC_OCC_2_1.py +++ b/src/python_testing/TC_OCC_2_1.py @@ -43,7 +43,7 @@ import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_OCC_2_2.py b/src/python_testing/TC_OCC_2_2.py index 463b8136d5..bf5e97ea5e 100644 --- a/src/python_testing/TC_OCC_2_2.py +++ b/src/python_testing/TC_OCC_2_2.py @@ -37,7 +37,7 @@ # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts @@ -133,7 +133,8 @@ async def test_TC_OCC_2_2(self): asserts.assert_equal( (occupancy_sensor_type_bitmap_dut & sensor_bit) != 0, (feature_map & feature_bit) != 0, - f"Feature bit and sensor bitmap must be equal for {name} (BITMAP: 0x{occupancy_sensor_type_bitmap_dut:02X}, FEATUREMAP: 0x{feature_map:02X})" + f"Feature bit and sensor bitmap must be equal for { + name}(BITMAP: 0x{occupancy_sensor_type_bitmap_dut: 02X}, FEATUREMAP: 0x{feature_map: 02X})" ) diff --git a/src/python_testing/TC_OCC_2_3.py b/src/python_testing/TC_OCC_2_3.py index 9c6cb80d9a..8d4b53f429 100644 --- a/src/python_testing/TC_OCC_2_3.py +++ b/src/python_testing/TC_OCC_2_3.py @@ -39,7 +39,7 @@ import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_OCC_3_1.py b/src/python_testing/TC_OCC_3_1.py index b6ba0ead01..cce0a2f697 100644 --- a/src/python_testing/TC_OCC_3_1.py +++ b/src/python_testing/TC_OCC_3_1.py @@ -43,8 +43,8 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import (ClusterAttributeChangeAccumulator, EventChangeCallback, MatterBaseTest, TestStep, - async_test_body, await_sequence_of_reports, default_matter_test_main) +from chip.testing.matter_testing import (ClusterAttributeChangeAccumulator, EventChangeCallback, MatterBaseTest, TestStep, + async_test_body, await_sequence_of_reports, default_matter_test_main) from mobly import asserts diff --git a/src/python_testing/TC_OCC_3_2.py b/src/python_testing/TC_OCC_3_2.py index d4e5f18662..3a5ca17069 100644 --- a/src/python_testing/TC_OCC_3_2.py +++ b/src/python_testing/TC_OCC_3_2.py @@ -44,8 +44,8 @@ import time import chip.clusters as Clusters -from matter_testing_support import (AttributeValue, ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, async_test_body, - await_sequence_of_reports, default_matter_test_main) +from chip.testing.matter_testing import (AttributeValue, ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, + async_test_body, await_sequence_of_reports, default_matter_test_main) from mobly import asserts diff --git a/src/python_testing/TC_OPCREDS_3_1.py b/src/python_testing/TC_OPCREDS_3_1.py index be21c6d7d4..1506d2a712 100644 --- a/src/python_testing/TC_OPCREDS_3_1.py +++ b/src/python_testing/TC_OPCREDS_3_1.py @@ -42,8 +42,8 @@ from chip import ChipDeviceCtrl from chip.exceptions import ChipStackError from chip.interaction_model import InteractionModelError, Status +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from chip.tlv import TLVReader, TLVWriter -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_OPCREDS_3_2.py b/src/python_testing/TC_OPCREDS_3_2.py index 91e2958fb0..2bfc214665 100644 --- a/src/python_testing/TC_OPCREDS_3_2.py +++ b/src/python_testing/TC_OPCREDS_3_2.py @@ -36,9 +36,9 @@ # === END CI TEST ARGUMENTS === import chip.clusters as Clusters +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from chip.tlv import TLVReader from chip.utils import CommissioningBuildingBlocks -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from test_plan_support import (commission_from_existing, commission_if_required, read_attribute, remove_fabric, verify_commissioning_successful, verify_success) diff --git a/src/python_testing/TC_OPSTATE_2_1.py b/src/python_testing/TC_OPSTATE_2_1.py index 1b6966a09a..060b71d85e 100644 --- a/src/python_testing/TC_OPSTATE_2_1.py +++ b/src/python_testing/TC_OPSTATE_2_1.py @@ -37,7 +37,7 @@ # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OPSTATE_2_2.py b/src/python_testing/TC_OPSTATE_2_2.py index 8617d3ddd6..f0ed8f214d 100644 --- a/src/python_testing/TC_OPSTATE_2_2.py +++ b/src/python_testing/TC_OPSTATE_2_2.py @@ -38,7 +38,7 @@ # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OPSTATE_2_3.py b/src/python_testing/TC_OPSTATE_2_3.py index 3671747dee..d35aa6e61e 100644 --- a/src/python_testing/TC_OPSTATE_2_3.py +++ b/src/python_testing/TC_OPSTATE_2_3.py @@ -39,7 +39,7 @@ import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OPSTATE_2_4.py b/src/python_testing/TC_OPSTATE_2_4.py index d468227781..ec2c7c17da 100644 --- a/src/python_testing/TC_OPSTATE_2_4.py +++ b/src/python_testing/TC_OPSTATE_2_4.py @@ -39,7 +39,7 @@ import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OPSTATE_2_5.py b/src/python_testing/TC_OPSTATE_2_5.py index 687f4d21b0..89a2462a2b 100644 --- a/src/python_testing/TC_OPSTATE_2_5.py +++ b/src/python_testing/TC_OPSTATE_2_5.py @@ -39,7 +39,7 @@ import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OPSTATE_2_6.py b/src/python_testing/TC_OPSTATE_2_6.py index 9441569c87..0b9e1ec3bb 100644 --- a/src/python_testing/TC_OPSTATE_2_6.py +++ b/src/python_testing/TC_OPSTATE_2_6.py @@ -39,7 +39,7 @@ import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OVENOPSTATE_2_1.py b/src/python_testing/TC_OVENOPSTATE_2_1.py index 6bf7226986..d830a416c0 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_1.py +++ b/src/python_testing/TC_OVENOPSTATE_2_1.py @@ -38,7 +38,7 @@ import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OVENOPSTATE_2_2.py b/src/python_testing/TC_OVENOPSTATE_2_2.py index 2fa1215bd1..55afad11be 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_2.py +++ b/src/python_testing/TC_OVENOPSTATE_2_2.py @@ -38,7 +38,7 @@ # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OVENOPSTATE_2_3.py b/src/python_testing/TC_OVENOPSTATE_2_3.py index 815fcef97b..329bceb1fb 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_3.py +++ b/src/python_testing/TC_OVENOPSTATE_2_3.py @@ -38,7 +38,7 @@ # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OVENOPSTATE_2_4.py b/src/python_testing/TC_OVENOPSTATE_2_4.py index 892bf28f0d..ffc639390e 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_4.py +++ b/src/python_testing/TC_OVENOPSTATE_2_4.py @@ -38,7 +38,7 @@ # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OVENOPSTATE_2_5.py b/src/python_testing/TC_OVENOPSTATE_2_5.py index 4fd9ef9271..42edca72f3 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_5.py +++ b/src/python_testing/TC_OVENOPSTATE_2_5.py @@ -39,7 +39,7 @@ import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OVENOPSTATE_2_6.py b/src/python_testing/TC_OVENOPSTATE_2_6.py index db4b390027..2770625bb7 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_6.py +++ b/src/python_testing/TC_OVENOPSTATE_2_6.py @@ -39,7 +39,7 @@ import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OpstateCommon.py b/src/python_testing/TC_OpstateCommon.py index c697c7ab5f..557b7606cc 100644 --- a/src/python_testing/TC_OpstateCommon.py +++ b/src/python_testing/TC_OpstateCommon.py @@ -27,7 +27,7 @@ from chip.clusters.Attribute import EventReadResult, SubscriptionTransaction from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import ClusterAttributeChangeAccumulator, EventChangeCallback, TestStep +from chip.testing.matter_testing import ClusterAttributeChangeAccumulator, EventChangeCallback, TestStep from mobly import asserts diff --git a/src/python_testing/TC_PS_2_3.py b/src/python_testing/TC_PS_2_3.py index dbff20e6f4..13f4420b0a 100644 --- a/src/python_testing/TC_PS_2_3.py +++ b/src/python_testing/TC_PS_2_3.py @@ -38,8 +38,8 @@ import time import chip.clusters as Clusters -from matter_testing_support import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, async_test_body, - default_matter_test_main) +from chip.testing.matter_testing import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, async_test_body, + default_matter_test_main) from mobly import asserts diff --git a/src/python_testing/TC_PWRTL_2_1.py b/src/python_testing/TC_PWRTL_2_1.py index 639bd3dd9a..3de09c6e93 100644 --- a/src/python_testing/TC_PWRTL_2_1.py +++ b/src/python_testing/TC_PWRTL_2_1.py @@ -37,7 +37,7 @@ import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_RR_1_1.py b/src/python_testing/TC_RR_1_1.py index 2785171f94..0cbf0274c5 100644 --- a/src/python_testing/TC_RR_1_1.py +++ b/src/python_testing/TC_RR_1_1.py @@ -45,8 +45,8 @@ import chip.clusters as Clusters from chip.interaction_model import Status as StatusEnum +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from chip.utils import CommissioningBuildingBlocks -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts from TC_SC_3_6 import AttributeChangeAccumulator, ResubscriptionCatcher diff --git a/src/python_testing/TC_RVCCLEANM_1_2.py b/src/python_testing/TC_RVCCLEANM_1_2.py index 9e4bca4762..3dfd75f4f4 100644 --- a/src/python_testing/TC_RVCCLEANM_1_2.py +++ b/src/python_testing/TC_RVCCLEANM_1_2.py @@ -39,7 +39,7 @@ import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_RVCCLEANM_2_1.py b/src/python_testing/TC_RVCCLEANM_2_1.py index 2c4ddd1dc7..5234a74685 100644 --- a/src/python_testing/TC_RVCCLEANM_2_1.py +++ b/src/python_testing/TC_RVCCLEANM_2_1.py @@ -41,7 +41,7 @@ import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, type_matches +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, type_matches from mobly import asserts # This test requires several additional command line arguments diff --git a/src/python_testing/TC_RVCCLEANM_2_2.py b/src/python_testing/TC_RVCCLEANM_2_2.py index 5262465555..7352d03e24 100644 --- a/src/python_testing/TC_RVCCLEANM_2_2.py +++ b/src/python_testing/TC_RVCCLEANM_2_2.py @@ -39,7 +39,7 @@ import enum import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, type_matches +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, type_matches from mobly import asserts diff --git a/src/python_testing/TC_RVCOPSTATE_2_1.py b/src/python_testing/TC_RVCOPSTATE_2_1.py index ae3e6c3930..48715c3b7a 100644 --- a/src/python_testing/TC_RVCOPSTATE_2_1.py +++ b/src/python_testing/TC_RVCOPSTATE_2_1.py @@ -40,7 +40,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_RVCOPSTATE_2_3.py b/src/python_testing/TC_RVCOPSTATE_2_3.py index 60bbed18bd..1b522117b9 100644 --- a/src/python_testing/TC_RVCOPSTATE_2_3.py +++ b/src/python_testing/TC_RVCOPSTATE_2_3.py @@ -41,7 +41,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, type_matches +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, type_matches from mobly import asserts diff --git a/src/python_testing/TC_RVCOPSTATE_2_4.py b/src/python_testing/TC_RVCOPSTATE_2_4.py index 458b3cf740..ad515dbff1 100644 --- a/src/python_testing/TC_RVCOPSTATE_2_4.py +++ b/src/python_testing/TC_RVCOPSTATE_2_4.py @@ -39,7 +39,7 @@ import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, type_matches +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, type_matches from mobly import asserts diff --git a/src/python_testing/TC_RVCRUNM_1_2.py b/src/python_testing/TC_RVCRUNM_1_2.py index d3040fdb6b..90db1601b1 100644 --- a/src/python_testing/TC_RVCRUNM_1_2.py +++ b/src/python_testing/TC_RVCRUNM_1_2.py @@ -39,7 +39,7 @@ import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_RVCRUNM_2_1.py b/src/python_testing/TC_RVCRUNM_2_1.py index 850faf052a..55c37c7094 100644 --- a/src/python_testing/TC_RVCRUNM_2_1.py +++ b/src/python_testing/TC_RVCRUNM_2_1.py @@ -41,7 +41,7 @@ import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, type_matches +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, type_matches from mobly import asserts # This test requires several additional command line arguments diff --git a/src/python_testing/TC_RVCRUNM_2_2.py b/src/python_testing/TC_RVCRUNM_2_2.py index f53a75503b..e78d6d7f42 100644 --- a/src/python_testing/TC_RVCRUNM_2_2.py +++ b/src/python_testing/TC_RVCRUNM_2_2.py @@ -41,7 +41,7 @@ import enum import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts # This test requires several additional command line arguments. diff --git a/src/python_testing/TC_SC_3_6.py b/src/python_testing/TC_SC_3_6.py index 74c09e2b72..8cfbee8e46 100644 --- a/src/python_testing/TC_SC_3_6.py +++ b/src/python_testing/TC_SC_3_6.py @@ -45,8 +45,8 @@ import chip.clusters as Clusters from chip.clusters import ClusterObjects as ClustersObjects from chip.clusters.Attribute import SubscriptionTransaction, TypedAttributePath +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from chip.utils import CommissioningBuildingBlocks -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts # TODO: Overall, we need to add validation that session IDs have not changed throughout to be agnostic diff --git a/src/python_testing/TC_SC_7_1.py b/src/python_testing/TC_SC_7_1.py index 19229b38ec..315790e980 100644 --- a/src/python_testing/TC_SC_7_1.py +++ b/src/python_testing/TC_SC_7_1.py @@ -38,12 +38,13 @@ import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts def _trusted_root_test_step(dut_num: int) -> TestStep: - read_trusted_roots_over_pase = f'TH establishes a PASE session to DUT{dut_num} using the provided setup code and reads the TrustedRootCertificates attribute from the operational credentials cluster over PASE' + read_trusted_roots_over_pase = f'TH establishes a PASE session to DUT{ + dut_num} using the provided setup code and reads the TrustedRootCertificates attribute from the operational credentials cluster over PASE' return TestStep(dut_num, read_trusted_roots_over_pase, "List should be empty as the DUT should be in factory reset ") diff --git a/src/python_testing/TC_SEAR_1_2.py b/src/python_testing/TC_SEAR_1_2.py index 41482be51c..41773804e4 100644 --- a/src/python_testing/TC_SEAR_1_2.py +++ b/src/python_testing/TC_SEAR_1_2.py @@ -41,7 +41,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_SEAR_1_3.py b/src/python_testing/TC_SEAR_1_3.py index 9592bce3fe..b55e21d884 100644 --- a/src/python_testing/TC_SEAR_1_3.py +++ b/src/python_testing/TC_SEAR_1_3.py @@ -41,7 +41,7 @@ import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts @@ -139,7 +139,8 @@ async def test_TC_SEAR_1_3(self): await self.send_cmd_select_areas_expect_response(step=9, new_areas=valid_areas, expected_response=Clusters.ServiceArea.Enums.SelectAreasStatus.kInvalidInMode) if self.check_pics("SEAR.S.M.VALID_STATE_FOR_SELECT_AREAS") and self.check_pics("SEAR.S.M.HAS_MANUAL_SELAREA_STATE_CONTROL"): - test_step = f"Manually intervene to put the device in a state that allows it to execute the SelectAreas({valid_areas}) command" + test_step = f"Manually intervene to put the device in a state that allows it to execute the SelectAreas({ + valid_areas}) command" self.print_step("10", test_step) if self.is_ci: self.write_to_app_pipe({"Name": "Reset"}) @@ -155,7 +156,8 @@ async def test_TC_SEAR_1_3(self): await self.send_cmd_select_areas_expect_response(step=13, new_areas=valid_areas, expected_response=Clusters.ServiceArea.Enums.SelectAreasStatus.kSuccess) if self.check_pics("SEAR.S.M.VALID_STATE_FOR_SELECT_AREAS") and self.check_pics("SEAR.S.M.HAS_MANUAL_SELAREA_STATE_CONTROL") and self.check_pics("SEAR.S.M.SELECT_AREAS_WHILE_NON_IDLE"): - test_step = f"Manually intervene to put the device in a state that allows it to execute the SelectAreas({valid_areas}) command, and put the device in a non-idle state" + test_step = f"Manually intervene to put the device in a state that allows it to execute the SelectAreas({ + valid_areas}) command, and put the device in a non-idle state" self.print_step("14", test_step) if self.is_ci: self.write_to_app_pipe({"Name": "Reset"}) diff --git a/src/python_testing/TC_SEAR_1_4.py b/src/python_testing/TC_SEAR_1_4.py index 3f3a84bdf2..cf53f446f9 100644 --- a/src/python_testing/TC_SEAR_1_4.py +++ b/src/python_testing/TC_SEAR_1_4.py @@ -40,7 +40,7 @@ import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_SEAR_1_5.py b/src/python_testing/TC_SEAR_1_5.py index 99da6da78b..130ccb8d59 100644 --- a/src/python_testing/TC_SEAR_1_5.py +++ b/src/python_testing/TC_SEAR_1_5.py @@ -41,7 +41,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_SEAR_1_6.py b/src/python_testing/TC_SEAR_1_6.py index 434da00258..dc6188a14e 100644 --- a/src/python_testing/TC_SEAR_1_6.py +++ b/src/python_testing/TC_SEAR_1_6.py @@ -41,7 +41,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_SWTCH.py b/src/python_testing/TC_SWTCH.py index 7cafaa7b55..3c764c6fe8 100644 --- a/src/python_testing/TC_SWTCH.py +++ b/src/python_testing/TC_SWTCH.py @@ -90,10 +90,10 @@ import test_plan_support from chip.clusters import ClusterObjects as ClusterObjects from chip.clusters.Attribute import EventReadResult +from chip.testing.matter_testing import (AttributeValue, ClusterAttributeChangeAccumulator, EventChangeCallback, MatterBaseTest, + TestStep, await_sequence_of_reports, default_matter_test_main, has_feature, + run_if_endpoint_matches) from chip.tlv import uint -from matter_testing_support import (AttributeValue, ClusterAttributeChangeAccumulator, EventChangeCallback, MatterBaseTest, - TestStep, await_sequence_of_reports, default_matter_test_main, has_feature, - run_if_endpoint_matches) from mobly import asserts logger = logging.getLogger(__name__) @@ -281,7 +281,8 @@ def _expect_no_events_for_cluster(self, event_queue: queue.Queue, endpoint_id: i elapsed = 0.0 time_remaining = timeout_sec - logging.info(f"Waiting {timeout_sec:.1f} seconds for no more events for cluster {expected_cluster} on endpoint {endpoint_id}") + logging.info(f"Waiting {timeout_sec: .1f} seconds for no more events for cluster { + expected_cluster} on endpoint {endpoint_id}") while time_remaining > 0: try: item: EventReadResult = event_queue.get(block=True, timeout=time_remaining) diff --git a/src/python_testing/TC_TIMESYNC_2_1.py b/src/python_testing/TC_TIMESYNC_2_1.py index 9858976520..cb2df9d66a 100644 --- a/src/python_testing/TC_TIMESYNC_2_1.py +++ b/src/python_testing/TC_TIMESYNC_2_1.py @@ -41,8 +41,8 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import (MatterBaseTest, default_matter_test_main, has_attribute, has_cluster, run_if_endpoint_matches, - utc_time_in_matter_epoch) +from chip.testing.matter_testing import (MatterBaseTest, default_matter_test_main, has_attribute, has_cluster, + run_if_endpoint_matches, utc_time_in_matter_epoch) from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_10.py b/src/python_testing/TC_TIMESYNC_2_10.py index b9aa7dabb7..99ca9f3ac0 100644 --- a/src/python_testing/TC_TIMESYNC_2_10.py +++ b/src/python_testing/TC_TIMESYNC_2_10.py @@ -43,9 +43,9 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError +from chip.testing.matter_testing import (MatterBaseTest, SimpleEventCallback, async_test_body, default_matter_test_main, + utc_time_in_matter_epoch) from chip.tlv import uint -from matter_testing_support import (MatterBaseTest, SimpleEventCallback, async_test_body, default_matter_test_main, - utc_time_in_matter_epoch) from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_11.py b/src/python_testing/TC_TIMESYNC_2_11.py index 1aaed7a14e..0865bc87f4 100644 --- a/src/python_testing/TC_TIMESYNC_2_11.py +++ b/src/python_testing/TC_TIMESYNC_2_11.py @@ -43,9 +43,9 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError +from chip.testing.matter_testing import (MatterBaseTest, SimpleEventCallback, async_test_body, default_matter_test_main, + get_wait_seconds_from_set_time, type_matches, utc_time_in_matter_epoch) from chip.tlv import uint -from matter_testing_support import (MatterBaseTest, SimpleEventCallback, async_test_body, default_matter_test_main, - get_wait_seconds_from_set_time, type_matches, utc_time_in_matter_epoch) from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_12.py b/src/python_testing/TC_TIMESYNC_2_12.py index cd4378fcdc..7677dcf184 100644 --- a/src/python_testing/TC_TIMESYNC_2_12.py +++ b/src/python_testing/TC_TIMESYNC_2_12.py @@ -43,9 +43,9 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError +from chip.testing.matter_testing import (MatterBaseTest, SimpleEventCallback, async_test_body, default_matter_test_main, + get_wait_seconds_from_set_time, type_matches, utc_time_in_matter_epoch) from chip.tlv import uint -from matter_testing_support import (MatterBaseTest, SimpleEventCallback, async_test_body, default_matter_test_main, - get_wait_seconds_from_set_time, type_matches, utc_time_in_matter_epoch) from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_13.py b/src/python_testing/TC_TIMESYNC_2_13.py index 91c679e14b..8138983030 100644 --- a/src/python_testing/TC_TIMESYNC_2_13.py +++ b/src/python_testing/TC_TIMESYNC_2_13.py @@ -41,7 +41,7 @@ import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.clusters.Types import NullValue -from matter_testing_support import MatterBaseTest, SimpleEventCallback, async_test_body, default_matter_test_main, type_matches +from chip.testing.matter_testing import MatterBaseTest, SimpleEventCallback, async_test_body, default_matter_test_main, type_matches from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_2.py b/src/python_testing/TC_TIMESYNC_2_2.py index dff4bd5f82..74f935aac9 100644 --- a/src/python_testing/TC_TIMESYNC_2_2.py +++ b/src/python_testing/TC_TIMESYNC_2_2.py @@ -40,7 +40,8 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError -from matter_testing_support import MatterBaseTest, async_test_body, compare_time, default_matter_test_main, utc_time_in_matter_epoch +from chip.testing.matter_testing import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, + utc_time_in_matter_epoch) from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_4.py b/src/python_testing/TC_TIMESYNC_2_4.py index a367dcad3d..76fe9074be 100644 --- a/src/python_testing/TC_TIMESYNC_2_4.py +++ b/src/python_testing/TC_TIMESYNC_2_4.py @@ -40,7 +40,8 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, type_matches, utc_time_in_matter_epoch +from chip.testing.matter_testing import (MatterBaseTest, async_test_body, default_matter_test_main, type_matches, + utc_time_in_matter_epoch) from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_5.py b/src/python_testing/TC_TIMESYNC_2_5.py index d62797e91e..f363f03ba6 100644 --- a/src/python_testing/TC_TIMESYNC_2_5.py +++ b/src/python_testing/TC_TIMESYNC_2_5.py @@ -40,7 +40,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, utc_time_in_matter_epoch +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, utc_time_in_matter_epoch from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_6.py b/src/python_testing/TC_TIMESYNC_2_6.py index f6fe8738f4..0e9ec9f795 100644 --- a/src/python_testing/TC_TIMESYNC_2_6.py +++ b/src/python_testing/TC_TIMESYNC_2_6.py @@ -40,7 +40,7 @@ import chip.clusters as Clusters from chip.clusters.Types import Nullable, NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_7.py b/src/python_testing/TC_TIMESYNC_2_7.py index edc71545cf..1c6cea2023 100644 --- a/src/python_testing/TC_TIMESYNC_2_7.py +++ b/src/python_testing/TC_TIMESYNC_2_7.py @@ -42,9 +42,9 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError +from chip.testing.matter_testing import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, type_matches, + utc_time_in_matter_epoch) from chip.tlv import uint -from matter_testing_support import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, type_matches, - utc_time_in_matter_epoch) from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_8.py b/src/python_testing/TC_TIMESYNC_2_8.py index 07785346c7..82a77c4c88 100644 --- a/src/python_testing/TC_TIMESYNC_2_8.py +++ b/src/python_testing/TC_TIMESYNC_2_8.py @@ -42,9 +42,9 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError +from chip.testing.matter_testing import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, type_matches, + utc_time_in_matter_epoch) from chip.tlv import uint -from matter_testing_support import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, type_matches, - utc_time_in_matter_epoch) from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_9.py b/src/python_testing/TC_TIMESYNC_2_9.py index 1f439b84e6..4ce83f81dd 100644 --- a/src/python_testing/TC_TIMESYNC_2_9.py +++ b/src/python_testing/TC_TIMESYNC_2_9.py @@ -41,9 +41,9 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError +from chip.testing.matter_testing import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, type_matches, + utc_time_in_matter_epoch) from chip.tlv import uint -from matter_testing_support import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, type_matches, - utc_time_in_matter_epoch) from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_3_1.py b/src/python_testing/TC_TIMESYNC_3_1.py index 3f292d0e85..4c7c9d9420 100644 --- a/src/python_testing/TC_TIMESYNC_3_1.py +++ b/src/python_testing/TC_TIMESYNC_3_1.py @@ -35,7 +35,7 @@ # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_TMP_2_1.py b/src/python_testing/TC_TMP_2_1.py index f48b96991e..d0ae9cf86a 100644 --- a/src/python_testing/TC_TMP_2_1.py +++ b/src/python_testing/TC_TMP_2_1.py @@ -16,7 +16,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_TSTAT_4_2.py b/src/python_testing/TC_TSTAT_4_2.py index fa77f94ae7..6dad144f30 100644 --- a/src/python_testing/TC_TSTAT_4_2.py +++ b/src/python_testing/TC_TSTAT_4_2.py @@ -43,7 +43,7 @@ from chip.clusters import Globals from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_TestEventTrigger.py b/src/python_testing/TC_TestEventTrigger.py index 38053540c6..ae4f64a805 100644 --- a/src/python_testing/TC_TestEventTrigger.py +++ b/src/python_testing/TC_TestEventTrigger.py @@ -43,7 +43,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts # Assumes `--enable-key 000102030405060708090a0b0c0d0e0f` on Linux app command line, or a DUT diff --git a/src/python_testing/TC_VALCC_2_1.py b/src/python_testing/TC_VALCC_2_1.py index a079c88c8b..d6f00b00a6 100644 --- a/src/python_testing/TC_VALCC_2_1.py +++ b/src/python_testing/TC_VALCC_2_1.py @@ -35,7 +35,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_VALCC_3_1.py b/src/python_testing/TC_VALCC_3_1.py index f4c6ebfa14..4b53ab032c 100644 --- a/src/python_testing/TC_VALCC_3_1.py +++ b/src/python_testing/TC_VALCC_3_1.py @@ -36,7 +36,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_VALCC_3_2.py b/src/python_testing/TC_VALCC_3_2.py index 0609051f4e..6905e3bde8 100644 --- a/src/python_testing/TC_VALCC_3_2.py +++ b/src/python_testing/TC_VALCC_3_2.py @@ -37,7 +37,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_VALCC_3_3.py b/src/python_testing/TC_VALCC_3_3.py index d90065d5bb..a63053cf34 100644 --- a/src/python_testing/TC_VALCC_3_3.py +++ b/src/python_testing/TC_VALCC_3_3.py @@ -37,7 +37,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_VALCC_3_4.py b/src/python_testing/TC_VALCC_3_4.py index f1363a51f3..30c57dcb3f 100644 --- a/src/python_testing/TC_VALCC_3_4.py +++ b/src/python_testing/TC_VALCC_3_4.py @@ -35,7 +35,7 @@ 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 chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_VALCC_4_1.py b/src/python_testing/TC_VALCC_4_1.py index a103898567..9af428d103 100644 --- a/src/python_testing/TC_VALCC_4_1.py +++ b/src/python_testing/TC_VALCC_4_1.py @@ -36,7 +36,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_VALCC_4_2.py b/src/python_testing/TC_VALCC_4_2.py index f2f0dd6631..9365e5bc78 100644 --- a/src/python_testing/TC_VALCC_4_2.py +++ b/src/python_testing/TC_VALCC_4_2.py @@ -36,7 +36,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_VALCC_4_3.py b/src/python_testing/TC_VALCC_4_3.py index a66d4eafd4..b0762d0d88 100644 --- a/src/python_testing/TC_VALCC_4_3.py +++ b/src/python_testing/TC_VALCC_4_3.py @@ -36,7 +36,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_VALCC_4_4.py b/src/python_testing/TC_VALCC_4_4.py index f6ad63d368..b85ff9a9f0 100644 --- a/src/python_testing/TC_VALCC_4_4.py +++ b/src/python_testing/TC_VALCC_4_4.py @@ -36,7 +36,8 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, utc_time_in_matter_epoch +from chip.testing.matter_testing import (MatterBaseTest, TestStep, async_test_body, default_matter_test_main, + utc_time_in_matter_epoch) from mobly import asserts diff --git a/src/python_testing/TC_VALCC_4_5.py b/src/python_testing/TC_VALCC_4_5.py index 3b850c0804..c6b7674c6c 100644 --- a/src/python_testing/TC_VALCC_4_5.py +++ b/src/python_testing/TC_VALCC_4_5.py @@ -36,7 +36,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_WHM_1_2.py b/src/python_testing/TC_WHM_1_2.py index 9d7d9b2879..2bbcdd5108 100644 --- a/src/python_testing/TC_WHM_1_2.py +++ b/src/python_testing/TC_WHM_1_2.py @@ -41,7 +41,7 @@ import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_WHM_2_1.py b/src/python_testing/TC_WHM_2_1.py index 6172ee013f..b9dcb0257d 100644 --- a/src/python_testing/TC_WHM_2_1.py +++ b/src/python_testing/TC_WHM_2_1.py @@ -43,7 +43,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts diff --git a/src/python_testing/TC_pics_checker.py b/src/python_testing/TC_pics_checker.py index 91e2102b5e..07e8613cc1 100644 --- a/src/python_testing/TC_pics_checker.py +++ b/src/python_testing/TC_pics_checker.py @@ -17,13 +17,13 @@ import math import chip.clusters as Clusters -from basic_composition_support import BasicCompositionTests -from global_attribute_ids import GlobalAttributeIds -from matter_testing_support import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, FeaturePathLocation, - MatterBaseTest, ProblemLocation, TestStep, async_test_body, default_matter_test_main) +from chip.testing.basic_composition import BasicCompositionTests +from chip.testing.global_attribute_ids import GlobalAttributeIds +from chip.testing.matter_testing import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, FeaturePathLocation, + MatterBaseTest, ProblemLocation, TestStep, async_test_body, default_matter_test_main) +from chip.testing.pics import accepted_cmd_pics_str, attribute_pics_str, feature_pics_str, generated_cmd_pics_str +from chip.testing.spec_parsing import build_xml_clusters from mobly import asserts -from pics_support import accepted_cmd_pics_str, attribute_pics_str, feature_pics_str, generated_cmd_pics_str -from spec_parsing_support import build_xml_clusters class TC_PICS_Checker(MatterBaseTest, BasicCompositionTests): diff --git a/src/python_testing/TestBatchInvoke.py b/src/python_testing/TestBatchInvoke.py index a17f7b8be4..6465692c95 100644 --- a/src/python_testing/TestBatchInvoke.py +++ b/src/python_testing/TestBatchInvoke.py @@ -38,7 +38,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, type_matches +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, type_matches from mobly import asserts ''' Integration test of batch commands using UnitTesting Cluster diff --git a/src/python_testing/TestChoiceConformanceSupport.py b/src/python_testing/TestChoiceConformanceSupport.py index 8436bc8418..77eca93761 100644 --- a/src/python_testing/TestChoiceConformanceSupport.py +++ b/src/python_testing/TestChoiceConformanceSupport.py @@ -19,11 +19,11 @@ import xml.etree.ElementTree as ElementTree import jinja2 -from choice_conformance_support import (evaluate_attribute_choice_conformance, evaluate_command_choice_conformance, - evaluate_feature_choice_conformance) -from matter_testing_support import MatterBaseTest, ProblemNotice, default_matter_test_main +from chip.testing.choice_conformance import (evaluate_attribute_choice_conformance, evaluate_command_choice_conformance, + evaluate_feature_choice_conformance) +from chip.testing.matter_testing import MatterBaseTest, ProblemNotice, default_matter_test_main +from chip.testing.spec_parsing import XmlCluster, add_cluster_data_from_xml from mobly import asserts -from spec_parsing_support import XmlCluster, add_cluster_data_from_xml FEATURE_TEMPLATE = '''\ diff --git a/src/python_testing/TestCommissioningTimeSync.py b/src/python_testing/TestCommissioningTimeSync.py index dfd03d957d..d4033ea58b 100644 --- a/src/python_testing/TestCommissioningTimeSync.py +++ b/src/python_testing/TestCommissioningTimeSync.py @@ -20,7 +20,7 @@ from chip import ChipDeviceCtrl from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, utc_time_in_matter_epoch +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, utc_time_in_matter_epoch from mobly import asserts # We don't have a good pipe between the c++ enums in CommissioningDelegate and python diff --git a/src/python_testing/TestConformanceSupport.py b/src/python_testing/TestConformanceSupport.py index 3744b6fe5e..ca41bf088e 100644 --- a/src/python_testing/TestConformanceSupport.py +++ b/src/python_testing/TestConformanceSupport.py @@ -18,11 +18,11 @@ import xml.etree.ElementTree as ElementTree from typing import Callable +from chip.testing.conformance import (Choice, Conformance, ConformanceDecision, ConformanceException, ConformanceParseParameters, + deprecated, disallowed, mandatory, optional, parse_basic_callable_from_xml, + parse_callable_from_xml, parse_device_type_callable_from_xml, provisional, zigbee) +from chip.testing.matter_testing import MatterBaseTest, default_matter_test_main from chip.tlv import uint -from conformance_support import (Choice, Conformance, ConformanceDecision, ConformanceException, ConformanceParseParameters, - deprecated, disallowed, mandatory, optional, parse_basic_callable_from_xml, - parse_callable_from_xml, parse_device_type_callable_from_xml, provisional, zigbee) -from matter_testing_support import MatterBaseTest, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TestConformanceTest.py b/src/python_testing/TestConformanceTest.py index f0ff8032ea..ddf3e421a7 100644 --- a/src/python_testing/TestConformanceTest.py +++ b/src/python_testing/TestConformanceTest.py @@ -18,12 +18,12 @@ from typing import Any import chip.clusters as Clusters -from basic_composition_support import arls_populated -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 chip.testing.basic_composition import arls_populated +from chip.testing.conformance import ConformanceDecision +from chip.testing.global_attribute_ids import GlobalAttributeIds +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.spec_parsing import build_xml_clusters, build_xml_device_types from mobly import asserts -from spec_parsing_support import build_xml_clusters, build_xml_device_types from TC_DeviceConformance import DeviceConformanceTests diff --git a/src/python_testing/TestGroupTableReports.py b/src/python_testing/TestGroupTableReports.py index 6e3980bcae..9d98a050c7 100644 --- a/src/python_testing/TestGroupTableReports.py +++ b/src/python_testing/TestGroupTableReports.py @@ -42,7 +42,7 @@ from chip.clusters import ClusterObjects as ClusterObjects from chip.clusters.Attribute import SubscriptionTransaction, TypedAttributePath from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TestIdChecks.py b/src/python_testing/TestIdChecks.py index 8969807d58..eda01ef955 100644 --- a/src/python_testing/TestIdChecks.py +++ b/src/python_testing/TestIdChecks.py @@ -15,9 +15,10 @@ # limitations under the License. # -from global_attribute_ids import (AttributeIdType, ClusterIdType, DeviceTypeIdType, attribute_id_type, cluster_id_type, - device_type_id_type, is_valid_attribute_id, is_valid_cluster_id, is_valid_device_type_id) -from matter_testing_support import MatterBaseTest, default_matter_test_main +from chip.testing.global_attribute_ids import (AttributeIdType, ClusterIdType, DeviceTypeIdType, attribute_id_type, cluster_id_type, + device_type_id_type, is_valid_attribute_id, is_valid_cluster_id, + is_valid_device_type_id) +from chip.testing.matter_testing import MatterBaseTest, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TestMatterTestingSupport.py b/src/python_testing/TestMatterTestingSupport.py index 08c3e830d2..811349b3a9 100644 --- a/src/python_testing/TestMatterTestingSupport.py +++ b/src/python_testing/TestMatterTestingSupport.py @@ -22,14 +22,15 @@ import chip.clusters as Clusters from chip.clusters.Types import Nullable, NullValue +from chip.testing.matter_testing import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, + get_wait_seconds_from_set_time, parse_matter_test_args, type_matches, + utc_time_in_matter_epoch) +from chip.testing.pics import parse_pics, parse_pics_xml +from chip.testing.taglist_and_topology_test import (TagProblem, create_device_type_list_for_root, create_device_type_lists, + find_tag_list_problems, find_tree_roots, flat_list_ok, get_all_children, + get_direct_children_of_root, parts_list_cycles, separate_endpoint_types) from chip.tlv import uint -from matter_testing_support import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, - get_wait_seconds_from_set_time, parse_matter_test_args, type_matches, utc_time_in_matter_epoch) from mobly import asserts, signals -from pics_support import parse_pics, parse_pics_xml -from taglist_and_topology_test_support import (TagProblem, create_device_type_list_for_root, create_device_type_lists, - find_tag_list_problems, find_tree_roots, flat_list_ok, get_all_children, - get_direct_children_of_root, parts_list_cycles, separate_endpoint_types) def get_raw_type_list(): diff --git a/src/python_testing/TestSpecParsingDeviceType.py b/src/python_testing/TestSpecParsingDeviceType.py index 7729ccee8a..a9ee14f12b 100644 --- a/src/python_testing/TestSpecParsingDeviceType.py +++ b/src/python_testing/TestSpecParsingDeviceType.py @@ -18,12 +18,12 @@ import chip.clusters as Clusters from chip.clusters import Attribute +from chip.testing.conformance import conformance_allowed +from chip.testing.matter_testing import MatterBaseTest, default_matter_test_main +from chip.testing.spec_parsing import build_xml_clusters, build_xml_device_types, parse_single_device_type from chip.tlv import uint -from conformance_support import conformance_allowed from jinja2 import Template -from matter_testing_support import MatterBaseTest, default_matter_test_main from mobly import asserts -from spec_parsing_support import build_xml_clusters, build_xml_device_types, parse_single_device_type from TC_DeviceConformance import DeviceConformanceTests diff --git a/src/python_testing/TestSpecParsingSupport.py b/src/python_testing/TestSpecParsingSupport.py index 4e0171b077..b4c908c232 100644 --- a/src/python_testing/TestSpecParsingSupport.py +++ b/src/python_testing/TestSpecParsingSupport.py @@ -15,17 +15,16 @@ # limitations under the License. # -import os import xml.etree.ElementTree as ElementTree import chip.clusters as Clusters import jinja2 -from global_attribute_ids import GlobalAttributeIds -from matter_testing_support import MatterBaseTest, ProblemNotice, default_matter_test_main +from chip.testing.global_attribute_ids import GlobalAttributeIds +from chip.testing.matter_testing import MatterBaseTest, ProblemNotice, default_matter_test_main +from chip.testing.spec_parsing import (ClusterParser, DataModelLevel, PrebuiltDataModelDirectory, SpecParsingException, XmlCluster, + add_cluster_data_from_xml, build_xml_clusters, check_clusters_for_unknown_commands, + combine_derived_clusters_with_base, get_data_model_directory) from mobly import asserts -from spec_parsing_support import (ClusterParser, PrebuiltDataModelDirectory, SpecParsingException, XmlCluster, - add_cluster_data_from_xml, build_xml_clusters, check_clusters_for_unknown_commands, - combine_derived_clusters_with_base) # TODO: improve the test coverage here # https://github.com/project-chip/connectedhomeip/issues/30958 @@ -272,10 +271,10 @@ def test_build_xml_override(self): asserts.assert_equal(set(one_four_clusters.keys())-set(tot_xml_clusters.keys()), set(), "There are some 1.4 clusters that are not included in the TOT spec") - str_path = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), - '..', '..', 'data_model', '1.4', 'clusters')) + str_path = get_data_model_directory(PrebuiltDataModelDirectory.k1_4, DataModelLevel.kCluster) string_override_check, problems = build_xml_clusters(str_path) - asserts.assert_equal(string_override_check.keys(), self.spec_xml_clusters.keys(), "Mismatched cluster generation") + + asserts.assert_count_equal(string_override_check.keys(), self.spec_xml_clusters.keys(), "Mismatched cluster generation") with asserts.assert_raises(SpecParsingException): build_xml_clusters("baddir") diff --git a/src/python_testing/TestTimeSyncTrustedTimeSource.py b/src/python_testing/TestTimeSyncTrustedTimeSource.py index 2f4c9a1f55..50bca6f3da 100644 --- a/src/python_testing/TestTimeSyncTrustedTimeSource.py +++ b/src/python_testing/TestTimeSyncTrustedTimeSource.py @@ -18,7 +18,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts # We don't have a good pipe between the c++ enums in CommissioningDelegate and python diff --git a/src/python_testing/TestUnitTestingErrorPath.py b/src/python_testing/TestUnitTestingErrorPath.py index 70d7b966ac..872f1fa930 100644 --- a/src/python_testing/TestUnitTestingErrorPath.py +++ b/src/python_testing/TestUnitTestingErrorPath.py @@ -38,7 +38,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts """ Integration test for error path returns via the UnitTesting cluster. diff --git a/src/python_testing/drlk_2_x_common.py b/src/python_testing/drlk_2_x_common.py index 92c0ab23ce..cdd1382292 100644 --- a/src/python_testing/drlk_2_x_common.py +++ b/src/python_testing/drlk_2_x_common.py @@ -23,7 +23,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import type_matches +from chip.testing.matter_testing import type_matches from mobly import asserts diff --git a/src/python_testing/execute_python_tests.py b/src/python_testing/execute_python_tests.py index 4e678211c5..34a391873b 100644 --- a/src/python_testing/execute_python_tests.py +++ b/src/python_testing/execute_python_tests.py @@ -53,7 +53,7 @@ def main(search_directory, env_file): # Define the base command to run tests base_command = os.path.join(chip_root, "scripts/tests/run_python_test.py") - # Define the files and patterns to exclude + # Define the test python script files and patterns to exclude excluded_patterns = { "MinimalRepresentation.py", # Code/Test not being used or not shared code for any other tests "TC_CNET_4_4.py", # It has no CI execution block, is not executed in CI @@ -84,14 +84,6 @@ def main(search_directory, env_file): "hello_test.py", # Is a template for tests "test_plan_support.py", # Shared code for TC_*, not a standalone test "test_plan_table_generator.py", # Code/Test not being used or not shared code for any other tests - "basic_composition_support.py", # Test support/shared code script, not a standalone test - "choice_conformance_support.py", # Test support/shared code script, not a standalone test - "conformance_support.py", # Test support/shared code script, not a standalone test - "global_attribute_ids.py", # Test support/shared code script, not a standalone test - "matter_testing_support.py", # Test support/shared code script, not a standalone test - "pics_support.py", # Test support/shared code script, not a standalone test - "spec_parsing_support.py", # Test support/shared code script, not a standalone test - "taglist_and_topology_test_support.py" # Test support/shared code script, not a standalone test } # Get all .py files in the directory diff --git a/src/python_testing/hello_external_runner.py b/src/python_testing/hello_external_runner.py index 5f00eeb287..64af55ce07 100755 --- a/src/python_testing/hello_external_runner.py +++ b/src/python_testing/hello_external_runner.py @@ -23,8 +23,8 @@ from multiprocessing import Process from multiprocessing.managers import BaseManager +from chip.testing.matter_testing import MatterTestConfig, get_test_info, run_tests from hello_test import HelloTest -from matter_testing_support import MatterTestConfig, get_test_info, run_tests try: from matter_yamltests.hooks import TestRunnerHooks diff --git a/src/python_testing/hello_test.py b/src/python_testing/hello_test.py index 0793ee3b10..2d910b1e52 100644 --- a/src/python_testing/hello_test.py +++ b/src/python_testing/hello_test.py @@ -38,7 +38,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/matter_testing_infrastructure/BUILD.gn b/src/python_testing/matter_testing_infrastructure/BUILD.gn index 41bbcef22b..19c7aee68d 100644 --- a/src/python_testing/matter_testing_infrastructure/BUILD.gn +++ b/src/python_testing/matter_testing_infrastructure/BUILD.gn @@ -18,7 +18,6 @@ import("//build_overrides/chip.gni") import("//build_overrides/pigweed.gni") import("$dir_pw_build/python.gni") -# Python package for CHIP testing support. pw_python_package("chip-testing") { setup = [ "setup.py", @@ -31,7 +30,15 @@ pw_python_package("chip-testing") { sources = [ "chip/testing/__init__.py", "chip/testing/apps.py", + "chip/testing/basic_composition.py", + "chip/testing/choice_conformance.py", + "chip/testing/conformance.py", + "chip/testing/global_attribute_ids.py", + "chip/testing/matter_testing.py", "chip/testing/metadata.py", + "chip/testing/pics.py", + "chip/testing/spec_parsing.py", + "chip/testing/taglist_and_topology_test.py", "chip/testing/tasks.py", ] diff --git a/src/python_testing/matter_testing_infrastructure/chip/testing/apps.py b/src/python_testing/matter_testing_infrastructure/chip/testing/apps.py index af56efc3d5..3b21a1c050 100644 --- a/src/python_testing/matter_testing_infrastructure/chip/testing/apps.py +++ b/src/python_testing/matter_testing_infrastructure/chip/testing/apps.py @@ -16,7 +16,7 @@ import signal import tempfile -from .tasks import Subprocess +from chip.testing.tasks import Subprocess class AppServerSubprocess(Subprocess): diff --git a/src/python_testing/basic_composition_support.py b/src/python_testing/matter_testing_infrastructure/chip/testing/basic_composition.py similarity index 100% rename from src/python_testing/basic_composition_support.py rename to src/python_testing/matter_testing_infrastructure/chip/testing/basic_composition.py diff --git a/src/python_testing/choice_conformance_support.py b/src/python_testing/matter_testing_infrastructure/chip/testing/choice_conformance.py similarity index 93% rename from src/python_testing/choice_conformance_support.py rename to src/python_testing/matter_testing_infrastructure/chip/testing/choice_conformance.py index 58d37bf101..7e7775d555 100644 --- a/src/python_testing/choice_conformance_support.py +++ b/src/python_testing/matter_testing_infrastructure/chip/testing/choice_conformance.py @@ -1,8 +1,8 @@ +from chip.testing.conformance import Choice, ConformanceDecisionWithChoice +from chip.testing.global_attribute_ids import GlobalAttributeIds +from chip.testing.matter_testing import AttributePathLocation, ProblemNotice, ProblemSeverity +from chip.testing.spec_parsing import XmlCluster from chip.tlv import uint -from conformance_support import Choice, ConformanceDecisionWithChoice -from global_attribute_ids import GlobalAttributeIds -from matter_testing_support import AttributePathLocation, ProblemNotice, ProblemSeverity -from spec_parsing_support import XmlCluster class ChoiceConformanceProblemNotice(ProblemNotice): diff --git a/src/python_testing/conformance_support.py b/src/python_testing/matter_testing_infrastructure/chip/testing/conformance.py similarity index 100% rename from src/python_testing/conformance_support.py rename to src/python_testing/matter_testing_infrastructure/chip/testing/conformance.py diff --git a/src/python_testing/global_attribute_ids.py b/src/python_testing/matter_testing_infrastructure/chip/testing/global_attribute_ids.py similarity index 100% rename from src/python_testing/global_attribute_ids.py rename to src/python_testing/matter_testing_infrastructure/chip/testing/global_attribute_ids.py diff --git a/src/python_testing/matter_testing_support.py b/src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py similarity index 99% rename from src/python_testing/matter_testing_support.py rename to src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py index 2e153a37de..2d23a9f84b 100644 --- a/src/python_testing/matter_testing_support.py +++ b/src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py @@ -65,12 +65,12 @@ from chip.interaction_model import InteractionModelError, Status from chip.setup_payload import SetupPayload from chip.storage import PersistentStorage +from chip.testing.global_attribute_ids import GlobalAttributeIds +from chip.testing.pics import read_pics_from_file from chip.tracing import TracingContext -from global_attribute_ids import GlobalAttributeIds from mobly import asserts, base_test, signals, utils from mobly.config_parser import ENV_MOBLY_LOGPATH, TestRunConfig from mobly.test_runner import TestRunner -from pics_support import read_pics_from_file try: from matter_yamltests.hooks import TestRunnerHooks @@ -2278,7 +2278,7 @@ def default_matter_test_main(): In this case, only one test class in a test script is allowed. To make your test script executable, add the following to your file: .. code-block:: python - from matter_testing_support.py import default_matter_test_main + from chip.testing.matter_testing.py import default_matter_test_main ... if __name__ == '__main__': default_matter_test_main.main() diff --git a/src/python_testing/pics_support.py b/src/python_testing/matter_testing_infrastructure/chip/testing/pics.py similarity index 100% rename from src/python_testing/pics_support.py rename to src/python_testing/matter_testing_infrastructure/chip/testing/pics.py diff --git a/src/python_testing/spec_parsing_support.py b/src/python_testing/matter_testing_infrastructure/chip/testing/spec_parsing.py similarity index 95% rename from src/python_testing/spec_parsing_support.py rename to src/python_testing/matter_testing_infrastructure/chip/testing/spec_parsing.py index 75ffea120f..97a13606ea 100644 --- a/src/python_testing/spec_parsing_support.py +++ b/src/python_testing/matter_testing_infrastructure/chip/testing/spec_parsing.py @@ -26,14 +26,14 @@ from typing import Callable, Optional import chip.clusters as Clusters -import conformance_support +import chip.testing.conformance as conformance_support +from chip.testing.conformance import (OPTIONAL_CONFORM, TOP_LEVEL_CONFORMANCE_TAGS, ConformanceDecision, ConformanceException, + ConformanceParseParameters, feature, is_disallowed, mandatory, optional, or_operation, + parse_callable_from_xml, parse_device_type_callable_from_xml) +from chip.testing.global_attribute_ids import GlobalAttributeIds +from chip.testing.matter_testing import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, DeviceTypePathLocation, + EventPathLocation, FeaturePathLocation, ProblemNotice, ProblemSeverity) from chip.tlv import uint -from conformance_support import (OPTIONAL_CONFORM, TOP_LEVEL_CONFORMANCE_TAGS, ConformanceDecision, ConformanceException, - ConformanceParseParameters, feature, is_disallowed, mandatory, optional, or_operation, - parse_callable_from_xml, parse_device_type_callable_from_xml) -from global_attribute_ids import GlobalAttributeIds -from matter_testing_support import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, DeviceTypePathLocation, - EventPathLocation, FeaturePathLocation, ProblemNotice, ProblemSeverity) _PRIVILEGE_STR = { None: "N/A", @@ -518,19 +518,36 @@ class DataModelLevel(str, Enum): kDeviceType = 'device_types' -def _get_data_model_directory(data_model_directory: typing.Union[PrebuiltDataModelDirectory, str], data_model_level: DataModelLevel) -> str: +def _get_data_model_root() -> str: + """Attempts to find ${CHIP_ROOT}/data_model or equivalent.""" + + # Since this class is generally in a module, we have to rely on being bootstrapped or + # we use CWD if we cannot + choices = [os.getcwd()] + + if 'PW_PROJECT_ROOT' in os.environ: + choices.insert(0, os.environ['PW_PROJECT_ROOT']) + + for c in choices: + data_model_path = os.path.join(c, 'data_model') + if os.path.exists(os.path.join(data_model_path, 'master', 'scraper_version')): + return data_model_path + raise FileNotFoundError('Cannot find a CHIP_ROOT/data_model path. Tried %r as prefixes.' % choices) + + +def get_data_model_directory(data_model_directory: typing.Union[PrebuiltDataModelDirectory, str], data_model_level: DataModelLevel) -> str: if data_model_directory == PrebuiltDataModelDirectory.k1_3: - return os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'data_model', '1.3', data_model_level) + return os.path.join(_get_data_model_root(), '1.3', data_model_level) elif data_model_directory == PrebuiltDataModelDirectory.k1_4: - return os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'data_model', '1.4', data_model_level) + return os.path.join(_get_data_model_root(), '1.4', data_model_level) elif data_model_directory == PrebuiltDataModelDirectory.kMaster: - return os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'data_model', 'master', data_model_level) + return os.path.join(_get_data_model_root(), 'master', data_model_level) else: return data_model_directory def build_xml_clusters(data_model_directory: typing.Union[PrebuiltDataModelDirectory, str] = PrebuiltDataModelDirectory.k1_4) -> tuple[dict[uint, XmlCluster], list[ProblemNotice]]: - dir = _get_data_model_directory(data_model_directory, DataModelLevel.kCluster) + dir = get_data_model_directory(data_model_directory, DataModelLevel.kCluster) clusters: dict[int, XmlCluster] = {} pure_base_clusters: dict[str, XmlCluster] = {} @@ -777,7 +794,7 @@ def parse_single_device_type(root: ElementTree.Element) -> tuple[list[ProblemNot def build_xml_device_types(data_model_directory: typing.Union[PrebuiltDataModelDirectory, str] = PrebuiltDataModelDirectory.k1_4) -> tuple[dict[int, XmlDeviceType], list[ProblemNotice]]: - dir = _get_data_model_directory(data_model_directory, DataModelLevel.kDeviceType) + dir = get_data_model_directory(data_model_directory, DataModelLevel.kDeviceType) device_types: dict[int, XmlDeviceType] = {} problems = [] for xml in glob.glob(f"{dir}/*.xml"): diff --git a/src/python_testing/taglist_and_topology_test_support.py b/src/python_testing/matter_testing_infrastructure/chip/testing/taglist_and_topology_test.py similarity index 100% rename from src/python_testing/taglist_and_topology_test_support.py rename to src/python_testing/matter_testing_infrastructure/chip/testing/taglist_and_topology_test.py diff --git a/src/python_testing/post_certification_tests/production_device_checks.py b/src/python_testing/post_certification_tests/production_device_checks.py index e4262a09e7..b8e567f76a 100644 --- a/src/python_testing/post_certification_tests/production_device_checks.py +++ b/src/python_testing/post_certification_tests/production_device_checks.py @@ -59,15 +59,15 @@ os.path.join(os.path.dirname(__file__), '..', '..', '..')) try: - from basic_composition_support import BasicCompositionTests - from matter_testing_support import (MatterBaseTest, MatterStackState, MatterTestConfig, TestStep, async_test_body, - run_tests_no_exit) + from chip.testing.basic_composition import BasicCompositionTests + from chip.testing.matter_testing import (MatterBaseTest, MatterStackState, MatterTestConfig, TestStep, async_test_body, + run_tests_no_exit) except ImportError: sys.path.append(os.path.abspath( os.path.join(os.path.dirname(__file__), '..'))) - from basic_composition_support import BasicCompositionTests - from matter_testing_support import (MatterBaseTest, MatterStackState, MatterTestConfig, TestStep, async_test_body, - run_tests_no_exit) + from chip.testing.basic_composition import BasicCompositionTests + from chip.testing.matter_testing import (MatterBaseTest, MatterStackState, MatterTestConfig, TestStep, async_test_body, + run_tests_no_exit) try: import fetch_paa_certs_from_dcl diff --git a/src/python_testing/test_plan_table_generator.py b/src/python_testing/test_plan_table_generator.py index c972116f34..b38f6f94df 100755 --- a/src/python_testing/test_plan_table_generator.py +++ b/src/python_testing/test_plan_table_generator.py @@ -22,7 +22,7 @@ from pathlib import Path import click -from matter_testing_support import MatterTestConfig, generate_mobly_test_config +from chip.testing.matter_testing import MatterTestConfig, generate_mobly_test_config def indent_multiline(multiline: str, num_spaces: int) -> str: diff --git a/src/python_testing/test_testing/MockTestRunner.py b/src/python_testing/test_testing/MockTestRunner.py index 2d0afb8a5c..6c9bc1c088 100644 --- a/src/python_testing/test_testing/MockTestRunner.py +++ b/src/python_testing/test_testing/MockTestRunner.py @@ -22,13 +22,7 @@ from unittest.mock import MagicMock from chip.clusters import Attribute - -try: - from matter_testing_support import MatterStackState, MatterTestConfig, run_tests_no_exit -except ImportError: - sys.path.append(os.path.abspath( - os.path.join(os.path.dirname(__file__), '..'))) - from matter_testing_support import MatterStackState, MatterTestConfig, run_tests_no_exit +from chip.testing.matter_testing import MatterStackState, MatterTestConfig, run_tests_no_exit class AsyncMock(MagicMock): @@ -56,7 +50,15 @@ def __init__(self, filename: str, classname: str, test: str, endpoint: int = Non def set_test(self, filename: str, classname: str, test: str): self.test = test self.config.tests = [self.test] - module = importlib.import_module(Path(os.path.basename(filename)).stem) + + module_name = Path(os.path.basename(filename)).stem + + try: + module = importlib.import_module(module_name) + except ModuleNotFoundError: + sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) + module = importlib.import_module(module_name) + self.test_class = getattr(module, classname) def set_test_config(self, test_config: MatterTestConfig = MatterTestConfig()): diff --git a/src/python_testing/test_testing/TestDecorators.py b/src/python_testing/test_testing/TestDecorators.py index 82b49eddd8..ce32518b71 100644 --- a/src/python_testing/test_testing/TestDecorators.py +++ b/src/python_testing/test_testing/TestDecorators.py @@ -25,23 +25,13 @@ # # You will get step_* calls as appropriate in between the test_start and test_stop calls if the test is not skipped. -import os import sys +from typing import Optional import chip.clusters as Clusters from chip.clusters import Attribute - -try: - from matter_testing_support import (MatterBaseTest, MatterTestConfig, async_test_body, has_attribute, has_cluster, has_feature, - run_if_endpoint_matches, run_on_singleton_matching_endpoint, should_run_test_on_endpoint) -except ImportError: - sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) - from matter_testing_support import (MatterBaseTest, MatterTestConfig, async_test_body, has_attribute, - has_cluster, has_feature, run_if_endpoint_matches, run_on_singleton_matching_endpoint, - should_run_test_on_endpoint) - -from typing import Optional - +from chip.testing.matter_testing import (MatterBaseTest, MatterTestConfig, async_test_body, has_attribute, has_cluster, has_feature, + run_if_endpoint_matches, run_on_singleton_matching_endpoint, should_run_test_on_endpoint) from mobly import asserts from MockTestRunner import MockTestRunner diff --git a/src/python_testing/test_testing/test_IDM_10_4.py b/src/python_testing/test_testing/test_IDM_10_4.py index 8634e94129..8a30609e94 100644 --- a/src/python_testing/test_testing/test_IDM_10_4.py +++ b/src/python_testing/test_testing/test_IDM_10_4.py @@ -21,13 +21,7 @@ import chip.clusters as Clusters from chip.clusters import Attribute - -try: - from pics_support import parse_pics_xml -except ImportError: - sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) - from pics_support import parse_pics_xml - +from chip.testing.pics import parse_pics_xml from MockTestRunner import MockTestRunner # Reachable attribute is off in the pics file diff --git a/src/python_testing/test_testing/test_TC_CCNTL_2_2.py b/src/python_testing/test_testing/test_TC_CCNTL_2_2.py index bd28023b8e..6a2dc48ba4 100644 --- a/src/python_testing/test_testing/test_TC_CCNTL_2_2.py +++ b/src/python_testing/test_testing/test_TC_CCNTL_2_2.py @@ -30,11 +30,11 @@ from MockTestRunner import AsyncMock, MockTestRunner try: - from matter_testing_support import MatterTestConfig, get_default_paa_trust_store, run_tests_no_exit + from chip.testing.matter_testing import MatterTestConfig, get_default_paa_trust_store, run_tests_no_exit except ImportError: sys.path.append(os.path.abspath( os.path.join(os.path.dirname(__file__), '..'))) - from matter_testing_support import MatterTestConfig, get_default_paa_trust_store, run_tests_no_exit + from chip.testing.matter_testing import MatterTestConfig, get_default_paa_trust_store, run_tests_no_exit invoke_call_count = 0 event_call_count = 0 diff --git a/src/python_testing/test_testing/test_TC_MCORE_FS_1_1.py b/src/python_testing/test_testing/test_TC_MCORE_FS_1_1.py index d79b412530..ed9f1b3531 100644 --- a/src/python_testing/test_testing/test_TC_MCORE_FS_1_1.py +++ b/src/python_testing/test_testing/test_TC_MCORE_FS_1_1.py @@ -30,11 +30,11 @@ from MockTestRunner import AsyncMock, MockTestRunner try: - from matter_testing_support import MatterTestConfig, get_default_paa_trust_store, run_tests_no_exit + from chip.testing.matter_testing import MatterTestConfig, get_default_paa_trust_store, run_tests_no_exit except ImportError: sys.path.append(os.path.abspath( os.path.join(os.path.dirname(__file__), '..'))) - from matter_testing_support import MatterTestConfig, get_default_paa_trust_store, run_tests_no_exit + from chip.testing.matter_testing import MatterTestConfig, get_default_paa_trust_store, run_tests_no_exit invoke_call_count = 0 event_call_count = 0 diff --git a/src/python_testing/test_testing/test_TC_SC_7_1.py b/src/python_testing/test_testing/test_TC_SC_7_1.py index 3b1b6a5b1c..96dced72f9 100644 --- a/src/python_testing/test_testing/test_TC_SC_7_1.py +++ b/src/python_testing/test_testing/test_TC_SC_7_1.py @@ -16,21 +16,14 @@ # limitations under the License. # -import os import sys from random import randbytes import chip.clusters as Clusters from chip.clusters import Attribute +from chip.testing.matter_testing import MatterTestConfig from MockTestRunner import MockTestRunner -try: - from matter_testing_support import MatterTestConfig -except ImportError: - sys.path.append(os.path.abspath( - os.path.join(os.path.dirname(__file__), '..'))) - from matter_testing_support import MatterTestConfig - def read_trusted_root(filled: bool) -> Attribute.AsyncReadTransaction.ReadResponse: opcreds = Clusters.OperationalCredentials diff --git a/src/tools/PICS-generator/PICSGenerator.py b/src/tools/PICS-generator/PICSGenerator.py index acdeb676ed..6cfb95803a 100644 --- a/src/tools/PICS-generator/PICSGenerator.py +++ b/src/tools/PICS-generator/PICSGenerator.py @@ -25,10 +25,10 @@ from pics_generator_support import map_cluster_name_to_pics_xml, pics_xml_file_list_loader from rich.console import Console -# Add the path to python_testing folder, in order to be able to import from matter_testing_support +# Add the path to python_testing folder, in order to be able to import from chip.testing.matter_testing sys.path.append(os.path.abspath(sys.path[0] + "/../../python_testing")) -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main # noqa: E402 -from spec_parsing_support import build_xml_clusters # noqa: E402 +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main # noqa: E402 +from chip.testing.spec_parsing import build_xml_clusters # noqa: E402 console = None xml_clusters = None diff --git a/src/tools/PICS-generator/XMLPICSValidator.py b/src/tools/PICS-generator/XMLPICSValidator.py index d728a61991..5fd170463d 100644 --- a/src/tools/PICS-generator/XMLPICSValidator.py +++ b/src/tools/PICS-generator/XMLPICSValidator.py @@ -23,7 +23,7 @@ # Add the path to python_testing folder, in order to be able to import from matter_testing_support sys.path.append(os.path.abspath(sys.path[0] + "/../../python_testing")) -from spec_parsing_support import build_xml_clusters # noqa: E402 +from chip.testing.spec_parsing import build_xml_clusters # noqa: E402 parser = argparse.ArgumentParser() parser.add_argument('--pics-template', required=True) diff --git a/src/tools/device-graph/matter-device-graph.py b/src/tools/device-graph/matter-device-graph.py index 16a2e6dbb0..597468624d 100644 --- a/src/tools/device-graph/matter-device-graph.py +++ b/src/tools/device-graph/matter-device-graph.py @@ -23,9 +23,9 @@ import graphviz from rich.console import Console -# Add the path to python_testing folder, in order to be able to import from matter_testing_support +# Add the path to python_testing folder, in order to be able to import from chip.testing.matter_testing sys.path.append(os.path.abspath(sys.path[0] + "/../../python_testing")) -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main # noqa: E402 +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main # noqa: E402 console = None maxClusterNameLength = 30 From 4440785aced739211d9cafdd2c754c4296de5cb1 Mon Sep 17 00:00:00 2001 From: wyhong <30567533+wy-hh@users.noreply.github.com> Date: Thu, 10 Oct 2024 20:01:38 +0800 Subject: [PATCH 071/127] [Bouffalo Lab] Add a script to demonstrate mfd partition generation (#35192) * [Bouffalo Lab] Add a script to demonstrate mfd partition generation * fix restyle * fix restyle * fix lint code and spell * fix lint code and spell * revert changes on Makefile of doc --- .../guides/bouffalolab/matter_factory_data.md | 249 ++++++++ docs/guides/index.md | 2 + examples/lighting-app/bouffalolab/README.md | 37 +- .../bouffalolab/generate_factory_data.py | 556 ++++++++++++++++++ 4 files changed, 827 insertions(+), 17 deletions(-) create mode 100644 docs/guides/bouffalolab/matter_factory_data.md create mode 100755 scripts/tools/bouffalolab/generate_factory_data.py diff --git a/docs/guides/bouffalolab/matter_factory_data.md b/docs/guides/bouffalolab/matter_factory_data.md new file mode 100644 index 0000000000..9021cd80f6 --- /dev/null +++ b/docs/guides/bouffalolab/matter_factory_data.md @@ -0,0 +1,249 @@ +# Introduction to Matter factory data + +Each Matter device should have it own unique factory data manufactured. + +This guide demonstrates what `Bouffalo Lab` provides to support factory data: + +- credential factory data protected by hardware security engine +- reference tool to generate factory data +- tool/method to program factory data + +# Matter factory data + +## How to enable + +One dedicate flash region allocates for factory data as below which is read-only +for firmware. + +```toml +name = "MFD" +address0 = 0x3FE000 +size0 = 0x1000 +``` + +To enable matter factory data feature, please append `-mfd` option at end of +target name. Take BL602 Wi-Fi Matter Light as example. + +``` +./scripts/build/build_examples.py --target bouffalolab-bl602dk-light-littlefs-mfd build +``` + +## Factory data + +This flash region is divided to two parts: + +- One is plain text data, such as Vendor ID, Product ID, Serial number and so + on. + + > For development/test purpose, all data can put in plain text data. + +- Other is cipher text data, such as private key for device attestation data. + + `Bouffalo Lab` provides hardware security engine to decrypt this part data + with **only hardware access** efuse key. + +Current supported data + +- DAC certificate and private key +- PAI certificate +- Certificate declaration + +- Discriminator ID +- Pass Code +- Spake2p iteration count, salt and verifier +- Vendor ID and name +- Product ID and name +- Product part number and product label +- Manufacturing date +- Hardware version and version string +- Serial Number +- Unique identifier + +> Note, it is available to add customer/product own information in factory data, +> please reference to `bl_mfd.h`/`bl_mfd.c` in SDK and reference generation +> script +> [generate_factory_data.py](../../../scripts/tools/bouffalolab/generate_factory_data.py) + +# Generate Matter factory data + +Script tool +[generate_factory_data.py](../../../scripts/tools/bouffalolab/generate_factory_data.py) +call `chip-cert` to generate test certificates and verify certificates. + +Please run below command to compile `chip-cert` tool under `connnectedhomeip` +repo. + +```shell +./scripts/build/build_examples.py --target linux-x64-chip-cert build +``` + +## Command options + +- `--cd`, certificate declare + + If not specified, `Chip-Test-CD-Signing-Cert.pem` and + `Chip-Test-CD-Signing-Key.pem` will sign a test certificate declare for + development and test purpose + +- `--pai_cert` and `--pai-key`, PAI certificate and PAI private key + + If not specified, `Chip-Test-PAI-FFF1-8000-Cert.pem` and + `Chip-Test-PAI-FFF1-8000-Key.pem` will be used for development and test + purpose. + +- `--dac_cert` and `--dac_key`, DAC certificate and DAC private key. + + If not specified, script will use PAI certificate and key specified + by`--pai_cert` and `--pai-key` to generate DAC certificate and private key + for development and test purpose. + +- `--discriminator`, discriminator ID + + If not specified, script will generate for user. + +- `--passcode`, passcode + + If not specified, script will generate for user. + +- `--spake2p_it` and `--spake2p_salt` + + If not specified, script will generate and calculate verifier for user. + +Please reference to `--help` for more detail. + +## Generate with default test certificates + +- Run following command to generate all plain text factory data + + Please create output folder first. Here takes `out/test-cert` as example. + + ```shell + ./scripts/tools/bouffalolab/generate_factory_data.py --output out/test-cert + ``` + +- Run following command to generate factory data which encrypt private of + device attestation data + + ```shell + ./scripts/tools/bouffalolab/generate_factory_data.py --output out/test-cert --key + ``` + + > An example of hex string of 16 bytes: 12345678123456781234567812345678 + +After command executes successfully, the output folder will has files as below: + +- Test certificate declare file which file name ends with `cd.der` + + If user wants to reuse CD generated before, please specify CD with option + `--cd` as below. + + ```shell + ./scripts/tools/bouffalolab/generate_factory_data.py --output out/test-cert --cd + ``` + +- Test DAC certificate and DAC certificate key which file names ends with + `dac_cert.pem` and `dac_key.pem` separately. + +- QR code picture which file name ends with `onboard.png` +- On board information which file name ends with `onboard.txt` +- Matter factory data which file name ends with `mfd.bin`. + +## Generate with self-defined PAA/PAI certificates + +Self-defined PAA/PAI certificates may use in development and test scenario. But, +user should know it has limit to work with real ecosystem. + +- Export environment variables in terminal for easy operations + + ``` + export TEST_CERT_VENDOR_ID=130D # Vendor ID hex string + export TEST_CERT_CN=BFLB # Common Name + ``` + +- Generate PAA certificate and key to `out/cert` folder. + + ```shell + mkdir out/test-cert + ./out/linux-x64-chip-cert/chip-cert gen-att-cert --type a --subject-cn "${TEST_CERT_CN} PAA 01" --valid-from "2020-10-15 14:23:43" --lifetime 7305 --out-key out/test-cert/Chip-PAA-Key-${TEST_CERT_VENDOR_ID}.pem --out out/test-cert/Chip-PAA-Cert-${TEST_CERT_VENDOR_ID}.pem --subject-vid ${TEST_CERT_VENDOR_ID} + ``` + +- Convert PAA PEM format file to PAA DER format file + + ```shell + ./out/linux-x64-chip-cert/chip-cert convert-cert -d out/test-cert/Chip-PAA-Cert-${TEST_CERT_VENDOR_ID}.pem out/test-cert/Chip-PAA-Cert-${TEST_CERT_VENDOR_ID}.der + ``` + + > Please save this PAA DER format file which will be used by `chip-tool` + > during commissioning. + +- Generate PAI certificate and key: + + ```shell + ./out/linux-x64-chip-cert/chip-cert gen-att-cert --type i --subject-cn "${TEST_CERT_CN} PAI 01" --subject-vid ${TEST_CERT_VENDOR_ID} --valid-from "2020-10-15 14:23:43" --lifetime 7305 --ca-key out/test-cert/Chip-PAA-Key-${TEST_CERT_VENDOR_ID}.pem --ca-cert out/test-cert/Chip-PAA-Cert-${TEST_CERT_VENDOR_ID}.pem --out-key out/test-cert/Chip-PAI-Key-${TEST_CERT_VENDOR_ID}.pem --out out/test-cert/Chip-PAI-Cert-${TEST_CERT_VENDOR_ID}.pem + ``` + +- Generate `MFD` in plain text data + + ```shell + ./scripts/tools/bouffalolab/generate_factory_data.py --output out/test-cert --paa_cert out/test-cert/Chip-PAA-Cert-${TEST_CERT_VENDOR_ID}.pem --paa_key out/test-cert/Chip-PAA-Key-${TEST_CERT_VENDOR_ID}.pem --pai_cert out/test-cert/Chip-PAI-Cert-${TEST_CERT_VENDOR_ID}.pem --pai_key out/test-cert/Chip-PAI-Key-${TEST_CERT_VENDOR_ID}.pem + ``` + + > Appending `--key ` option to enable encrypt + > private key of attestation device data. + +## Generate with self-defined DAC certificate and key + +Self-defined DAC certificates may use in development and test scenario. But, +user should know it has limit to work with real ecosystem. + +- Export environment variables in terminal for easy operations + + ``` + export TEST_CERT_VENDOR_ID=130D # Vendor ID hex string + export TEST_CERT_PRODUCT_ID=1001 # Vendor ID hex string + export TEST_CERT_CN=BFLB # Common Name + ``` + +- Generate DAC certificate and key + + ```shell + out/linux-x64-chip-cert/chip-cert gen-att-cert --type d --subject-cn "${TEST_CERT_CN} PAI 01" --subject-vid ${TEST_CERT_VENDOR_ID} --subject-pid ${TEST_CERT_VENDOR_ID} --valid-from "2020-10-16 14:23:43" --lifetime 5946 --ca-key out/test-cert/Chip-PAI-Key-${TEST_CERT_VENDOR_ID}.pem --ca-cert out/test-cert/Chip-PAI-Cert-${TEST_CERT_VENDOR_ID}.pem --out-key out/test-cert/Chip-DAC-Key-${TEST_CERT_VENDOR_ID}-${TEST_CERT_PRODUCT_ID}.pem --out out/test-cert/Chip-DAC-Cert-${TEST_CERT_VENDOR_ID}-${TEST_CERT_PRODUCT_ID}.pem + ``` + + > **Note**, `--valid-from` and `--lifetime` should be in `--valid-from` and + > `--lifetime` of PAI certificate. + +- Generate `MFD` in plain text data + + ```shell + ./scripts/tools/bouffalolab/generate_factory_data.py --output out/test-cert --pai_cert out/test-cert/Chip-PAI-Cert-${TEST_CERT_VENDOR_ID}.pem --dac_cert out/test-cert/Chip-DAC-Cert-${TEST_CERT_VENDOR_ID}-${TEST_CERT_PRODUCT_ID}.pem --dac_key out/test-cert/Chip-DAC-Key-${TEST_CERT_VENDOR_ID}-${TEST_CERT_PRODUCT_ID}.pem + ``` + + > Appending `--key ` option to enable encrypt + > private key of attestation device data. + +# Program factory data + +After each target built successfully, a flash programming python script will be +generated under out folder. + +Take BL616 Wi-Fi Matter Light as example, `chip-bl616-lighting-example.flash.py` +is using to program firmware, and also for factory data and factory decryption +key. + +```shell +/out/bouffalolab-bl616dk-light-wifi-mfd/chip-bl616-lighting-example.flash.py --port --mfd out/test-cert/ +``` + +> If `MFD` file has cipher text data, please append +> `--key ` option to program to this key to efuse. + +- Limits on BL IOT SDK + + If developer would like to program `MFD` with all plain text data, option + `--key ` needs pass to script, otherwise, flash tool + will raise an error. And SoC BL602, BL702 and BL702L use BL IOT SDK for + Matter Application. + +Please free contact to `Bouffalo Lab` for DAC provider service and higher +security solution, such as SoC inside certificate requesting. diff --git a/docs/guides/index.md b/docs/guides/index.md index 14d9caf7e2..c1a8792778 100644 --- a/docs/guides/index.md +++ b/docs/guides/index.md @@ -9,6 +9,7 @@ and features. :hidden: * +bouffalolab/matter_factory_data esp32/README nxp/README ti/ti_matter_overview @@ -23,6 +24,7 @@ ti/ti_matter_overview - [Android - Building](./android_building.md) - [Apple - Testing with iPhone, iPad, macOS, Apple TV, HomePod, Watch, etc](./darwin.md) - [ASR - Getting Started Guide](./asr_getting_started_guide.md) +- [Bouffalo Lab - Matter factory data generation](./bouffalolab/matter_factory_data.md) - [Espressif (ESP32) - Getting Started Guide](./esp32/README.md) - [Infineon PSoC6 - Software Update](./infineon_psoc6_software_update.md) - [Linux - Simulated Devices](./simulated_device_linux.md) diff --git a/examples/lighting-app/bouffalolab/README.md b/examples/lighting-app/bouffalolab/README.md index d2fd8b72af..b39f65b96d 100644 --- a/examples/lighting-app/bouffalolab/README.md +++ b/examples/lighting-app/bouffalolab/README.md @@ -1,4 +1,4 @@ -# `Bouffalo Lab` +# Matter `Bouffalo Lab` Lighting Example This example functions as a light bulb device type, with on/off and level capabilities and uses a test Vendor ID (VID) and a Product ID (PID) @@ -17,8 +17,6 @@ Legacy supported boards: - `BL602-NIGHT-LIGHT` - `XT-ZB6-DevKit` - `BL706-NIGHT-LIGHT` -- `BL706DK` -- `BL704LDK` > Warning: Changing the VID/PID may cause compilation problems, we recommend > leaving it as the default while using this example. @@ -99,6 +97,7 @@ The following steps take examples for `BL602DK`, `BL704LDK` and `BL706DK`. ``` ./scripts/build/build_examples.py --target bouffalolab-bl602dk-light build + ./scripts/build/build_examples.py --target bouffalolab-bl616dk-light-wifi build ./scripts/build/build_examples.py --target bouffalolab-bl704ldk-light build ./scripts/build/build_examples.py --target bouffalolab-bl706dk-light build ``` @@ -113,25 +112,28 @@ The following steps take examples for `BL602DK`, `BL704LDK` and `BL706DK`. ### Build options with build_examples.py -- `-wifi`, to specify that connectivity Wi-Fi is enabled for Matter - application. +- `-wifi`, specifies to use Wi-Fi for Matter application. - - BL602 uses `-wifi` by default - - BL702 needs specify to use BL706 + BL602 for Wi-Fi connectivity. + - BL602 uses Wi-Fi by default. `-wifi` could be elided. + - BL702 needs it to specify to use BL706 + BL602 for Wi-Fi. -- `-thread`, to specify that connectivity Thread is enabled for Matter - application. +- `-thread`, specifies to use Thread for Matter application. - - BL70X uses `-thread` by default. + - BL70X uses Thread by default. `-thread` could be elided. -- `-ethernet`, to specify that connectivity Ethernet is enabled for Matte - application. +- `-ethernet`, specifies to use Ethernet for Matter application. - - BL706 needs specify to use Ethernet connectivity. + - BL706 needs it to specify to use Ethernet. -- `-easyflash`, to specify that `easyflash` is used for flash storage access. +- `-littlefs`, specifies to use `littlefs` for flash access. +- `-easyflash`, specifies to use `easyflash` for flash access. + - for platform BL602/BL70X, it is necessary to specify one of `-easyflash` + and `-littlefs`. - `-mfd`, enable Matter factory data feature, which load factory data from `MFD` partition + - Please refer to + [Bouffalo Lab Matter factory data guide](../../../docs/guides/bouffalolab/matter_factory_data.md) + or contact to `Bouffalo Lab` for support. - `-shell`, enable command line - `-rpc`, enable Pigweed RPC feature - `-115200`, set UART baudrate to 115200 for log and command line @@ -175,9 +177,10 @@ The following steps take examples for `BL602DK`, `BL704LDK` and `BL706DK`. ```shell - ./out/bouffalolab-bl602dk-light/chip-bl602-lighting-example.flash.py --port /dev/ttyACM0 - ./out/bouffalolab-bl704ldk-light/chip-bl702l-lighting-example.flash.py --port /dev/ttyACM0 - ./out/bouffalolab-bl706dk-light/chip-bl702-lighting-example.flash.py --port /dev/ttyACM0 + ./out/bouffalolab-bl602dk-light-littlefs/chip-bl602-lighting-example.flash.py --port /dev/ttyACM0 + ./out/bouffalolab-bl616dk-light-wifi/chip-bl616dk-lighting-example.flash.py --port /dev/ttyACM0 + ./out/bouffalolab-bl704ldk-light-littlefs/chip-bl702l-lighting-example.flash.py --port /dev/ttyACM0 + ./out/bouffalolab-bl706dk-light-littlefs/chip-bl702-lighting-example.flash.py --port /dev/ttyACM0 ``` - To wipe out flash and download image, please append `--erase` diff --git a/scripts/tools/bouffalolab/generate_factory_data.py b/scripts/tools/bouffalolab/generate_factory_data.py new file mode 100755 index 0000000000..28f362ba2d --- /dev/null +++ b/scripts/tools/bouffalolab/generate_factory_data.py @@ -0,0 +1,556 @@ +#!/usr/bin/env python3 +# +# 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. +# + +import argparse +import base64 +import binascii +import logging as log +import os +import random +import secrets +import subprocess +import sys +from datetime import datetime, timedelta +from pathlib import Path + +from Crypto.Cipher import AES +from cryptography import x509 +from cryptography.hazmat.backends import default_backend +from cryptography.hazmat.primitives import hashes +from cryptography.hazmat.primitives.asymmetric import ec +from cryptography.hazmat.primitives.serialization import load_der_private_key +from cryptography.x509.oid import ObjectIdentifier + +MATTER_ROOT = os.path.dirname(os.path.realpath(__file__))[:-len("/scripts/tools/bouffalolab")] + +TEST_CD_CERT = MATTER_ROOT + "/credentials/test/certification-declaration/Chip-Test-CD-Signing-Cert.pem" +TEST_CD_KEY = MATTER_ROOT + "/credentials/test/certification-declaration/Chip-Test-CD-Signing-Key.pem" +TEST_PAA_CERT = MATTER_ROOT + "/credentials/test/attestation/Chip-Test-PAA-FFF1-Cert.pem" +TEST_PAA_KEY = MATTER_ROOT + "/credentials/test/attestation/Chip-Test-PAA-FFF1-Key.pem" +TEST_PAI_CERT = MATTER_ROOT + "/credentials/test/attestation/Chip-Test-PAI-FFF1-8000-Cert.pem" +TEST_PAI_KEY = MATTER_ROOT + "/credentials/test/attestation/Chip-Test-PAI-FFF1-8000-Key.pem" +TEST_CHIP_CERT = MATTER_ROOT + "/out/linux-x64-chip-cert/chip-cert" +TEST_CD_TYPE = 1 # 0 - development, 1 - provisional, 2 - official + + +def gen_test_passcode(passcode): + + INVALID_PASSCODES = [0, 11111111, 22222222, 33333333, 44444444, + 55555555, 66666666, 77777777, 88888888, 99999999, + 12345678, 87654321] + + def check_passcode(passcode): + return 0 <= passcode <= 99999999 and passcode not in INVALID_PASSCODES + + if isinstance(passcode, int): + if check_passcode(passcode): + raise Exception("passcode is invalid value.") + return passcode + + passcode = -1 + while not check_passcode(passcode): + passcode = random.randint(0, 99999999) + + return passcode + + +def gen_test_discriminator(discriminator): + + if isinstance(discriminator, int): + if discriminator > 0xfff: + raise Exception("discriminator is invalid value.") + + discriminator = random.randint(0, 0xfff) + + return discriminator + + +def gen_test_unique_id(unique_id): + + if isinstance(unique_id, bytes): + if len(unique_id) != 16: + raise Exception("rotating unique id has invalid length.") + return unique_id + + unique_id = secrets.token_bytes(16) + + return unique_id + + +def gen_test_spake2(passcode, spake2p_it, spake2p_salt, spake2p_verifier=None): + + sys.path.insert(0, os.path.join(MATTER_ROOT, 'scripts', 'tools', 'spake2p')) + from spake2p import generate_verifier + + if isinstance(spake2p_it, int): + if not 1000 <= spake2p_it <= 100000: + raise Exception("SPAKE2+ iteration count out of range.") + else: + spake2p_it = random.randint(1000, 100000) + + if spake2p_salt is None: + spake2p_salt_len = random.randint(16, 32) + spake2p_salt = bytes(random.sample(range(0, 255), spake2p_salt_len)) + else: + spake2p_salt = base64.b64decode(spake2p_salt) + if not 16 <= len(spake2p_salt) <= 32: + raise Exception("SPAKE2+ slat is invalid.") + + if spake2p_verifier is None: + spake2p_verifier = generate_verifier(passcode, spake2p_salt, spake2p_it) + else: + if generate_verifier(passcode, spake2p_salt, spake2p_it) != spake2p_verifier: + raise Exception("SPAKE2+ verifier is invalid.") + + return spake2p_it, spake2p_salt, spake2p_verifier + + +def gen_test_certs(chip_cert: str, + output: str, + vendor_id: int, + product_id: int, + device_name: str, + cd_cert: str = None, + cd_key: str = None, + cd: str = None, + paa_cert: str = None, + paa_key: str = None, + pai_cert: str = None, + pai_key: str = None, + dac_cert: str = None, + dac_key: str = None): + + def parse_cert_file(cert): + + def get_subject_attr(subject, oid): + try: + return subject.get_attributes_for_oid(oid) + except Exception: + return None + + if not os.path.isfile(cert): + return None, None, None, None, None + + with open(cert, 'rb') as cert_file: + cert = x509.load_pem_x509_certificate(cert_file.read(), default_backend()) + + vendor_id = None + product_id = None + for attribute in cert.subject: + if ObjectIdentifier('1.3.6.1.4.1.37244.2.1') == attribute.oid: + vendor_id = int(attribute.value, 16) + if ObjectIdentifier('1.3.6.1.4.1.37244.2.2') == attribute.oid: + product_id = int(attribute.value, 16) + + issue_date = cert.not_valid_before + expire_date = cert.not_valid_after + + return vendor_id, product_id, issue_date, expire_date + + def verify_certificates(chip_cert, paa_cert, pai_cert, dac_cert): + + if not os.path.isfile(pai_cert) or not os.path.isfile(dac_cert): + raise Exception("PAI certificate or DAC certificate is not specified.") + + with open(pai_cert, 'rb') as cert_file: + cert = x509.load_pem_x509_certificate(cert_file.read(), default_backend()) + pai_public_key = cert.public_key() + + with open(dac_cert, 'rb') as cert_file: + cert = x509.load_pem_x509_certificate(cert_file.read(), default_backend()) + + try: + pai_public_key.verify(cert.signature, cert.tbs_certificate_bytes, ec.ECDSA(hashes.SHA256())) + except Exception: + raise Exception("Failed to verify DAC signature with PAI certificate.") + + if (pai_cert != TEST_PAI_CERT and paa_cert != TEST_PAA_CERT) or (pai_cert == TEST_PAI_CERT and paa_cert == TEST_PAA_CERT): + if os.path.isfile(paa_cert): + cmd = [chip_cert, "validate-att-cert", + "--dac", dac_cert, + "--pai", pai_cert, + "--paa", paa_cert, + ] + log.info("Verify Certificate Chain: {}".format(" ".join(cmd))) + subprocess.run(cmd) + + def gen_dac_certificate(chip_cert, device_name, vendor_id, product_id, pai_cert, pai_key, dac_cert, dac_key, pai_issue_date, pai_expire_date): + def gen_valid_times(issue_date, expire_date): + now = datetime.now() - timedelta(days=1) + + if not (issue_date <= now <= expire_date): + raise Exception("Invalid time in test PAI to generate DAC.") + + return now.strftime('%Y%m%d%H%M%SZ'), (expire_date - now).days + + if not os.path.isfile(dac_cert) or not os.path.isfile(dac_key): + if not os.path.isfile(pai_cert) or not os.path.isfile(pai_key): + raise Exception("No test PAI certificate/key specified for test DAC generation.") + + valid_from, lifetime = gen_valid_times(pai_issue_date, pai_expire_date) + cmd = [chip_cert, "gen-att-cert", + "--type", "d", # device attestation certificate + "--subject-cn", device_name + " Test DAC 0", + "--subject-vid", hex(vendor_id), + "--subject-pid", hex(product_id), + "--ca-cert", pai_cert, + "--ca-key", pai_key, + "--out", dac_cert, + "--out-key", dac_key, + "--valid-from", valid_from, + "--lifetime", str(lifetime), + ] + log.info("Generate DAC: {}".format(" ".join(cmd))) + subprocess.run(cmd) + + def convert_pem_to_der(chip_cert, action, pem): + + if not os.path.isfile(pem): + raise Exception("File {} is not existed.".format(pem)) + + der = Path(pem).with_suffix(".der") + if not os.path.isfile(der): + cmd = [chip_cert, action, pem, der, "--x509-der", ] + subprocess.run(cmd) + + return der + + def gen_cd(chip_cert, dac_vendor_id, dac_product_id, vendor_id, product_id, cd_cert, cd_key, cd): + + if os.path.isfile(cd): + return + + cmd = [chip_cert, "gen-cd", + "--key", cd_key, + "--cert", cd_cert, + "--out", cd, + "--format-version", "1", + "--vendor-id", hex(vendor_id), + "--product-id", hex(product_id), + "--device-type-id", "0x1234", + "--certificate-id", "ZIG20141ZB330001-24", + "--security-level", "0", + "--security-info", "0", + "--certification-type", str(TEST_CD_TYPE), + "--version-number", "9876", + ] + + if dac_vendor_id != vendor_id or dac_product_id != product_id: + cmd += ["--dac-origin-vendor-id", hex(dac_vendor_id), + "--dac-origin-product-id", hex(dac_product_id), + ] + + log.info("Generate CD: {}".format(" ".join(cmd))) + subprocess.run(cmd) + + pai_vendor_id, pai_product_id, pai_issue_date, pai_expire_date = parse_cert_file(pai_cert) + + dac_vendor_id = pai_vendor_id if pai_vendor_id else vendor_id + dac_product_id = pai_product_id if pai_product_id else product_id + gen_dac_certificate(chip_cert, device_name, dac_vendor_id, dac_product_id, pai_cert, + pai_key, dac_cert, dac_key, pai_issue_date, pai_expire_date) + + dac_cert_der = convert_pem_to_der(chip_cert, "convert-cert", dac_cert) + dac_key_der = convert_pem_to_der(chip_cert, "convert-key", dac_key) + pai_cert_der = convert_pem_to_der(chip_cert, "convert-cert", pai_cert) + + dac_vendor_id, dac_product_id, *_ = parse_cert_file(dac_cert) + paa_vendor_id, paa_product_id, *_ = parse_cert_file(paa_cert) + + verify_certificates(chip_cert, paa_cert, pai_cert, dac_cert) + + gen_cd(chip_cert, dac_vendor_id, dac_product_id, vendor_id, product_id, cd_cert, cd_key, cd) + + return cd, pai_cert_der, dac_cert_der, dac_key_der + + +def gen_mfd_partition(args, mfd_output): + + def int_to_2bytearray_l(intvalue): + src = bytearray(2) + src[1] = (intvalue >> 8) & 0xFF + src[0] = (intvalue >> 0) & 0xFF + return src + + def int_to_4bytearray_l(intvalue): + src = bytearray(4) + src[3] = (intvalue >> 24) & 0xFF + src[2] = (intvalue >> 16) & 0xFF + src[1] = (intvalue >> 8) & 0xFF + src[0] = (intvalue >> 0) & 0xFF + return src + + def gen_efuse_aes_iv(): + return bytes(random.sample(range(0, 0xff), 12) + [0] * 4) + + def read_file(rfile): + with open(rfile, 'rb') as _f: + return _f.read() + + def get_private_key(der): + with open(der, 'rb') as file: + keys = load_der_private_key(file.read(), password=None, backend=default_backend()) + private_key = keys.private_numbers().private_value.to_bytes(32, byteorder='big') + + return private_key + + def encrypt_data(data_bytearray, key_bytearray, iv_bytearray): + data_bytearray += bytes([0] * (16 - (len(data_bytearray) % 16))) + cryptor = AES.new(key_bytearray, AES.MODE_CBC, iv_bytearray) + ciphertext = cryptor.encrypt(data_bytearray) + return ciphertext + + def convert_to_bytes(data): + if isinstance(data, bytes) or isinstance(data, str): + if isinstance(data, str): + return data.encode() + else: + return data + elif isinstance(data, int): + byte_len = int((data.bit_length() + 7) / 8) + return data.to_bytes(byte_len, byteorder='little') + elif data is None: + return bytes([]) + else: + raise Exception("Data is invalid type: {}".format(type(data))) + + def gen_tlvs(mfdDict, need_sec): + MFD_ID_RAW_MASK = 0x8000 + + sec_tlvs = bytes([]) + raw_tlvs = bytes([]) + + for name in mfdDict.keys(): + d = mfdDict[name] + if d["sec"] and need_sec: + if d["len"] and d["len"] < len(d["data"]): + raise Exception("Data size of {} is over {}".format(name, d["len"])) + sec_tlvs += int_to_2bytearray_l(d["id"]) + sec_tlvs += int_to_2bytearray_l(len(d["data"])) + sec_tlvs += d["data"] + + for name in mfdDict.keys(): + d = mfdDict[name] + if not d["sec"] or not need_sec: + if d["len"] and d["len"] < len(d["data"]): + raise Exception("Data size of {} is over {}".format(name, d["len"])) + raw_tlvs += int_to_2bytearray_l(d["id"] + MFD_ID_RAW_MASK) + raw_tlvs += int_to_2bytearray_l(len(d["data"])) + raw_tlvs += d["data"] + + return sec_tlvs, raw_tlvs + + mfdDict = { + "aes_iv": {'sec': False, "id": 1, "len": 16, "data": gen_efuse_aes_iv() if args.key else bytes([0] * 16)}, + "dac_cert": {'sec': False, "id": 2, "len": None, "data": read_file(args.dac_cert)}, + "dac_key": {'sec': True, "id": 3, "len": None, "data": get_private_key(args.dac_key)}, + "passcode": {'sec': False, "id": 4, "len": 4, "data": convert_to_bytes(args.passcode)}, + "pai_cert": {'sec': False, "id": 5, "len": None, "data": read_file(args.pai_cert)}, + "cd": {'sec': False, "id": 6, "len": None, "data": read_file(args.cd)}, + "sn": {'sec': False, "id": 7, "len": 32, "data": convert_to_bytes(args.sn)}, + "discriminator": {'sec': False, "id": 8, "len": 2, "data": convert_to_bytes(args.discriminator)}, + "uid": {'sec': False, "id": 9, "len": 32, "data": convert_to_bytes(args.unique_id)}, + "spake2p_it": {'sec': False, "id": 10, "len": 4, "data": convert_to_bytes(args.spake2p_it)}, + "spake2p_salt": {'sec': False, "id": 11, "len": 32, "data": convert_to_bytes(args.spake2p_salt)}, + "spake2p_verifier": {'sec': False, "id": 12, "len": None, "data": convert_to_bytes(args.spake2p_verifier)}, + "vendor_name": {'sec': False, "id": 13, "len": 32, "data": convert_to_bytes(args.vendor_name)}, + "vendor_id": {'sec': False, "id": 14, "len": 2, "data": convert_to_bytes(args.vendor_id)}, + "product_name": {'sec': False, "id": 15, "len": 32, "data": convert_to_bytes(args.product_name)}, + "product_id": {'sec': False, "id": 16, "len": 2, "data": convert_to_bytes(args.product_id)}, + "product_part_no": {'sec': False, "id": 17, "len": 32, "data": convert_to_bytes(args.product_part_no)}, + "product_url": {'sec': False, "id": 18, "len": 256, "data": convert_to_bytes(args.product_url)}, + "product_label": {'sec': False, "id": 19, "len": 64, "data": convert_to_bytes(args.product_label)}, + "manufactoring_date": {'sec': False, "id": 20, "len": 16, "data": convert_to_bytes(args.manufactoring_date)}, + "hardware_ver": {'sec': False, "id": 21, "len": 4, "data": convert_to_bytes(args.hardware_version)}, + "hardware_ver_str": {'sec': False, "id": 22, "len": 64, "data": convert_to_bytes(args.hardware_version_string)}, + } + + sec_tlvs, raw_tlvs = gen_tlvs(mfdDict, args.key) + + output = bytes([]) + + sec_tlvs = sec_tlvs and encrypt_data(sec_tlvs, args.key, mfdDict["aes_iv"]["data"]) + + output = int_to_4bytearray_l(len(sec_tlvs)) + output += sec_tlvs + output += int_to_4bytearray_l(binascii.crc32(sec_tlvs)) + output += int_to_4bytearray_l(len(raw_tlvs)) + output += raw_tlvs + output += int_to_4bytearray_l(binascii.crc32(raw_tlvs)) + + with open(mfd_output, "wb+") as fp: + fp.write(output) + + +def gen_onboarding_data(args, onboard_txt, onboard_png, rendez=6): + + try: + import qrcode + from SetupPayload import CommissioningFlow, SetupPayload + except ImportError: + sys.path.append(os.path.join(MATTER_ROOT, "src/setup_payload/python")) + try: + import qrcode + from SetupPayload import CommissioningFlow, SetupPayload + except Exception: + raise Exception("Please make sure qrcode has been installed.") + else: + raise Exception("Please make sure qrcode has been installed.") + + setup_payload = SetupPayload(discriminator=args.discriminator, + pincode=args.passcode, + rendezvous=rendez, + flow=CommissioningFlow.Standard, + vid=args.vendor_id, + pid=args.product_id) + with open(onboard_txt, "w") as manual_code_file: + manual_code_file.write("Manualcode : " + setup_payload.generate_manualcode() + "\n") + manual_code_file.write("QRCode : " + setup_payload.generate_qrcode()) + qr = qrcode.make(setup_payload.generate_qrcode()) + qr.save(onboard_png) + + return setup_payload.generate_manualcode(), setup_payload.generate_qrcode() + + +def main(): + + def check_arg(args): + + if not isinstance(args.output, str) or not os.path.exists(args.output): + raise Exception("output path is not specified or not existed.") + log.info("output path: {}".format(args.output)) + + if not isinstance(args.chip_cert, str) or not os.path.exists(args.chip_cert): + raise Exception("chip-cert should be built before and is specified.") + log.info("chip-cert path: {}".format(args.chip_cert)) + + def to_bytes(input): + if isinstance(input, str): + return bytearray.fromhex(input) + elif isinstance(input, bytes): + return input + else: + return None + + parser = argparse.ArgumentParser(description="Bouffalo Lab Factory Data generator tool") + + parser.add_argument("--dac_cert", type=str, help="DAC certificate file.") + parser.add_argument("--dac_key", type=str, help="DAC certificate privat key.") + parser.add_argument("--passcode", type=int, help="Setup pincode, optional.") + parser.add_argument("--pai_cert", type=str, default=TEST_PAI_CERT, help="PAI certificate file.") + parser.add_argument("--cd", type=str, help="Certificate Declaration file.") + parser.add_argument("--sn", type=str, default="Test SN", help="Serial Number, optional.") + parser.add_argument("--discriminator", type=int, help="Discriminator ID, optional.") + parser.add_argument("--unique_id", type=base64.b64decode, help="Rotating Unique ID in hex string, optional.") + parser.add_argument("--spake2p_it", type=int, default=None, help="Spake2+ iteration count, optional.") + parser.add_argument("--spake2p_salt", type=base64.b64decode, help="Spake2+ salt in hex string, optional.") + + parser.add_argument("--vendor_id", type=int, default=0x130D, help="Vendor Identification, mandatory.") + parser.add_argument("--vendor_name", type=str, default="Bouffalo Lab", help="Vendor Name string, optional.") + parser.add_argument("--product_id", type=int, default=0x1001, help="Product Identification, mandatory.") + parser.add_argument("--product_name", type=str, default="Test Product", help="Product Name string, optional.") + + parser.add_argument("--product_part_no", type=str, help="Product Part number, optional.") + parser.add_argument("--product_url", type=str, help="Product Web URL, optional.") + parser.add_argument("--product_label", type=str, help="Product Web URL, optional.") + parser.add_argument("--manufactoring_date", type=str, help="Product Web URL, optional.") + parser.add_argument("--hardware_version", type=int, help="Product Web URL, optional.") + parser.add_argument("--hardware_version_string", type=str, help="Product Web URL, optional.") + parser.add_argument("--rendezvous", type=int, default=6, help="Rendezvous Mode for QR code generation") + + parser.add_argument("--output", type=str, help="output path.") + parser.add_argument("--key", type=str, help="Encrypt private part in mfd.") + + parser.add_argument("--cd_cert", type=str, default=TEST_CD_CERT, help="for test, to sign certificate declaration.") + parser.add_argument("--cd_key", type=str, default=TEST_CD_KEY, help="for test, to sign certificate declaration.") + parser.add_argument("--paa_cert", type=str, default=TEST_PAA_CERT, help="for test, to verify certificate chain.") + parser.add_argument("--paa_key", type=str, default=TEST_PAA_KEY, help="for test, to sign pai certificate.") + parser.add_argument("--pai_key", type=str, default=TEST_PAI_KEY, help="for test, to sign dac certificate.") + parser.add_argument("--chip_cert", type=str, default=TEST_CHIP_CERT, help="for test, the tool to issue dac certificate.") + + args = parser.parse_args() + + log.basicConfig(format='[%(levelname)s] %(message)s', level=log.INFO) + + check_arg(args) + + passcode = gen_test_passcode(args.passcode) + discriminator = gen_test_discriminator(args.discriminator) + unique_id = gen_test_unique_id(args.unique_id) + spake2p_it, spake2p_salt, spake2p_verifier = gen_test_spake2(passcode, args.spake2p_it, args.spake2p_salt) + + vp_info = "{}_{}".format(hex(args.vendor_id), hex(args.product_id)) + vp_disc_info = "{}_{}_{}".format(hex(args.vendor_id), hex(args.product_id), discriminator) + if args.dac_cert is None: + args.dac_cert = os.path.join(args.output, "out_{}_dac_cert.pem".format(vp_disc_info)) + args.dac_key = os.path.join(args.output, "out_{}_dac_key.pem".format(vp_disc_info)) + + if args.cd is None: + args.cd = os.path.join(args.output, "out_{}_cd.der".format(vp_info)) + + cd, pai_cert_der, dac_cert_der, dac_key_der = gen_test_certs(args.chip_cert, + args.output, + args.vendor_id, + args.product_id, + args.vendor_name, + args.cd_cert, + args.cd_key, + args.cd, + args.paa_cert, + args.paa_key, + args.pai_cert, + args.pai_key, + args.dac_cert, + args.dac_key) + + mfd_output = os.path.join(args.output, "out_{}_mfd.bin".format(vp_disc_info)) + args.dac_cert = dac_cert_der + args.dac_key = dac_key_der + args.passcode = passcode + args.pai_cert = pai_cert_der + args.cd = cd + args.discriminator = discriminator + args.unique_id = unique_id + args.spake2p_it = spake2p_it + args.spake2p_salt = spake2p_salt + args.spake2p_verifier = spake2p_verifier + args.key = to_bytes(args.key) + gen_mfd_partition(args, mfd_output) + + onboard_txt = os.path.join(args.output, "out_{}_onboard.txt".format(vp_disc_info)) + onboard_png = os.path.join(args.output, "out_{}_onboard.png".format(vp_disc_info)) + manualcode, qrcode = gen_onboarding_data(args, onboard_txt, onboard_png, args.rendezvous) + + log.info("") + log.info("Output as below: ") + log.info("Passcode: {}".format(passcode)) + log.info("Discriminator ID: {}".format(discriminator)) + log.info("Rotating Unique ID: {}".format(unique_id.hex())) + log.info("Rotating Unique ID base64 code: {}".format(base64.b64encode(unique_id).decode())) + log.info("SPAKE2+ iteration: {}".format(spake2p_it)) + log.info("SPAKE2+ slat: {}".format(spake2p_salt.hex())) + log.info("SPAKE2+ slat base code: {}".format(base64.b64encode(spake2p_salt).decode())) + log.info("Manual code: {}".format(manualcode)) + log.info("QR code: {}".format(qrcode)) + + log.info("") + log.info("MFD partition file: {}".format(mfd_output)) + log.info("QR code PNG file: {}".format(onboard_png)) + + +if __name__ == "__main__": + main() From a0eafcecebcd59465ada217c1ed5baaaa472e2ac Mon Sep 17 00:00:00 2001 From: wyhong <30567533+wy-hh@users.noreply.github.com> Date: Thu, 10 Oct 2024 20:02:00 +0800 Subject: [PATCH 072/127] [bouffalolab] reduce ci build targets (#36006) --- .github/workflows/examples-bouffalolab.yaml | 49 +++++---------------- 1 file changed, 12 insertions(+), 37 deletions(-) diff --git a/.github/workflows/examples-bouffalolab.yaml b/.github/workflows/examples-bouffalolab.yaml index 9a6989881e..9a51b612a1 100644 --- a/.github/workflows/examples-bouffalolab.yaml +++ b/.github/workflows/examples-bouffalolab.yaml @@ -58,25 +58,15 @@ jobs: run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py \ - --target bouffalolab-bl602dk-light-easyflash \ - --target bouffalolab-bl602dk-light-mfd-littlefs \ - --target bouffalolab-bl602dk-light-rpc-115200-littlefs \ + --target bouffalolab-bl602dk-light-mfd-littlefs-rpc-115200 \ build \ --copy-artifacts-to out/artifacts \ " - name: Prepare some bloat report from the previous builds run: | .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - bl602 bl602 lighting-app \ - out/artifacts/bouffalolab-bl602dk-light-easyflash/chip-bl602-lighting-example.out \ - /tmp/bloat_reports/ - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - bl602 bl602+mfd lighting-app \ - out/artifacts/bouffalolab-bl602dk-light-mfd-littlefs/chip-bl602-lighting-example.out \ - /tmp/bloat_reports/ - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - bl602 bl602+rpc lighting-app \ - out/artifacts/bouffalolab-bl602dk-light-rpc-115200-littlefs/chip-bl602-lighting-example.out \ + bl602 bl602+mfd+littlefs+rpc lighting-app \ + out/artifacts/bouffalolab-bl602dk-light-mfd-littlefs-rpc-115200/chip-bl602-lighting-example.out \ /tmp/bloat_reports/ - name: Clean out build output run: rm -rf ./out @@ -85,35 +75,25 @@ jobs: run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py \ - --target bouffalolab-bl706dk-light-easyflash \ - --target bouffalolab-bl706dk-light-mfd-littlefs \ - --target bouffalolab-bl706dk-light-ethernet-littlefs \ + --target bouffalolab-bl706dk-light-ethernet-easyflash \ --target bouffalolab-bl706dk-light-wifi-littlefs \ - --target bouffalolab-bl706dk-light-rpc-115200-littlefs \ + --target bouffalolab-bl706dk-light-mfd-rpc-littlefs-115200 \ build \ --copy-artifacts-to out/artifacts \ " - name: Prepare some bloat report from the previous builds run: | .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - bl702 bl702 lighting-app \ - out/artifacts/bouffalolab-bl706dk-light-easyflash/chip-bl702-lighting-example.out \ - /tmp/bloat_reports/ - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - bl702 bl702+mfd lighting-app \ - out/artifacts/bouffalolab-bl706dk-light-mfd-littlefs/chip-bl702-lighting-example.out \ - /tmp/bloat_reports/ - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - bl702 bl706-eth lighting-app \ - out/artifacts/bouffalolab-bl706dk-light-ethernet-littlefs/chip-bl702-lighting-example.out \ + bl702 bl702+eth lighting-app \ + out/artifacts/bouffalolab-bl706dk-light-ethernet-easyflash/chip-bl702-lighting-example.out \ /tmp/bloat_reports/ .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - bl702 bl706-wifi lighting-app \ + bl702 bl702+wifi lighting-app \ out/artifacts/bouffalolab-bl706dk-light-wifi-littlefs/chip-bl702-lighting-example.out \ /tmp/bloat_reports/ .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - bl702 bl702+rpc lighting-app \ - out/artifacts/bouffalolab-bl706dk-light-rpc-115200-littlefs/chip-bl702-lighting-example.out \ + bl702 bl706+mfd+rpc+littlefs lighting-app \ + out/artifacts/bouffalolab-bl706dk-light-mfd-rpc-littlefs-115200/chip-bl702-lighting-example.out \ /tmp/bloat_reports/ - name: Clean out build output run: rm -rf ./out @@ -123,7 +103,6 @@ jobs: run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py \ - --target bouffalolab-bl704ldk-light-easyflash \ --target bouffalolab-bl704ldk-light-mfd-littlefs \ build \ --copy-artifacts-to out/artifacts \ @@ -131,11 +110,7 @@ jobs: - name: Prepare some bloat report from the previous builds run: | .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - bl702l bl702l lighting-app \ - out/artifacts/bouffalolab-bl704ldk-light-easyflash/chip-bl702l-lighting-example.out \ - /tmp/bloat_reports/ - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - bl702l bl702l+mfd lighting-app \ + bl702l bl702l+mfd+littlefs lighting-app \ out/artifacts/bouffalolab-bl704ldk-light-mfd-littlefs/chip-bl702l-lighting-example.out \ /tmp/bloat_reports/ - name: Clean out build output @@ -145,4 +120,4 @@ jobs: uses: ./.github/actions/upload-size-reports if: ${{ !env.ACT }} with: - platform-name: BouffaloLab + platform-name: BouffaloLab \ No newline at end of file From 19289996e9591ad7a9250d59ad8873f5229cacf0 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Thu, 10 Oct 2024 06:03:05 -0700 Subject: [PATCH 073/127] [Fabric-Sync] Use aggregator endpoint instead of root endpoint for CCTRL (#35977) * Use aggregator endpoint instead of root endpoint for CCTRL * Address review comments --- .../device_manager/DeviceManager.cpp | 9 +- .../fabric-bridge-app.matter | 30 +- .../fabric-bridge-app.zap | 287 +++++++++--------- .../linux/CommissionerControl.cpp | 4 +- .../linux/include/CommissionerControl.h | 2 + .../commissioner-control-server.cpp | 5 +- .../commissioner-control-server.h | 3 +- src/python_testing/TC_CCTRL_2_2.py | 2 +- src/python_testing/TC_MCORE_FS_1_1.py | 30 +- src/python_testing/TC_MCORE_FS_1_3.py | 29 +- 10 files changed, 229 insertions(+), 172 deletions(-) diff --git a/examples/fabric-admin/device_manager/DeviceManager.cpp b/examples/fabric-admin/device_manager/DeviceManager.cpp index 8acb5636f4..3a27c68184 100644 --- a/examples/fabric-admin/device_manager/DeviceManager.cpp +++ b/examples/fabric-admin/device_manager/DeviceManager.cpp @@ -30,6 +30,7 @@ using namespace chip::app::Clusters; namespace { +constexpr EndpointId kAggregatorEndpointId = 1; constexpr uint16_t kWindowTimeout = 300; constexpr uint16_t kIteration = 1000; constexpr uint16_t kSubscribeMinInterval = 0; @@ -207,7 +208,7 @@ 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 --keepSubscriptions true", kSubscribeMinInterval, kSubscribeMaxInterval, - mRemoteBridgeNodeId, kRootEndpointId); + mRemoteBridgeNodeId, kAggregatorEndpointId); PushCommand(commandBuilder.c_str()); } @@ -224,7 +225,7 @@ void DeviceManager::ReadSupportedDeviceCategories() commandBuilder.Add("commissionercontrol read supported-device-categories "); commandBuilder.AddFormat("%ld ", mRemoteBridgeNodeId); - commandBuilder.AddFormat("%d", kRootEndpointId); + commandBuilder.AddFormat("%d", kAggregatorEndpointId); PushCommand(commandBuilder.c_str()); } @@ -259,7 +260,7 @@ void DeviceManager::RequestCommissioningApproval() StringBuilder commandBuilder; commandBuilder.Add("commissionercontrol request-commissioning-approval "); - commandBuilder.AddFormat("%lu %u %u %lu %d", requestId, vendorId, productId, mRemoteBridgeNodeId, kRootEndpointId); + commandBuilder.AddFormat("%lu %u %u %lu %d", requestId, vendorId, productId, mRemoteBridgeNodeId, kAggregatorEndpointId); mRequestId = requestId; PushCommand(commandBuilder.c_str()); @@ -398,7 +399,7 @@ void DeviceManager::SendCommissionNodeRequest(uint64_t requestId, uint16_t respo StringBuilder commandBuilder; commandBuilder.Add("commissionercontrol commission-node "); - commandBuilder.AddFormat("%lu %u %lu %d", requestId, responseTimeoutSeconds, mRemoteBridgeNodeId, kRootEndpointId); + commandBuilder.AddFormat("%lu %u %lu %d", requestId, responseTimeoutSeconds, mRemoteBridgeNodeId, kAggregatorEndpointId); PushCommand(commandBuilder.c_str()); } diff --git a/examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.matter b/examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.matter index b261eba0bb..11dcf2f03d 100644 --- a/examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.matter +++ b/examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.matter @@ -2059,21 +2059,6 @@ endpoint 0 { handle command KeySetReadAllIndices; handle command KeySetReadAllIndicesResponse; } - - server cluster CommissionerControl { - emits event CommissioningRequestResult; - ram attribute supportedDeviceCategories default = 0; - callback attribute generatedCommandList; - callback attribute acceptedCommandList; - callback attribute eventList; - callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - - handle command RequestCommissioningApproval; - handle command CommissionNode; - handle command ReverseOpenCommissioningWindow; - } } endpoint 1 { device type ma_aggregator = 14, version 1; @@ -2103,6 +2088,21 @@ endpoint 1 { callback attribute featureMap; callback attribute clusterRevision; } + + server cluster CommissionerControl { + emits event CommissioningRequestResult; + ram attribute supportedDeviceCategories default = 0; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command RequestCommissioningApproval; + handle command CommissionNode; + handle command ReverseOpenCommissioningWindow; + } } diff --git a/examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.zap b/examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.zap index 83dae81eec..6537421778 100644 --- a/examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.zap +++ b/examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.zap @@ -3969,18 +3969,46 @@ "reportableChange": 0 } ] - }, + } + ] + }, + { + "id": 2, + "name": "Anonymous Endpoint Type", + "deviceTypeRef": { + "code": 14, + "profileId": 259, + "label": "MA-aggregator", + "name": "MA-aggregator" + }, + "deviceTypes": [ { - "name": "Commissioner Control", - "code": 1873, + "code": 14, + "profileId": 259, + "label": "MA-aggregator", + "name": "MA-aggregator" + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 14 + ], + "deviceTypeName": "MA-aggregator", + "deviceTypeCode": 14, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Identify", + "code": 3, "mfgCode": null, - "define": "COMMISSIONER_CONTROL_CLUSTER", + "define": "IDENTIFY_CLUSTER", "side": "server", "enabled": 1, - "apiMaturity": "provisional", "commands": [ { - "name": "RequestCommissioningApproval", + "name": "Identify", "code": 0, "mfgCode": null, "source": "client", @@ -3988,58 +4016,50 @@ "isEnabled": 1 }, { - "name": "CommissionNode", - "code": 1, + "name": "TriggerEffect", + "code": 64, "mfgCode": null, "source": "client", "isIncoming": 1, "isEnabled": 1 - }, - { - "name": "ReverseOpenCommissioningWindow", - "code": 2, - "mfgCode": null, - "source": "server", - "isIncoming": 0, - "isEnabled": 1 } ], "attributes": [ { - "name": "SupportedDeviceCategories", + "name": "IdentifyTime", "code": 0, "mfgCode": null, "side": "server", - "type": "SupportedDeviceCategoryBitmap", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "0x0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "GeneratedCommandList", - "code": 65528, + "name": "IdentifyType", + "code": 1, "mfgCode": null, "side": "server", - "type": "array", + "type": "IdentifyTypeEnum", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "0x0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "AcceptedCommandList", - "code": 65529, + "name": "GeneratedCommandList", + "code": 65528, "mfgCode": null, "side": "server", "type": "array", @@ -4054,8 +4074,8 @@ "reportableChange": 0 }, { - "name": "EventList", - "code": 65530, + "name": "AcceptedCommandList", + "code": 65529, "mfgCode": null, "side": "server", "type": "array", @@ -4111,105 +4131,81 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 } - ], - "events": [ - { - "name": "CommissioningRequestResult", - "code": 0, - "mfgCode": null, - "side": "server", - "included": 1 - } ] - } - ] - }, - { - "id": 2, - "name": "Anonymous Endpoint Type", - "deviceTypeRef": { - "code": 14, - "profileId": 259, - "label": "MA-aggregator", - "name": "MA-aggregator" - }, - "deviceTypes": [ - { - "code": 14, - "profileId": 259, - "label": "MA-aggregator", - "name": "MA-aggregator" - } - ], - "deviceVersions": [ - 1 - ], - "deviceIdentifiers": [ - 14 - ], - "deviceTypeName": "MA-aggregator", - "deviceTypeCode": 14, - "deviceTypeProfileId": 259, - "clusters": [ + }, { - "name": "Identify", - "code": 3, + "name": "Descriptor", + "code": 29, "mfgCode": null, - "define": "IDENTIFY_CLUSTER", + "define": "DESCRIPTOR_CLUSTER", "side": "server", "enabled": 1, - "commands": [ + "attributes": [ { - "name": "Identify", + "name": "DeviceTypeList", "code": 0, "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 }, { - "name": "TriggerEffect", - "code": 64, + "name": "ServerList", + "code": 1, "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - } - ], - "attributes": [ + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { - "name": "IdentifyTime", - "code": 0, + "name": "ClientList", + "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "IdentifyType", - "code": 1, + "name": "PartsList", + "code": 3, "mfgCode": null, "side": "server", - "type": "IdentifyTypeEnum", + "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4270,10 +4266,10 @@ "side": "server", "type": "bitmap32", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4286,10 +4282,10 @@ "side": "server", "type": "int16u", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4298,64 +4294,58 @@ ] }, { - "name": "Descriptor", - "code": 29, + "name": "Commissioner Control", + "code": 1873, "mfgCode": null, - "define": "DESCRIPTOR_CLUSTER", + "define": "COMMISSIONER_CONTROL_CLUSTER", "side": "server", "enabled": 1, - "attributes": [ + "commands": [ { - "name": "DeviceTypeList", + "name": "RequestCommissioningApproval", "code": 0, "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 + "source": "client", + "isIncoming": 1, + "isEnabled": 1 }, { - "name": "ServerList", + "name": "CommissionNode", "code": 1, "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 + "source": "client", + "isIncoming": 1, + "isEnabled": 1 }, { - "name": "ClientList", + "name": "ReverseOpenCommissioningWindow", "code": 2, "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "SupportedDeviceCategories", + "code": 0, + "mfgCode": null, "side": "server", - "type": "array", + "type": "SupportedDeviceCategoryBitmap", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "PartsList", - "code": 3, + "name": "GeneratedCommandList", + "code": 65528, "mfgCode": null, "side": "server", "type": "array", @@ -4363,15 +4353,15 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "", "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "GeneratedCommandList", - "code": 65528, + "name": "AcceptedCommandList", + "code": 65529, "mfgCode": null, "side": "server", "type": "array", @@ -4379,15 +4369,15 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "", "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "AcceptedCommandList", - "code": 65529, + "name": "EventList", + "code": 65530, "mfgCode": null, "side": "server", "type": "array", @@ -4395,7 +4385,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4411,7 +4401,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4424,10 +4414,10 @@ "side": "server", "type": "bitmap32", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4440,15 +4430,24 @@ "side": "server", "type": "int16u", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "1", "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 } + ], + "events": [ + { + "name": "CommissioningRequestResult", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + } ] } ] diff --git a/examples/fabric-bridge-app/linux/CommissionerControl.cpp b/examples/fabric-bridge-app/linux/CommissionerControl.cpp index e9dded102b..138e1129b8 100644 --- a/examples/fabric-bridge-app/linux/CommissionerControl.cpp +++ b/examples/fabric-bridge-app/linux/CommissionerControl.cpp @@ -116,7 +116,7 @@ CHIP_ERROR CommissionerControlDelegate::HandleCommissioningApprovalRequest(const mLabel.ClearValue(); } - CHIP_ERROR err = CommissionerControlServer::Instance().GenerateCommissioningRequestResultEvent(result); + CHIP_ERROR err = CommissionerControlServer::Instance().GenerateCommissioningRequestResultEvent(kAggregatorEndpointId, result); if (err == CHIP_NO_ERROR) { @@ -241,7 +241,7 @@ CHIP_ERROR CommissionerControlInit() Protocols::InteractionModel::Status status = Clusters::CommissionerControl::CommissionerControlServer::Instance().SetSupportedDeviceCategoriesValue( - kRootEndpointId, supportedDeviceCategories); + Clusters::CommissionerControl::kAggregatorEndpointId, supportedDeviceCategories); if (status != Protocols::InteractionModel::Status::Success) { diff --git a/examples/fabric-bridge-app/linux/include/CommissionerControl.h b/examples/fabric-bridge-app/linux/include/CommissionerControl.h index 1188d9a796..fceb80c2d8 100644 --- a/examples/fabric-bridge-app/linux/include/CommissionerControl.h +++ b/examples/fabric-bridge-app/linux/include/CommissionerControl.h @@ -26,6 +26,8 @@ namespace app { namespace Clusters { namespace CommissionerControl { +inline constexpr EndpointId kAggregatorEndpointId = 1; + class CommissionerControlDelegate : public Delegate { public: diff --git a/src/app/clusters/commissioner-control-server/commissioner-control-server.cpp b/src/app/clusters/commissioner-control-server/commissioner-control-server.cpp index d6282f287a..ea0c9b1203 100644 --- a/src/app/clusters/commissioner-control-server/commissioner-control-server.cpp +++ b/src/app/clusters/commissioner-control-server/commissioner-control-server.cpp @@ -132,10 +132,11 @@ CommissionerControlServer::SetSupportedDeviceCategoriesValue(EndpointId endpoint } CHIP_ERROR -CommissionerControlServer::GenerateCommissioningRequestResultEvent(const Events::CommissioningRequestResult::Type & result) +CommissionerControlServer::GenerateCommissioningRequestResultEvent(EndpointId endpoint, + const Events::CommissioningRequestResult::Type & result) { EventNumber eventNumber; - CHIP_ERROR error = LogEvent(result, kRootEndpointId, eventNumber); + CHIP_ERROR error = LogEvent(result, endpoint, eventNumber); if (CHIP_NO_ERROR != error) { ChipLogError(Zcl, "CommissionerControl: Unable to emit CommissioningRequestResult event: %" CHIP_ERROR_FORMAT, diff --git a/src/app/clusters/commissioner-control-server/commissioner-control-server.h b/src/app/clusters/commissioner-control-server/commissioner-control-server.h index e63769de1d..56f43620b5 100644 --- a/src/app/clusters/commissioner-control-server/commissioner-control-server.h +++ b/src/app/clusters/commissioner-control-server/commissioner-control-server.h @@ -120,7 +120,8 @@ class CommissionerControlServer * @brief * Called after the server return SUCCESS to a correctly formatted RequestCommissioningApproval command. */ - CHIP_ERROR GenerateCommissioningRequestResultEvent(const Events::CommissioningRequestResult::Type & result); + CHIP_ERROR GenerateCommissioningRequestResultEvent(EndpointId endpoint, + const Events::CommissioningRequestResult::Type & result); private: CommissionerControlServer() = default; diff --git a/src/python_testing/TC_CCTRL_2_2.py b/src/python_testing/TC_CCTRL_2_2.py index 7e7937d86f..a2e7b15dc2 100644 --- a/src/python_testing/TC_CCTRL_2_2.py +++ b/src/python_testing/TC_CCTRL_2_2.py @@ -194,7 +194,7 @@ async def test_TC_CCTRL_2_2(self): self.step(9) cmd = Clusters.AdministratorCommissioning.Commands.RevokeCommissioning() # If no exception is raised, this is success - await self.send_single_cmd(cmd, timedRequestTimeoutMs=5000) + await self.send_single_cmd(cmd, endpoint=0, timedRequestTimeoutMs=5000) self.step(10) if not events: diff --git a/src/python_testing/TC_MCORE_FS_1_1.py b/src/python_testing/TC_MCORE_FS_1_1.py index 3fd126fc52..995a80cd94 100755 --- a/src/python_testing/TC_MCORE_FS_1_1.py +++ b/src/python_testing/TC_MCORE_FS_1_1.py @@ -51,6 +51,8 @@ from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts +_DEVICE_TYPE_AGGREGATOR = 0x000E + class TC_MCORE_FS_1_1(MatterBaseTest): @@ -124,8 +126,34 @@ def default_timeout(self) -> int: @async_test_body async def test_TC_MCORE_FS_1_1(self): - # TODO this value should either be determined or passed in from command line dut_commissioning_control_endpoint = 0 + + # Get the list of endpoints on the DUT_FSA_BRIDGE before adding the TH_SERVER_NO_UID. + dut_fsa_bridge_endpoints = set(await self.read_single_attribute_check_success( + cluster=Clusters.Descriptor, + attribute=Clusters.Descriptor.Attributes.PartsList, + node_id=self.dut_node_id, + endpoint=0, + )) + + # Iterate through the endpoints on the DUT_FSA_BRIDGE + for endpoint in dut_fsa_bridge_endpoints: + # Read the DeviceTypeList attribute for the current endpoint + device_type_list = await self.read_single_attribute_check_success( + cluster=Clusters.Descriptor, + attribute=Clusters.Descriptor.Attributes.DeviceTypeList, + node_id=self.dut_node_id, + endpoint=endpoint + ) + + # Check if any of the device types is an AGGREGATOR + if any(device_type.deviceType == _DEVICE_TYPE_AGGREGATOR for device_type in device_type_list): + dut_commissioning_control_endpoint = endpoint + logging.info(f"Aggregator endpoint found: {dut_commissioning_control_endpoint}") + break + + asserts.assert_not_equal(dut_commissioning_control_endpoint, 0, "Invalid aggregator endpoint. Cannot proceed with test.") + self.step(1) self.step(2) self.step(3) diff --git a/src/python_testing/TC_MCORE_FS_1_3.py b/src/python_testing/TC_MCORE_FS_1_3.py index 39042271e1..2ac1556199 100644 --- a/src/python_testing/TC_MCORE_FS_1_3.py +++ b/src/python_testing/TC_MCORE_FS_1_3.py @@ -54,6 +54,8 @@ from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts +_DEVICE_TYPE_AGGREGATOR = 0x000E + class TC_MCORE_FS_1_3(MatterBaseTest): @@ -109,7 +111,7 @@ def steps_TC_MCORE_FS_1_3(self) -> list[TestStep]: "TH verifies a value is visible for the UniqueID from the DUT_FSA's Bridged Device Basic Information Cluster."), ] - async def commission_via_commissioner_control(self, controller_node_id: int, device_node_id: int): + async def commission_via_commissioner_control(self, controller_node_id: int, device_node_id: int, endpoint_id: int): """Commission device_node_id to controller_node_id using CommissionerControl cluster.""" request_id = random.randint(0, 0xFFFFFFFFFFFFFFFF) @@ -128,6 +130,7 @@ async def commission_via_commissioner_control(self, controller_node_id: int, dev await self.send_single_cmd( node_id=controller_node_id, + endpoint=endpoint_id, cmd=Clusters.CommissionerControl.Commands.RequestCommissioningApproval( requestID=request_id, vendorID=vendor_id, @@ -140,6 +143,7 @@ async def commission_via_commissioner_control(self, controller_node_id: int, dev resp = await self.send_single_cmd( node_id=controller_node_id, + endpoint=endpoint_id, cmd=Clusters.CommissionerControl.Commands.CommissionNode( requestID=request_id, responseTimeoutSeconds=30, @@ -194,9 +198,30 @@ async def test_TC_MCORE_FS_1_3(self): endpoint=0, )) + aggregator_endpoint = 0 + + # Iterate through the endpoints on the DUT_FSA_BRIDGE + for endpoint in dut_fsa_bridge_endpoints: + # Read the DeviceTypeList attribute for the current endpoint + device_type_list = await self.read_single_attribute_check_success( + cluster=Clusters.Descriptor, + attribute=Clusters.Descriptor.Attributes.DeviceTypeList, + node_id=self.dut_node_id, + endpoint=endpoint + ) + + # Check if any of the device types is an AGGREGATOR + if any(device_type.deviceType == _DEVICE_TYPE_AGGREGATOR for device_type in device_type_list): + aggregator_endpoint = endpoint + logging.info(f"Aggregator endpoint found: {aggregator_endpoint}") + break + + asserts.assert_not_equal(aggregator_endpoint, 0, "Invalid aggregator endpoint. Cannot proceed with commissioning.") + await self.commission_via_commissioner_control( controller_node_id=self.dut_node_id, - device_node_id=th_server_th_node_id) + device_node_id=th_server_th_node_id, + endpoint_id=aggregator_endpoint) # Wait for the device to appear on the DUT_FSA_BRIDGE. await asyncio.sleep(2 if self.is_pics_sdk_ci_only else 30) From 54f04935ce0587d97856e2b2be1a4f8a73094606 Mon Sep 17 00:00:00 2001 From: Marius Tache <102153746+marius-alex-tache@users.noreply.github.com> Date: Thu, 10 Oct 2024 16:19:13 +0300 Subject: [PATCH 074/127] [NXP] Bump nxp_matter_support (#36008) - Update Windows bootstrap script Signed-off-by: marius-alex-tache --- third_party/nxp/nxp_matter_support | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/nxp/nxp_matter_support b/third_party/nxp/nxp_matter_support index e46fdce014..41e38b6593 160000 --- a/third_party/nxp/nxp_matter_support +++ b/third_party/nxp/nxp_matter_support @@ -1 +1 @@ -Subproject commit e46fdce014aef075c68a62cbd87e4a6791edd392 +Subproject commit 41e38b6593b68741f2c107d3c5296bfea5b3c1c7 From 8dc3d3933ec6f02700baf46917ead45c39303246 Mon Sep 17 00:00:00 2001 From: lpbeliveau-silabs <112982107+lpbeliveau-silabs@users.noreply.github.com> Date: Thu, 10 Oct 2024 09:57:15 -0400 Subject: [PATCH 075/127] [Energy Management] Silabs Dishwasher, Electrical sensor and DEM app (#35948) * Adding a Silabs dishwasher app, supports Electrical sensor and DEM Somewhat acceptable state, build & runs, got to try the tests * Removed the lock on Device Energy Management Mode * Applied suggestions related to Electrical Sensor --- .github/.wordlist.txt | 1 + examples/dishwasher-app/silabs/.gn | 29 + examples/dishwasher-app/silabs/BUILD.gn | 255 + examples/dishwasher-app/silabs/README.md | 236 + .../silabs/build_for_wifi_args.gni | 24 + .../silabs/build_for_wifi_gnfile.gn | 28 + .../dishwasher-app/silabs/build_overrides | 1 + .../dishwasher-app/silabs/data_model/BUILD.gn | 27 + .../data_model/dishwasher-thread-app.matter | 2809 ++++++++ .../data_model/dishwasher-thread-app.zap | 6002 +++++++++++++++++ .../data_model/dishwasher-wifi-app.matter | 2669 ++++++++ .../silabs/data_model/dishwasher-wifi-app.zap | 5189 ++++++++++++++ .../dishwasher-app/silabs/include/AppConfig.h | 88 + .../dishwasher-app/silabs/include/AppEvent.h | 55 + .../dishwasher-app/silabs/include/AppTask.h | 103 + .../silabs/include/CHIPProjectConfig.h | 102 + .../silabs/include/DataModelHelper.h | 27 + .../silabs/include/DeviceEnergyManager.h | 37 + .../silabs/include/DishwasherManager.h | 99 + .../ElectricalEnergyMeasurementInstance.h | 75 + .../silabs/include/ElectricalSensorManager.h | 37 + .../include/PowerTopologyDelegateImpl.h | 50 + .../include/operational-state-delegate-impl.h | 90 + examples/dishwasher-app/silabs/openthread.gn | 29 + examples/dishwasher-app/silabs/openthread.gni | 28 + .../dishwasher-app/silabs/src/AppTask.cpp | 237 + .../silabs/src/DataModelHelper.cpp | 42 + .../silabs/src/DeviceEnergyManager.cpp | 167 + .../silabs/src/DishwasherManager.cpp | 209 + .../ElectricalEnergyMeasurementInstance.cpp | 193 + .../silabs/src/ElectricalSensorManager.cpp | 215 + .../silabs/src/PowerTopologyDelegateImpl.cpp | 101 + .../silabs/src/ZclCallbacks.cpp | 56 + .../src/operational-state-delegate-impl.cpp | 217 + .../silabs/third_party/connectedhomeip | 1 + .../include/EnergyTimeUtils.h | 0 .../include/DEMManufacturerDelegate.h | 39 + .../DeviceEnergyManagementDelegateImpl.h | 1 + .../src/DEMTestEventTriggers.cpp | 1 - .../DeviceEnergyManagementDelegateImpl.cpp | 5 + .../src/device-energy-management-mode.cpp | 10 +- .../include/EVSEManufacturerImpl.h | 6 +- .../energy-reporting/src/FakeReadings.cpp | 14 +- .../zcl/data-model/chip/matter-devices.xml | 13 + .../zap-generated/MTRDeviceTypeMetadata.mm | 1 + .../cluster/logging/EntryToText.cpp | 2 + 46 files changed, 19605 insertions(+), 15 deletions(-) create mode 100644 examples/dishwasher-app/silabs/.gn create mode 100644 examples/dishwasher-app/silabs/BUILD.gn create mode 100644 examples/dishwasher-app/silabs/README.md create mode 100644 examples/dishwasher-app/silabs/build_for_wifi_args.gni create mode 100644 examples/dishwasher-app/silabs/build_for_wifi_gnfile.gn create mode 120000 examples/dishwasher-app/silabs/build_overrides create mode 100644 examples/dishwasher-app/silabs/data_model/BUILD.gn create mode 100644 examples/dishwasher-app/silabs/data_model/dishwasher-thread-app.matter create mode 100644 examples/dishwasher-app/silabs/data_model/dishwasher-thread-app.zap create mode 100644 examples/dishwasher-app/silabs/data_model/dishwasher-wifi-app.matter create mode 100644 examples/dishwasher-app/silabs/data_model/dishwasher-wifi-app.zap create mode 100644 examples/dishwasher-app/silabs/include/AppConfig.h create mode 100644 examples/dishwasher-app/silabs/include/AppEvent.h create mode 100644 examples/dishwasher-app/silabs/include/AppTask.h create mode 100644 examples/dishwasher-app/silabs/include/CHIPProjectConfig.h create mode 100644 examples/dishwasher-app/silabs/include/DataModelHelper.h create mode 100644 examples/dishwasher-app/silabs/include/DeviceEnergyManager.h create mode 100644 examples/dishwasher-app/silabs/include/DishwasherManager.h create mode 100644 examples/dishwasher-app/silabs/include/ElectricalEnergyMeasurementInstance.h create mode 100644 examples/dishwasher-app/silabs/include/ElectricalSensorManager.h create mode 100644 examples/dishwasher-app/silabs/include/PowerTopologyDelegateImpl.h create mode 100644 examples/dishwasher-app/silabs/include/operational-state-delegate-impl.h create mode 100644 examples/dishwasher-app/silabs/openthread.gn create mode 100644 examples/dishwasher-app/silabs/openthread.gni create mode 100644 examples/dishwasher-app/silabs/src/AppTask.cpp create mode 100644 examples/dishwasher-app/silabs/src/DataModelHelper.cpp create mode 100644 examples/dishwasher-app/silabs/src/DeviceEnergyManager.cpp create mode 100644 examples/dishwasher-app/silabs/src/DishwasherManager.cpp create mode 100644 examples/dishwasher-app/silabs/src/ElectricalEnergyMeasurementInstance.cpp create mode 100644 examples/dishwasher-app/silabs/src/ElectricalSensorManager.cpp create mode 100644 examples/dishwasher-app/silabs/src/PowerTopologyDelegateImpl.cpp create mode 100644 examples/dishwasher-app/silabs/src/ZclCallbacks.cpp create mode 100644 examples/dishwasher-app/silabs/src/operational-state-delegate-impl.cpp create mode 120000 examples/dishwasher-app/silabs/third_party/connectedhomeip rename examples/energy-management-app/energy-management-common/{energy-evse => common}/include/EnergyTimeUtils.h (100%) diff --git a/.github/.wordlist.txt b/.github/.wordlist.txt index 5c24cdec82..f3954d1eb8 100644 --- a/.github/.wordlist.txt +++ b/.github/.wordlist.txt @@ -1006,6 +1006,7 @@ OpenThreadDemo openweave OperationalCredentials operationalDataset +operationalstate opkg OPTIGA optionMask diff --git a/examples/dishwasher-app/silabs/.gn b/examples/dishwasher-app/silabs/.gn new file mode 100644 index 0000000000..b05216fc9d --- /dev/null +++ b/examples/dishwasher-app/silabs/.gn @@ -0,0 +1,29 @@ +# 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" + chip_openthread_ftd = true + + import("//openthread.gni") +} diff --git a/examples/dishwasher-app/silabs/BUILD.gn b/examples/dishwasher-app/silabs/BUILD.gn new file mode 100644 index 0000000000..d024a5da95 --- /dev/null +++ b/examples/dishwasher-app/silabs/BUILD.gn @@ -0,0 +1,255 @@ +# Copyright (c) 2020 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/build.gni") +import("//build_overrides/chip.gni") +import("//build_overrides/efr32_sdk.gni") +import("//build_overrides/pigweed.gni") + +import("${build_root}/config/defaults.gni") +import("${efr32_sdk_build_root}/silabs_executable.gni") + +import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") +import("${chip_root}/src/platform/device.gni") +import("${chip_root}/third_party/silabs/silabs_board.gni") + +if (chip_enable_pw_rpc) { + import("//build_overrides/pigweed.gni") + import("$dir_pw_build/target_types.gni") +} + +assert(current_os == "freertos") + +silabs_project_dir = "${chip_root}/examples/dishwasher-app/silabs" +examples_common_plat_dir = "${chip_root}/examples/platform/silabs" +example_enegy_management_dir = "${chip_root}/examples/energy-management-app" + +if (wifi_soc) { + import("${chip_root}/third_party/silabs/SiWx917_sdk.gni") + examples_plat_dir = "${chip_root}/examples/platform/silabs/SiWx917" +} else { + import("${efr32_sdk_build_root}/efr32_sdk.gni") + examples_plat_dir = "${chip_root}/examples/platform/silabs/efr32" +} + +import("${examples_common_plat_dir}/args.gni") + +declare_args() { + # Dump memory usage at link time. + chip_print_memory_usage = false +} + +if (slc_generate) { + # Generate Project Specific config (Board, hardware used etc..) + print(exec_script("${chip_root}/third_party/silabs/slc_gen/run_slc.py", + [ + rebase_path(chip_root), + "${silabs_board}", + "${disable_lcd}", + "${use_wstk_buttons}", + "${use_wstk_leds}", + "${use_external_flash}", + "${silabs_mcu}", + rebase_path(slc_gen_path), + ], + "list lines")) +} + +if (wifi_soc) { + siwx917_sdk("sdk") { + sources = [ + "${examples_common_plat_dir}/FreeRTOSConfig.h", + "${silabs_project_dir}/include/CHIPProjectConfig.h", + ] + + include_dirs = [ + "${chip_root}/src/platform/silabs/SiWx917", + "${silabs_project_dir}/include", + "${examples_plat_dir}", + "${chip_root}/src/lib", + "${examples_common_plat_dir}", + ] + + defines = [] + if (chip_enable_pw_rpc) { + defines += [ + "HAL_VCOM_ENABLE=1", + "PW_RPC_ENABLED", + ] + } + } +} else { + efr32_sdk("sdk") { + sources = [ + "${examples_common_plat_dir}/FreeRTOSConfig.h", + "${silabs_project_dir}/include/CHIPProjectConfig.h", + ] + + include_dirs = [ + "${chip_root}/src/platform/silabs/efr32", + "${silabs_project_dir}/include", + "${examples_plat_dir}", + "${chip_root}/src/lib", + "${examples_common_plat_dir}", + ] + + if (use_wf200) { + # TODO efr32_sdk should not need a header from this location + include_dirs += [ "${examples_plat_dir}/wf200" ] + } + + if (chip_enable_ble_rs911x) { + # TODO efr32_sdk should not need a header from this location + include_dirs += [ + "${examples_plat_dir}/rs911x", + "${examples_plat_dir}/rs911x/hal", + ] + } + + defines = [] + if (chip_enable_pw_rpc) { + defines += [ + "HAL_VCOM_ENABLE=1", + "PW_RPC_ENABLED", + ] + } + } +} +silabs_executable("dishwasher_app") { + output_name = "matter-silabs-dishwasher-example.out" + defines = [] + include_dirs = [ + "include", + "${example_enegy_management_dir}/energy-management-common/device-energy-management/include", + "${example_enegy_management_dir}/energy-management-common/energy-reporting/include", + "${example_enegy_management_dir}/energy-management-common/common/include", + ] + + if (silabs_board == "BRD2704A") { + defines += [ "SL_STATUS_LED=0" ] + } + + sources = [ + "${example_enegy_management_dir}/energy-management-common/common/src/EnergyTimeUtils.cpp", + "${example_enegy_management_dir}/energy-management-common/device-energy-management/src/DEMTestEventTriggers.cpp", + "${example_enegy_management_dir}/energy-management-common/device-energy-management/src/DeviceEnergyManagementDelegateImpl.cpp", + "${example_enegy_management_dir}/energy-management-common/device-energy-management/src/DeviceEnergyManagementManager.cpp", + "${example_enegy_management_dir}/energy-management-common/device-energy-management/src/device-energy-management-mode.cpp", + "${example_enegy_management_dir}/energy-management-common/energy-reporting/src/ElectricalPowerMeasurementDelegate.cpp", + "${example_enegy_management_dir}/energy-management-common/energy-reporting/src/EnergyReportingEventTriggers.cpp", + "${example_enegy_management_dir}/energy-management-common/energy-reporting/src/FakeReadings.cpp", + "${example_enegy_management_dir}/energy-management-common/energy-reporting/src/PowerTopologyDelegate.cpp", + "${examples_common_plat_dir}/main.cpp", + "src/AppTask.cpp", + "src/DataModelHelper.cpp", + "src/DeviceEnergyManager.cpp", + "src/DishwasherManager.cpp", + "src/ElectricalEnergyMeasurementInstance.cpp", + "src/ElectricalSensorManager.cpp", + "src/PowerTopologyDelegateImpl.cpp", + "src/ZclCallbacks.cpp", + "src/operational-state-delegate-impl.cpp", + ] + + deps = [ + ":sdk", + "${chip_root}/src/platform/logging:default", + app_data_model, + ] + + if (wifi_soc) { + deps += [ "${examples_plat_dir}:siwx917-common" ] + } else { + deps += [ "${examples_plat_dir}:efr32-common" ] + } + + if (chip_enable_pw_rpc) { + defines += [ + "PW_RPC_ENABLED", + "PW_RPC_ATTRIBUTE_SERVICE=1", + "PW_RPC_BUTTON_SERVICE=1", + "PW_RPC_DESCRIPTOR_SERVICE=1", + "PW_RPC_DEVICE_SERVICE=1", + "PW_RPC_OTCLI_SERVICE=1", + "PW_RPC_THREAD_SERVICE=1", + "PW_RPC_TRACING_SERVICE=1", + ] + + sources += [ + "${chip_root}/examples/common/pigweed/RpcService.cpp", + "${chip_root}/examples/common/pigweed/efr32/PigweedLoggerMutex.cpp", + "${examples_common_plat_dir}/PigweedLogger.cpp", + "${examples_common_plat_dir}/Rpc.cpp", + ] + + deps += [ + "$dir_pw_hdlc:default_addresses", + "$dir_pw_hdlc:rpc_channel_output", + "$dir_pw_stream:sys_io_stream", + "$dir_pw_trace", + "$dir_pw_trace_tokenized", + "$dir_pw_trace_tokenized:trace_rpc_service", + "${chip_root}/config/efr32/lib/pw_rpc:pw_rpc", + "${chip_root}/examples/common/pigweed:attributes_service.nanopb_rpc", + "${chip_root}/examples/common/pigweed:button_service.nanopb_rpc", + "${chip_root}/examples/common/pigweed:descriptor_service.nanopb_rpc", + "${chip_root}/examples/common/pigweed:ot_cli_service.nanopb_rpc", + "${chip_root}/examples/common/pigweed:thread_service.nanopb_rpc", + ] + + if (wifi_soc) { + deps += [ "${examples_plat_dir}/pw_sys_io:pw_sys_io_siwx917" ] + } else { + deps += [ "${examples_common_plat_dir}/pw_sys_io:pw_sys_io_silabs" ] + } + + deps += pw_build_LINK_DEPS + + include_dirs += [ + "${chip_root}/examples/common", + "${chip_root}/examples/common/pigweed/efr32", + ] + } + + ldscript = "${examples_common_plat_dir}/ldscripts/${silabs_family}.ld" + + inputs = [ ldscript ] + + ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ] + + if (chip_print_memory_usage) { + ldflags += [ + "-Wl,--print-memory-usage", + "-fstack-usage", + ] + } + + # WiFi Settings + if (chip_enable_wifi) { + ldflags += [ + "-Wl,--defsym", + "-Wl,SILABS_WIFI=1", + ] + } + + output_dir = root_out_dir +} + +group("silabs") { + deps = [ ":dishwasher_app" ] +} + +group("default") { + deps = [ ":silabs" ] +} diff --git a/examples/dishwasher-app/silabs/README.md b/examples/dishwasher-app/silabs/README.md new file mode 100644 index 0000000000..e2586446b8 --- /dev/null +++ b/examples/dishwasher-app/silabs/README.md @@ -0,0 +1,236 @@ +# Matter Silabs dishwasher Example + +An example showing the use of Matter on the Silicon Labs EFR32 MG24 boards. + +
+ +- [Matter Silabs dishwasher Example](#matter-silabs-dishwasher-example) + - [Introduction](#introduction) + - [Building](#building) + - [Flashing the Application](#flashing-the-application) + - [Viewing Logging Output](#viewing-logging-output) + - [Running the Complete Example](#running-the-complete-example) + +
+ +> **NOTE:** Silicon Laboratories now maintains a public matter GitHub repo with +> frequent releases thoroughly tested and validated. Developers looking to +> develop matter products with silabs hardware are encouraged to use our latest +> release with added tools and documentation. +> [Silabs Matter Github](https://github.com/SiliconLabs/matter/releases) + +## Introduction + +The Silabs dishwasher example provides a baseline demonstration of a dishwasher +control device, built using Matter and the Silicon Labs gecko SDK. It can be +controlled by a Chip controller over an Openthread or Wifi network.. + +The Silabs device can be commissioned over Bluetooth Low Energy where the device +and the Chip controller will exchange security information with the Rendez-vous +procedure. If using Thread, Thread Network credentials are then provided to the +Silabs device which will then join the Thread network. + +If the LCD is enabled, the LCD on the Silabs WSTK shows a QR Code containing the +needed commissioning information for the BLE connection and starting the +Rendez-vous procedure. + +The dishwasher 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 +Silicon Labs platform. + +## Building + +- Download the + [Simplicity Commander](https://www.silabs.com/mcu/programming-options) + command line tool, and ensure that `commander` is your shell search path. + (For Mac OS X, `commander` is located inside + `Commander.app/Contents/MacOS/`.) + +- Download and install a suitable ARM gcc tool chain: + [GNU Arm Embedded Toolchain 9-2019-q4-major](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads) + +- Install some additional tools (likely already present for CHIP developers): + + - Linux: `sudo apt-get install git ninja-build` + + - Mac OS X: `brew install ninja` + +- Supported hardware: + + - > For the latest supported hardware please refer to the + > [Hardware Requirements](https://github.com/SiliconLabs/matter/blob/latest/docs/silabs/general/HARDWARE_REQUIREMENTS.md) + > in the Silicon Labs Matter Github Repo + + MG21 boards: Currently not supported due to RAM limitation. + + - BRD4180A / SLWSTK6006A / Wireless Starter Kit / 2.4GHz@20dBm + + MG24 boards : + + - BRD2601B / SLWSTK6000B / Wireless Starter Kit / 2.4GHz@10dBm + - BRD2703A / SLWSTK6000B / Wireless Starter Kit / 2.4GHz@10dBm + - BRD4186C / SLWSTK6006A / Wireless Starter Kit / 2.4GHz@10dBm + - BRD4187C / SLWSTK6006A / Wireless Starter Kit / 2.4GHz@20dBm + - BRD2703A / MG24 Explorer Kit + - BRD2704A / SparkFun Thing Plus MGM240P board + +- Build the example application: + + cd ~/connectedhomeip + ./scripts/examples/gn_silabs_example.sh ./silabs_examples/dishwasher-app/silabs/ ./out/dishwasher-app BRD4187C + +* To delete generated executable, libraries and object files use: + + $ cd ~/connectedhomeip + $ rm -rf ./out/ + + OR use GN/Ninja directly + + $ cd ~/connectedhomeip/silabs_examples/dishwasher-app/silabs + $ git submodule update --init + $ source third_party/connectedhomeip/scripts/activate.sh + $ export SILABS_BOARD=BRD4187C + $ gn gen out/dishwasher-app + $ ninja -C out/dishwasher-app + +* To delete generated executable, libraries and object files use: + + $ cd ~/connectedhomeip/silabs_examples/dishwasher-app/silabs + $ rm -rf out/ + +For more build options, help is provided when running the build script without +arguments + + ./scripts/examples/gn_silabs_example.sh + +## Flashing the Application + +- On the command line: + + $ python3 out/dishwasher-app/matter-silabs-dishwasher-example.flash.py + +- Or with the Ozone debugger, just load the .out file. + +All Silabs boards require a bootloader, see Silicon Labs documentation for more +info. Pre-built bootloader binaries are available in the Assets section of the +Releases page on +[Silabs Matter Github](https://github.com/SiliconLabs/matter/releases) . + +## Viewing Logging Output + +The example application is built to use the SEGGER Real Time Transfer (RTT) +facility for log output. RTT is a feature built-in to the J-Link Interface MCU +on the WSTK development board. It allows bi-directional communication with an +embedded application without the need for a dedicated UART. + +Using the RTT facility requires downloading and installing the _SEGGER J-Link +Software and Documentation Pack_ +([web site](https://www.segger.com/downloads/jlink#J-LinkSoftwareAndDocumentationPack)). + +Alternatively, SEGGER Ozone J-Link debugger can be used to view RTT logs too +after flashing the .out file. + +- Download the J-Link installer by navigating to the appropriate URL and + agreeing to the license agreement. + +- [JLink_Linux_x86_64.deb](https://www.segger.com/downloads/jlink/JLink_Linux_x86_64.deb) +- [JLink_MacOSX.pkg](https://www.segger.com/downloads/jlink/JLink_MacOSX.pkg) + +* Install the J-Link software + + $ cd ~/Downloads + $ sudo dpkg -i JLink_Linux_V*_x86_64.deb + +* In Linux, grant the logged in user the ability to talk to the development + hardware via the linux tty device (/dev/ttyACMx) by adding them to the + dialout group. + + $ sudo usermod -a -G dialout ${USER} + +Once the above is complete, log output can be viewed using the JLinkExe tool in +combination with JLinkRTTClient as follows: + +- Run the JLinkExe tool with arguments to autoconnect to the WSTK board: + + For MG24 use: + + $ JLinkExe -device EFR32MG24AXXXF1024 -if SWD -speed 4000 -autoconnect 1 + +- In a second terminal, run the JLinkRTTClient to view logs: + + $ JLinkRTTClient + +## Running the Complete Example + +- It is assumed here that you already have an OpenThread border router + configured and running. If not see the following guide + [Openthread_border_router](https://github.com/project-chip/connectedhomeip/blob/master/docs/guides/openthread_border_router_pi.md) + for more information on how to setup a border router on a raspberryPi. + + Take note that the RCP code is available directly through + [Simplicity Studio 5](https://www.silabs.com/products/development-tools/software/simplicity-studio/simplicity-studio-5) + under File->New->Project Wizard->Examples->Thread : ot-rcp + +- User interface : **LCD** The LCD on Silabs WSTK shows a QR Code. This QR + Code is be scanned by the CHIP Tool app For the Rendez-vous procedure over + BLE + + * On devices that do not have or support the LCD Display like the BRD4166A Thunderboard Sense 2, + a URL can be found in the RTT logs. + + [SVR] Copy/paste the below URL in a browser to see the QR Code: + [SVR] https://project-chip.github.io/connectedhomeip/qrcode.html?data=CH%3AI34NM%20-00%200C9SS0 + + **LED 0** shows the overall state of the device and its connectivity. The + following states are possible: + + - _Short Flash On (50 ms on/950 ms off)_ ; The device is in the + unprovisioned (unpaired) state and is waiting for a commissioning + application to connect. + + - _Rapid Even Flashing_ ; (100 ms on/100 ms off)_ — The device is in the + unprovisioned state and a commissioning application is connected through + Bluetooth LE. + + - _Short Flash Off_ ; (950ms on/50ms off)_ — The device is fully + provisioned, but does not yet have full Thread network or service + connectivity. + + - _Solid On_ ; The device is fully provisioned and has full Thread + network and service connectivity. + + **LED 1** Shows the dishwasher working state following states are possible: + + - _Solid On_ ; dishwasher is running + - _Slow_Blink_ ; dishwasher is paused + - _Off_ ; dishwasher is stopped + - _Fast_Blink_ ; dishwasher has encountered an error + + **Push Button 0** + + - _Press and Release_ : Start, or restart, BLE advertisement in fast mode. It will advertise in this mode + for 30 seconds. The device will then switch to a slower interval advertisement. + After 15 minutes, the advertisement stops. + + - _Pressed and hold for 6 s_ : Initiates the factory reset of the device. + Releasing the button within the 6-second window cancels the factory reset + procedure. **LEDs** blink in unison when the factory reset procedure is + initiated. + + **Push Button 1** Cycle the dishwasher operational states + Running/Paused/Stopped + +### Commissioning + +You can provision and control the Matter device using the python controller, +`chip-tool` standalone, Android, or iOS app. + +Silabs provides `chip-tool` as a wrapper function and more user-friendly method +of using [chip-tool](../../chip-tool/README.md) within the pre-built Raspberry +Pi image. For more info on using `chip-tool`, see +[Chiptool](../../../docs/guides/chip_tool_guide.md). + +Here is an example using `chip-tool`: + + $ chip-tool pairing ble-thread 1 hex:0e080000000000010000000300001335060004001fffe002084fe76e9a8b5edaf50708fde46f999f0698e20510d47f5027a414ffeebaefa92285cc84fa030f4f70656e5468726561642d653439630102e49c0410b92f8c7fbb4f9f3e08492ee3915fbd2f0c0402a0fff8 20202021 3840 --ble-adapter 0 + $ chip-tool operationalstate start 1 1 diff --git a/examples/dishwasher-app/silabs/build_for_wifi_args.gni b/examples/dishwasher-app/silabs/build_for_wifi_args.gni new file mode 100644 index 0000000000..7e52816578 --- /dev/null +++ b/examples/dishwasher-app/silabs/build_for_wifi_args.gni @@ -0,0 +1,24 @@ +# 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("${chip_root}/config/standalone/args.gni") + +silabs_sdk_target = get_label_info(":sdk", "label_no_toolchain") +chip_enable_openthread = false +import("${chip_root}/src/platform/silabs/wifi_args.gni") + +sl_enable_test_event_trigger = true +chip_enable_ota_requestor = true +app_data_model = + "${chip_root}/examples/dishwasher-app/silabs/data_model:silabs-dishwasher" diff --git a/examples/dishwasher-app/silabs/build_for_wifi_gnfile.gn b/examples/dishwasher-app/silabs/build_for_wifi_gnfile.gn new file mode 100644 index 0000000000..d391814190 --- /dev/null +++ b/examples/dishwasher-app/silabs/build_for_wifi_gnfile.gn @@ -0,0 +1,28 @@ +# Copyright (c) 2020 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/build.gni") + +# The location of the build configuration file. +buildconfig = "${build_root}/config/BUILDCONFIG.gn" + +# CHIP uses angle bracket includes. +check_system_includes = true + +default_args = { + target_cpu = "arm" + target_os = "freertos" + chip_enable_wifi = true + import("//build_for_wifi_args.gni") +} diff --git a/examples/dishwasher-app/silabs/build_overrides b/examples/dishwasher-app/silabs/build_overrides new file mode 120000 index 0000000000..f2758328a7 --- /dev/null +++ b/examples/dishwasher-app/silabs/build_overrides @@ -0,0 +1 @@ +../../../examples/build_overrides \ No newline at end of file diff --git a/examples/dishwasher-app/silabs/data_model/BUILD.gn b/examples/dishwasher-app/silabs/data_model/BUILD.gn new file mode 100644 index 0000000000..d1ade242d1 --- /dev/null +++ b/examples/dishwasher-app/silabs/data_model/BUILD.gn @@ -0,0 +1,27 @@ +# 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("${chip_root}/src/app/chip_data_model.gni") +import("${chip_root}/src/platform/device.gni") + +chip_data_model("silabs-dishwasher") { + if (chip_enable_wifi) { + zap_file = "dishwasher-wifi-app.zap" + } else { + zap_file = "dishwasher-thread-app.zap" + } + + is_server = true +} diff --git a/examples/dishwasher-app/silabs/data_model/dishwasher-thread-app.matter b/examples/dishwasher-app/silabs/data_model/dishwasher-thread-app.matter new file mode 100644 index 0000000000..0d217ab47b --- /dev/null +++ b/examples/dishwasher-app/silabs/data_model/dishwasher-thread-app.matter @@ -0,0 +1,2809 @@ +// This IDL was generated automatically by ZAP. +// It is for view/code review purposes only. + +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum AtomicRequestTypeEnum : enum8 { + kBeginWrite = 0; + kCommitWrite = 1; + kRollbackWrite = 2; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; +} + +enum RelativePositionTag : enum8 { + kUnder = 0; + kNextTo = 1; + kAround = 2; + kOn = 3; + kAbove = 4; + kFrontOf = 5; + kBehind = 6; +} + +enum TestGlobalEnum : enum8 { + kSomeValue = 0; + kSomeOtherValue = 1; + kFinalValue = 2; +} + +enum ThreeLevelAutoEnum : enum8 { + kLow = 0; + kMedium = 1; + kHigh = 2; + kAutomatic = 3; +} + +bitmap TestGlobalBitmap : bitmap32 { + kFirstBit = 0x1; + kSecondBit = 0x2; +} + +struct TestGlobalStruct { + char_string<128> name = 0; + nullable TestGlobalBitmap myBitmap = 1; + optional nullable TestGlobalEnum myEnum = 2; +} + +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + +struct AtomicAttributeStatusStruct { + attrib_id attributeID = 0; + status statusCode = 1; +} + +/** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ +cluster Identify = 3 { + revision 4; + + enum EffectIdentifierEnum : enum8 { + kBlink = 0; + kBreathe = 1; + kOkay = 2; + kChannelChange = 11; + kFinishEffect = 254; + kStopEffect = 255; + } + + enum EffectVariantEnum : enum8 { + kDefault = 0; + } + + enum IdentifyTypeEnum : enum8 { + kNone = 0; + kLightOutput = 1; + kVisibleIndicator = 2; + kAudibleBeep = 3; + kDisplay = 4; + kActuator = 5; + } + + attribute int16u identifyTime = 0; + readonly attribute IdentifyTypeEnum identifyType = 1; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct IdentifyRequest { + int16u identifyTime = 0; + } + + request struct TriggerEffectRequest { + EffectIdentifierEnum effectIdentifier = 0; + EffectVariantEnum effectVariant = 1; + } + + /** Command description for Identify */ + command access(invoke: manage) Identify(IdentifyRequest): DefaultSuccess = 0; + /** Command description for TriggerEffect */ + command access(invoke: manage) TriggerEffect(TriggerEffectRequest): DefaultSuccess = 64; +} + +/** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ +cluster Descriptor = 29 { + revision 2; + + bitmap Feature : bitmap32 { + kTagList = 0x1; + } + + struct DeviceTypeStruct { + devtype_id deviceType = 0; + int16u revision = 1; + } + + struct SemanticTagStruct { + nullable vendor_id mfgCode = 0; + enum8 namespaceID = 1; + enum8 tag = 2; + optional nullable char_string label = 3; + } + + readonly attribute DeviceTypeStruct deviceTypeList[] = 0; + readonly attribute cluster_id serverList[] = 1; + readonly attribute cluster_id clientList[] = 2; + readonly attribute endpoint_no partsList[] = 3; + readonly attribute optional SemanticTagStruct tagList[] = 4; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** The Binding Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for supporting the binding table. */ +cluster Binding = 30 { + revision 1; // NOTE: Default/not specifically set + + fabric_scoped struct TargetStruct { + optional node_id node = 1; + optional group_id group = 2; + optional endpoint_no endpoint = 3; + optional cluster_id cluster = 4; + fabric_idx fabricIndex = 254; + } + + attribute access(write: manage) TargetStruct binding[] = 0; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** The Access Control Cluster exposes a data model view of a + Node's Access Control List (ACL), which codifies the rules used to manage + and enforce Access Control for the Node's endpoints and their associated + cluster instances. */ +cluster AccessControl = 31 { + revision 2; + + enum AccessControlEntryAuthModeEnum : enum8 { + kPASE = 1; + kCASE = 2; + kGroup = 3; + } + + enum AccessControlEntryPrivilegeEnum : enum8 { + kView = 1; + kProxyView = 2; + kOperate = 3; + kManage = 4; + kAdminister = 5; + } + + enum AccessRestrictionTypeEnum : enum8 { + kAttributeAccessForbidden = 0; + kAttributeWriteForbidden = 1; + kCommandForbidden = 2; + kEventForbidden = 3; + } + + enum ChangeTypeEnum : enum8 { + kChanged = 0; + kAdded = 1; + kRemoved = 2; + } + + bitmap Feature : bitmap32 { + kExtension = 0x1; + kManagedDevice = 0x2; + } + + struct AccessRestrictionStruct { + AccessRestrictionTypeEnum type = 0; + nullable int32u id = 1; + } + + struct CommissioningAccessRestrictionEntryStruct { + endpoint_no endpoint = 0; + cluster_id cluster = 1; + AccessRestrictionStruct restrictions[] = 2; + } + + fabric_scoped struct AccessRestrictionEntryStruct { + fabric_sensitive endpoint_no endpoint = 0; + fabric_sensitive cluster_id cluster = 1; + fabric_sensitive AccessRestrictionStruct restrictions[] = 2; + fabric_idx fabricIndex = 254; + } + + struct AccessControlTargetStruct { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + + fabric_scoped struct AccessControlEntryStruct { + fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; + fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; + nullable fabric_sensitive int64u subjects[] = 3; + nullable fabric_sensitive AccessControlTargetStruct targets[] = 4; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct AccessControlExtensionStruct { + fabric_sensitive octet_string<128> data = 1; + fabric_idx fabricIndex = 254; + } + + fabric_sensitive info event access(read: administer) AccessControlEntryChanged = 0 { + nullable node_id adminNodeID = 1; + nullable int16u adminPasscodeID = 2; + ChangeTypeEnum changeType = 3; + nullable AccessControlEntryStruct latestValue = 4; + fabric_idx fabricIndex = 254; + } + + fabric_sensitive info event access(read: administer) AccessControlExtensionChanged = 1 { + nullable node_id adminNodeID = 1; + nullable int16u adminPasscodeID = 2; + ChangeTypeEnum changeType = 3; + nullable AccessControlExtensionStruct latestValue = 4; + fabric_idx fabricIndex = 254; + } + + fabric_sensitive info event access(read: administer) FabricRestrictionReviewUpdate = 2 { + int64u token = 0; + optional long_char_string instruction = 1; + optional long_char_string ARLRequestFlowUrl = 2; + fabric_idx fabricIndex = 254; + } + + attribute access(read: administer, write: administer) AccessControlEntryStruct acl[] = 0; + attribute access(read: administer, write: administer) optional AccessControlExtensionStruct extension[] = 1; + readonly attribute int16u subjectsPerAccessControlEntry = 2; + readonly attribute int16u targetsPerAccessControlEntry = 3; + readonly attribute int16u accessControlEntriesPerFabric = 4; + readonly attribute optional CommissioningAccessRestrictionEntryStruct commissioningARL[] = 5; + readonly attribute optional AccessRestrictionEntryStruct arl[] = 6; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ReviewFabricRestrictionsRequest { + CommissioningAccessRestrictionEntryStruct arl[] = 0; + } + + response struct ReviewFabricRestrictionsResponse = 1 { + int64u token = 0; + } + + /** This command signals to the service associated with the device vendor that the fabric administrator would like a review of the current restrictions on the accessing fabric. */ + fabric command access(invoke: administer) ReviewFabricRestrictions(ReviewFabricRestrictionsRequest): ReviewFabricRestrictionsResponse = 0; +} + +/** This cluster provides attributes and events for determining basic information about Nodes, which supports both + Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, + which apply to the whole Node. Also allows setting user device information such as location. */ +cluster BasicInformation = 40 { + revision 3; + + enum ColorEnum : enum8 { + kBlack = 0; + kNavy = 1; + kGreen = 2; + kTeal = 3; + kMaroon = 4; + kPurple = 5; + kOlive = 6; + kGray = 7; + kBlue = 8; + kLime = 9; + kAqua = 10; + kRed = 11; + kFuchsia = 12; + kYellow = 13; + kWhite = 14; + kNickel = 15; + kChrome = 16; + kBrass = 17; + kCopper = 18; + kSilver = 19; + kGold = 20; + } + + enum ProductFinishEnum : enum8 { + kOther = 0; + kMatte = 1; + kSatin = 2; + kPolished = 3; + kRugged = 4; + kFabric = 5; + } + + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + + struct ProductAppearanceStruct { + ProductFinishEnum finish = 0; + nullable ColorEnum primaryColor = 1; + } + + critical event StartUp = 0 { + int32u softwareVersion = 0; + } + + critical event ShutDown = 1 { + } + + info event Leave = 2 { + fabric_idx fabricIndex = 0; + } + + info event ReachableChanged = 3 { + boolean reachableNewValue = 0; + } + + readonly attribute int16u dataModelRevision = 0; + readonly attribute char_string<32> vendorName = 1; + readonly attribute vendor_id vendorID = 2; + readonly attribute char_string<32> productName = 3; + readonly attribute int16u productID = 4; + attribute access(write: manage) char_string<32> nodeLabel = 5; + attribute access(write: administer) char_string<2> location = 6; + readonly attribute int16u hardwareVersion = 7; + readonly attribute char_string<64> hardwareVersionString = 8; + readonly attribute int32u softwareVersion = 9; + readonly attribute char_string<64> softwareVersionString = 10; + readonly attribute optional char_string<16> manufacturingDate = 11; + readonly attribute optional char_string<32> partNumber = 12; + readonly attribute optional long_char_string<256> productURL = 13; + readonly attribute optional char_string<64> productLabel = 14; + readonly attribute optional char_string<32> serialNumber = 15; + attribute access(write: manage) optional boolean localConfigDisabled = 16; + readonly attribute optional boolean reachable = 17; + readonly attribute char_string<32> uniqueID = 18; + readonly attribute CapabilityMinimaStruct capabilityMinima = 19; + readonly attribute optional ProductAppearanceStruct productAppearance = 20; + readonly attribute int32u specificationVersion = 21; + readonly attribute int16u maxPathsPerInvoke = 22; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + command MfgSpecificPing(): DefaultSuccess = 0; +} + +/** Provides an interface for providing OTA software updates */ +cluster OtaSoftwareUpdateProvider = 41 { + revision 1; // NOTE: Default/not specifically set + + enum ApplyUpdateActionEnum : enum8 { + kProceed = 0; + kAwaitNextAction = 1; + kDiscontinue = 2; + } + + enum DownloadProtocolEnum : enum8 { + kBDXSynchronous = 0; + kBDXAsynchronous = 1; + kHTTPS = 2; + kVendorSpecific = 3; + } + + enum StatusEnum : enum8 { + kUpdateAvailable = 0; + kBusy = 1; + kNotAvailable = 2; + kDownloadProtocolNotSupported = 3; + } + + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct QueryImageRequest { + vendor_id vendorID = 0; + int16u productID = 1; + int32u softwareVersion = 2; + DownloadProtocolEnum protocolsSupported[] = 3; + optional int16u hardwareVersion = 4; + optional char_string<2> location = 5; + optional boolean requestorCanConsent = 6; + optional octet_string<512> metadataForProvider = 7; + } + + response struct QueryImageResponse = 1 { + StatusEnum status = 0; + optional int32u delayedActionTime = 1; + optional char_string<256> imageURI = 2; + optional int32u softwareVersion = 3; + optional char_string<64> softwareVersionString = 4; + optional octet_string<32> updateToken = 5; + optional boolean userConsentNeeded = 6; + optional octet_string<512> metadataForRequestor = 7; + } + + request struct ApplyUpdateRequestRequest { + octet_string<32> updateToken = 0; + int32u newVersion = 1; + } + + response struct ApplyUpdateResponse = 3 { + ApplyUpdateActionEnum action = 0; + int32u delayedActionTime = 1; + } + + request struct NotifyUpdateAppliedRequest { + octet_string<32> updateToken = 0; + int32u softwareVersion = 1; + } + + /** Determine availability of a new Software Image */ + command QueryImage(QueryImageRequest): QueryImageResponse = 0; + /** Determine next action to take for a downloaded Software Image */ + command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; + /** Notify OTA Provider that an update was applied */ + command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; +} + +/** Provides an interface for downloading and applying OTA software updates */ +cluster OtaSoftwareUpdateRequestor = 42 { + revision 1; // NOTE: Default/not specifically set + + enum AnnouncementReasonEnum : enum8 { + kSimpleAnnouncement = 0; + kUpdateAvailable = 1; + kUrgentUpdateAvailable = 2; + } + + enum ChangeReasonEnum : enum8 { + kUnknown = 0; + kSuccess = 1; + kFailure = 2; + kTimeOut = 3; + kDelayByProvider = 4; + } + + enum UpdateStateEnum : enum8 { + kUnknown = 0; + kIdle = 1; + kQuerying = 2; + kDelayedOnQuery = 3; + kDownloading = 4; + kApplying = 5; + kDelayedOnApply = 6; + kRollingBack = 7; + kDelayedOnUserConsent = 8; + } + + fabric_scoped struct ProviderLocation { + node_id providerNodeID = 1; + endpoint_no endpoint = 2; + fabric_idx fabricIndex = 254; + } + + info event StateTransition = 0 { + UpdateStateEnum previousState = 0; + UpdateStateEnum newState = 1; + ChangeReasonEnum reason = 2; + nullable int32u targetSoftwareVersion = 3; + } + + critical event VersionApplied = 1 { + int32u softwareVersion = 0; + int16u productID = 1; + } + + info event DownloadError = 2 { + int32u softwareVersion = 0; + int64u bytesDownloaded = 1; + nullable int8u progressPercent = 2; + nullable int64s platformCode = 3; + } + + attribute access(write: administer) ProviderLocation defaultOTAProviders[] = 0; + readonly attribute boolean updatePossible = 1; + readonly attribute UpdateStateEnum updateState = 2; + readonly attribute nullable int8u updateStateProgress = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AnnounceOTAProviderRequest { + node_id providerNodeID = 0; + vendor_id vendorID = 1; + AnnouncementReasonEnum announcementReason = 2; + optional octet_string<512> metadataForNode = 3; + endpoint_no endpoint = 4; + } + + /** Announce the presence of an OTA Provider */ + command AnnounceOTAProvider(AnnounceOTAProviderRequest): DefaultSuccess = 0; +} + +/** Nodes should be expected to be deployed to any and all regions of the world. These global regions + may have differing common languages, units of measurements, and numerical formatting + standards. As such, Nodes that visually or audibly convey information need a mechanism by which + they can be configured to use a user’s preferred language, units, etc */ +cluster LocalizationConfiguration = 43 { + revision 1; // NOTE: Default/not specifically set + + attribute access(write: manage) char_string<35> activeLocale = 0; + readonly attribute char_string supportedLocales[] = 1; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Nodes should be expected to be deployed to any and all regions of the world. These global regions + may have differing preferences for how dates and times are conveyed. As such, Nodes that visually + or audibly convey time information need a mechanism by which they can be configured to use a + user’s preferred format. */ +cluster TimeFormatLocalization = 44 { + revision 1; // NOTE: Default/not specifically set + + enum CalendarTypeEnum : enum8 { + kBuddhist = 0; + kChinese = 1; + kCoptic = 2; + kEthiopian = 3; + kGregorian = 4; + kHebrew = 5; + kIndian = 6; + kIslamic = 7; + kJapanese = 8; + kKorean = 9; + kPersian = 10; + kTaiwanese = 11; + kUseActiveLocale = 255; + } + + enum HourFormatEnum : enum8 { + k12hr = 0; + k24hr = 1; + kUseActiveLocale = 255; + } + + bitmap Feature : bitmap32 { + kCalendarFormat = 0x1; + } + + attribute access(write: manage) HourFormatEnum hourFormat = 0; + attribute access(write: manage) optional CalendarTypeEnum activeCalendarType = 1; + readonly attribute optional CalendarTypeEnum supportedCalendarTypes[] = 2; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Nodes should be expected to be deployed to any and all regions of the world. These global regions + may have differing preferences for the units in which values are conveyed in communication to a + user. As such, Nodes that visually or audibly convey measurable values to the user need a + mechanism by which they can be configured to use a user’s preferred unit. */ +cluster UnitLocalization = 45 { + revision 1; + + enum TempUnitEnum : enum8 { + kFahrenheit = 0; + kCelsius = 1; + kKelvin = 2; + } + + bitmap Feature : bitmap32 { + kTemperatureUnit = 0x1; + } + + attribute access(write: manage) optional TempUnitEnum temperatureUnit = 0; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** This cluster is used to manage global aspects of the Commissioning flow. */ +cluster GeneralCommissioning = 48 { + revision 1; // NOTE: Default/not specifically set + + enum CommissioningErrorEnum : enum8 { + kOK = 0; + kValueOutsideRange = 1; + kInvalidAuthentication = 2; + kNoFailSafe = 3; + kBusyWithOtherAdmin = 4; + kRequiredTCNotAccepted = 5; + kTCAcknowledgementsNotReceived = 6; + kTCMinVersionNotMet = 7; + } + + enum RegulatoryLocationTypeEnum : enum8 { + kIndoor = 0; + kOutdoor = 1; + kIndoorOutdoor = 2; + } + + bitmap Feature : bitmap32 { + kTermsAndConditions = 0x1; + } + + struct BasicCommissioningInfo { + int16u failSafeExpiryLengthSeconds = 0; + int16u maxCumulativeFailsafeSeconds = 1; + } + + attribute access(write: administer) int64u breadcrumb = 0; + readonly attribute BasicCommissioningInfo basicCommissioningInfo = 1; + readonly attribute RegulatoryLocationTypeEnum regulatoryConfig = 2; + readonly attribute RegulatoryLocationTypeEnum locationCapability = 3; + readonly attribute boolean supportsConcurrentConnection = 4; + provisional readonly attribute access(read: administer) optional int16u TCAcceptedVersion = 5; + provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; + provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; + provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ArmFailSafeRequest { + int16u expiryLengthSeconds = 0; + int64u breadcrumb = 1; + } + + response struct ArmFailSafeResponse = 1 { + CommissioningErrorEnum errorCode = 0; + char_string<128> debugText = 1; + } + + request struct SetRegulatoryConfigRequest { + RegulatoryLocationTypeEnum newRegulatoryConfig = 0; + char_string<2> countryCode = 1; + int64u breadcrumb = 2; + } + + response struct SetRegulatoryConfigResponse = 3 { + CommissioningErrorEnum errorCode = 0; + char_string debugText = 1; + } + + response struct CommissioningCompleteResponse = 5 { + CommissioningErrorEnum errorCode = 0; + char_string debugText = 1; + } + + request struct SetTCAcknowledgementsRequest { + int16u TCVersion = 0; + bitmap16 TCUserResponse = 1; + } + + response struct SetTCAcknowledgementsResponse = 7 { + CommissioningErrorEnum errorCode = 0; + } + + /** Arm the persistent fail-safe timer with an expiry time of now + ExpiryLengthSeconds using device clock */ + command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; + /** Set the regulatory configuration to be used during commissioning */ + command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; + /** Signals the Server that the Client has successfully completed all steps of Commissioning/Recofiguration needed during fail-safe period. */ + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + /** This command sets the user acknowledgements received in the Enhanced Setup Flow Terms and Conditions into the node. */ + command access(invoke: administer) SetTCAcknowledgements(SetTCAcknowledgementsRequest): SetTCAcknowledgementsResponse = 6; +} + +/** Functionality to configure, enable, disable network credentials and access on a Matter device. */ +cluster NetworkCommissioning = 49 { + revision 1; // NOTE: Default/not specifically set + + enum NetworkCommissioningStatusEnum : enum8 { + kSuccess = 0; + kOutOfRange = 1; + kBoundsExceeded = 2; + kNetworkIDNotFound = 3; + kDuplicateNetworkID = 4; + kNetworkNotFound = 5; + kRegulatoryError = 6; + kAuthFailure = 7; + kUnsupportedSecurity = 8; + kOtherConnectionFailure = 9; + kIPV6Failed = 10; + kIPBindFailed = 11; + kUnknownError = 12; + } + + enum WiFiBandEnum : enum8 { + k2G4 = 0; + k3G65 = 1; + k5G = 2; + k6G = 3; + k60G = 4; + k1G = 5; + } + + bitmap Feature : bitmap32 { + kWiFiNetworkInterface = 0x1; + kThreadNetworkInterface = 0x2; + kEthernetNetworkInterface = 0x4; + kPerDeviceCredentials = 0x8; + } + + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { + kUnencrypted = 0x1; + kWEP = 0x2; + kWPAPersonal = 0x4; + kWPA2Personal = 0x8; + kWPA3Personal = 0x10; + kWPA3MatterPDC = 0x20; + } + + struct NetworkInfoStruct { + octet_string<32> networkID = 0; + boolean connected = 1; + optional nullable octet_string<20> networkIdentifier = 2; + optional nullable octet_string<20> clientIdentifier = 3; + } + + struct ThreadInterfaceScanResultStruct { + int16u panId = 0; + int64u extendedPanId = 1; + char_string<16> networkName = 2; + int16u channel = 3; + int8u version = 4; + octet_string<8> extendedAddress = 5; + int8s rssi = 6; + int8u lqi = 7; + } + + struct WiFiInterfaceScanResultStruct { + WiFiSecurityBitmap security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBandEnum wiFiBand = 4; + int8s rssi = 5; + } + + readonly attribute access(read: administer) int8u maxNetworks = 0; + readonly attribute access(read: administer) NetworkInfoStruct networks[] = 1; + readonly attribute optional int8u scanMaxTimeSeconds = 2; + readonly attribute optional int8u connectMaxTimeSeconds = 3; + attribute access(write: administer) boolean interfaceEnabled = 4; + readonly attribute access(read: administer) nullable NetworkCommissioningStatusEnum lastNetworkingStatus = 5; + readonly attribute access(read: administer) nullable octet_string<32> lastNetworkID = 6; + readonly attribute access(read: administer) nullable int32s lastConnectErrorValue = 7; + provisional readonly attribute optional WiFiBandEnum supportedWiFiBands[] = 8; + provisional readonly attribute optional ThreadCapabilitiesBitmap supportedThreadFeatures = 9; + provisional readonly attribute optional int16u threadVersion = 10; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ScanNetworksRequest { + optional nullable octet_string<32> ssid = 0; + optional int64u breadcrumb = 1; + } + + response struct ScanNetworksResponse = 1 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional char_string debugText = 1; + optional WiFiInterfaceScanResultStruct wiFiScanResults[] = 2; + optional ThreadInterfaceScanResultStruct threadScanResults[] = 3; + } + + request struct AddOrUpdateWiFiNetworkRequest { + octet_string<32> ssid = 0; + octet_string<64> credentials = 1; + optional int64u breadcrumb = 2; + optional octet_string<140> networkIdentity = 3; + optional octet_string<20> clientIdentifier = 4; + optional octet_string<32> possessionNonce = 5; + } + + request struct AddOrUpdateThreadNetworkRequest { + octet_string<254> operationalDataset = 0; + optional int64u breadcrumb = 1; + } + + request struct RemoveNetworkRequest { + octet_string<32> networkID = 0; + optional int64u breadcrumb = 1; + } + + response struct NetworkConfigResponse = 5 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional char_string<512> debugText = 1; + optional int8u networkIndex = 2; + optional octet_string<140> clientIdentity = 3; + optional octet_string<64> possessionSignature = 4; + } + + request struct ConnectNetworkRequest { + octet_string<32> networkID = 0; + optional int64u breadcrumb = 1; + } + + response struct ConnectNetworkResponse = 7 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional char_string debugText = 1; + nullable int32s errorValue = 2; + } + + request struct ReorderNetworkRequest { + octet_string<32> networkID = 0; + int8u networkIndex = 1; + optional int64u breadcrumb = 2; + } + + request struct QueryIdentityRequest { + octet_string<20> keyIdentifier = 0; + optional octet_string<32> possessionNonce = 1; + } + + response struct QueryIdentityResponse = 10 { + octet_string<140> identity = 0; + optional octet_string<64> possessionSignature = 1; + } + + /** Detemine the set of networks the device sees as available. */ + command access(invoke: administer) ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; + /** Add or update the credentials for a given Wi-Fi network. */ + command access(invoke: administer) AddOrUpdateWiFiNetwork(AddOrUpdateWiFiNetworkRequest): NetworkConfigResponse = 2; + /** Add or update the credentials for a given Thread network. */ + command access(invoke: administer) AddOrUpdateThreadNetwork(AddOrUpdateThreadNetworkRequest): NetworkConfigResponse = 3; + /** Remove the definition of a given network (including its credentials). */ + command access(invoke: administer) RemoveNetwork(RemoveNetworkRequest): NetworkConfigResponse = 4; + /** Connect to the specified network, using previously-defined credentials. */ + command access(invoke: administer) ConnectNetwork(ConnectNetworkRequest): ConnectNetworkResponse = 6; + /** Modify the order in which networks will be presented in the Networks attribute. */ + command access(invoke: administer) ReorderNetwork(ReorderNetworkRequest): NetworkConfigResponse = 8; + /** Retrieve details about and optionally proof of possession of a network client identity. */ + command access(invoke: administer) QueryIdentity(QueryIdentityRequest): QueryIdentityResponse = 9; +} + +/** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ +cluster DiagnosticLogs = 50 { + revision 1; // NOTE: Default/not specifically set + + enum IntentEnum : enum8 { + kEndUserSupport = 0; + kNetworkDiag = 1; + kCrashLogs = 2; + } + + enum StatusEnum : enum8 { + kSuccess = 0; + kExhausted = 1; + kNoLogs = 2; + kBusy = 3; + kDenied = 4; + } + + enum TransferProtocolEnum : enum8 { + kResponsePayload = 0; + kBDX = 1; + } + + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct RetrieveLogsRequestRequest { + IntentEnum intent = 0; + TransferProtocolEnum requestedProtocol = 1; + optional char_string<32> transferFileDesignator = 2; + } + + response struct RetrieveLogsResponse = 1 { + StatusEnum status = 0; + long_octet_string logContent = 1; + optional epoch_us UTCTimeStamp = 2; + optional systime_us timeSinceBoot = 3; + } + + /** Retrieving diagnostic logs from a Node */ + command RetrieveLogsRequest(RetrieveLogsRequestRequest): RetrieveLogsResponse = 0; +} + +/** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ +cluster GeneralDiagnostics = 51 { + revision 2; + + enum BootReasonEnum : enum8 { + kUnspecified = 0; + kPowerOnReboot = 1; + kBrownOutReset = 2; + kSoftwareWatchdogReset = 3; + kHardwareWatchdogReset = 4; + kSoftwareUpdateCompleted = 5; + kSoftwareReset = 6; + } + + enum HardwareFaultEnum : enum8 { + kUnspecified = 0; + kRadio = 1; + kSensor = 2; + kResettableOverTemp = 3; + kNonResettableOverTemp = 4; + kPowerSource = 5; + kVisualDisplayFault = 6; + kAudioOutputFault = 7; + kUserInterfaceFault = 8; + kNonVolatileMemoryError = 9; + kTamperDetected = 10; + } + + enum InterfaceTypeEnum : enum8 { + kUnspecified = 0; + kWiFi = 1; + kEthernet = 2; + kCellular = 3; + kThread = 4; + } + + enum NetworkFaultEnum : enum8 { + kUnspecified = 0; + kHardwareFailure = 1; + kNetworkJammed = 2; + kConnectionFailed = 3; + } + + enum RadioFaultEnum : enum8 { + kUnspecified = 0; + kWiFiFault = 1; + kCellularFault = 2; + kThreadFault = 3; + kNFCFault = 4; + kBLEFault = 5; + kEthernetFault = 6; + } + + bitmap Feature : bitmap32 { + kDataModelTest = 0x1; + } + + struct NetworkInterface { + char_string<32> name = 0; + boolean isOperational = 1; + nullable boolean offPremiseServicesReachableIPv4 = 2; + nullable boolean offPremiseServicesReachableIPv6 = 3; + octet_string<8> hardwareAddress = 4; + octet_string IPv4Addresses[] = 5; + octet_string IPv6Addresses[] = 6; + InterfaceTypeEnum type = 7; + } + + critical event HardwareFaultChange = 0 { + HardwareFaultEnum current[] = 0; + HardwareFaultEnum previous[] = 1; + } + + critical event RadioFaultChange = 1 { + RadioFaultEnum current[] = 0; + RadioFaultEnum previous[] = 1; + } + + critical event NetworkFaultChange = 2 { + NetworkFaultEnum current[] = 0; + NetworkFaultEnum previous[] = 1; + } + + critical event BootReason = 3 { + BootReasonEnum bootReason = 0; + } + + readonly attribute NetworkInterface networkInterfaces[] = 0; + readonly attribute int16u rebootCount = 1; + readonly attribute optional int64u upTime = 2; + readonly attribute optional int32u totalOperationalHours = 3; + readonly attribute optional BootReasonEnum bootReason = 4; + readonly attribute optional HardwareFaultEnum activeHardwareFaults[] = 5; + readonly attribute optional RadioFaultEnum activeRadioFaults[] = 6; + readonly attribute optional NetworkFaultEnum activeNetworkFaults[] = 7; + readonly attribute boolean testEventTriggersEnabled = 8; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct TestEventTriggerRequest { + octet_string<16> enableKey = 0; + int64u eventTrigger = 1; + } + + response struct TimeSnapshotResponse = 2 { + systime_ms systemTimeMs = 0; + nullable posix_ms posixTimeMs = 1; + } + + request struct PayloadTestRequestRequest { + octet_string<16> enableKey = 0; + int8u value = 1; + int16u count = 2; + } + + response struct PayloadTestResponse = 4 { + octet_string payload = 0; + } + + /** Provide a means for certification tests to trigger some test-plan-specific events */ + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + /** Take a snapshot of system time and epoch time. */ + command TimeSnapshot(): TimeSnapshotResponse = 1; + /** Request a variable length payload response. */ + command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3; +} + +/** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ +cluster SoftwareDiagnostics = 52 { + revision 1; // NOTE: Default/not specifically set + + bitmap Feature : bitmap32 { + kWatermarks = 0x1; + } + + struct ThreadMetricsStruct { + int64u id = 0; + optional char_string<8> name = 1; + optional int32u stackFreeCurrent = 2; + optional int32u stackFreeMinimum = 3; + optional int32u stackSize = 4; + } + + info event SoftwareFault = 0 { + int64u id = 0; + optional char_string name = 1; + optional octet_string faultRecording = 2; + } + + readonly attribute optional ThreadMetricsStruct threadMetrics[] = 0; + readonly attribute optional int64u currentHeapFree = 1; + readonly attribute optional int64u currentHeapUsed = 2; + readonly attribute optional int64u currentHeapHighWatermark = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + /** Reception of this command SHALL reset the values: The StackFreeMinimum field of the ThreadMetrics attribute, CurrentHeapHighWaterMark attribute. */ + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; +} + +/** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ +cluster ThreadNetworkDiagnostics = 53 { + revision 2; + + enum ConnectionStatusEnum : enum8 { + kConnected = 0; + kNotConnected = 1; + } + + enum NetworkFaultEnum : enum8 { + kUnspecified = 0; + kLinkDown = 1; + kHardwareFailure = 2; + kNetworkJammed = 3; + } + + enum RoutingRoleEnum : enum8 { + kUnspecified = 0; + kUnassigned = 1; + kSleepyEndDevice = 2; + kEndDevice = 3; + kREED = 4; + kRouter = 5; + kLeader = 6; + } + + bitmap Feature : bitmap32 { + kPacketCounts = 0x1; + kErrorCounts = 0x2; + kMLECounts = 0x4; + kMACCounts = 0x8; + } + + struct NeighborTableStruct { + int64u extAddress = 0; + int32u age = 1; + int16u rloc16 = 2; + int32u linkFrameCounter = 3; + int32u mleFrameCounter = 4; + int8u lqi = 5; + nullable int8s averageRssi = 6; + nullable int8s lastRssi = 7; + int8u frameErrorRate = 8; + int8u messageErrorRate = 9; + boolean rxOnWhenIdle = 10; + boolean fullThreadDevice = 11; + boolean fullNetworkData = 12; + boolean isChild = 13; + } + + struct OperationalDatasetComponents { + boolean activeTimestampPresent = 0; + boolean pendingTimestampPresent = 1; + boolean masterKeyPresent = 2; + boolean networkNamePresent = 3; + boolean extendedPanIdPresent = 4; + boolean meshLocalPrefixPresent = 5; + boolean delayPresent = 6; + boolean panIdPresent = 7; + boolean channelPresent = 8; + boolean pskcPresent = 9; + boolean securityPolicyPresent = 10; + boolean channelMaskPresent = 11; + } + + struct RouteTableStruct { + int64u extAddress = 0; + int16u rloc16 = 1; + int8u routerId = 2; + int8u nextHop = 3; + int8u pathCost = 4; + int8u LQIIn = 5; + int8u LQIOut = 6; + int8u age = 7; + boolean allocated = 8; + boolean linkEstablished = 9; + } + + struct SecurityPolicy { + int16u rotationTime = 0; + int16u flags = 1; + } + + info event ConnectionStatus = 0 { + ConnectionStatusEnum connectionStatus = 0; + } + + info event NetworkFaultChange = 1 { + NetworkFaultEnum current[] = 0; + NetworkFaultEnum previous[] = 1; + } + + readonly attribute nullable int16u channel = 0; + readonly attribute nullable RoutingRoleEnum routingRole = 1; + readonly attribute nullable char_string<16> networkName = 2; + readonly attribute nullable int16u panId = 3; + readonly attribute nullable int64u extendedPanId = 4; + readonly attribute nullable octet_string<17> meshLocalPrefix = 5; + readonly attribute optional int64u overrunCount = 6; + readonly attribute NeighborTableStruct neighborTable[] = 7; + readonly attribute RouteTableStruct routeTable[] = 8; + readonly attribute nullable int32u partitionId = 9; + readonly attribute nullable int16u weighting = 10; + readonly attribute nullable int16u dataVersion = 11; + readonly attribute nullable int16u stableDataVersion = 12; + readonly attribute nullable int8u leaderRouterId = 13; + readonly attribute optional int16u detachedRoleCount = 14; + readonly attribute optional int16u childRoleCount = 15; + readonly attribute optional int16u routerRoleCount = 16; + readonly attribute optional int16u leaderRoleCount = 17; + readonly attribute optional int16u attachAttemptCount = 18; + readonly attribute optional int16u partitionIdChangeCount = 19; + readonly attribute optional int16u betterPartitionAttachAttemptCount = 20; + readonly attribute optional int16u parentChangeCount = 21; + readonly attribute optional int32u txTotalCount = 22; + readonly attribute optional int32u txUnicastCount = 23; + readonly attribute optional int32u txBroadcastCount = 24; + readonly attribute optional int32u txAckRequestedCount = 25; + readonly attribute optional int32u txAckedCount = 26; + readonly attribute optional int32u txNoAckRequestedCount = 27; + readonly attribute optional int32u txDataCount = 28; + readonly attribute optional int32u txDataPollCount = 29; + readonly attribute optional int32u txBeaconCount = 30; + readonly attribute optional int32u txBeaconRequestCount = 31; + readonly attribute optional int32u txOtherCount = 32; + readonly attribute optional int32u txRetryCount = 33; + readonly attribute optional int32u txDirectMaxRetryExpiryCount = 34; + readonly attribute optional int32u txIndirectMaxRetryExpiryCount = 35; + readonly attribute optional int32u txErrCcaCount = 36; + readonly attribute optional int32u txErrAbortCount = 37; + readonly attribute optional int32u txErrBusyChannelCount = 38; + readonly attribute optional int32u rxTotalCount = 39; + readonly attribute optional int32u rxUnicastCount = 40; + readonly attribute optional int32u rxBroadcastCount = 41; + readonly attribute optional int32u rxDataCount = 42; + readonly attribute optional int32u rxDataPollCount = 43; + readonly attribute optional int32u rxBeaconCount = 44; + readonly attribute optional int32u rxBeaconRequestCount = 45; + readonly attribute optional int32u rxOtherCount = 46; + readonly attribute optional int32u rxAddressFilteredCount = 47; + readonly attribute optional int32u rxDestAddrFilteredCount = 48; + readonly attribute optional int32u rxDuplicatedCount = 49; + readonly attribute optional int32u rxErrNoFrameCount = 50; + readonly attribute optional int32u rxErrUnknownNeighborCount = 51; + readonly attribute optional int32u rxErrInvalidSrcAddrCount = 52; + readonly attribute optional int32u rxErrSecCount = 53; + readonly attribute optional int32u rxErrFcsCount = 54; + readonly attribute optional int32u rxErrOtherCount = 55; + readonly attribute optional nullable int64u activeTimestamp = 56; + readonly attribute optional nullable int64u pendingTimestamp = 57; + readonly attribute optional nullable int32u delay = 58; + readonly attribute nullable SecurityPolicy securityPolicy = 59; + readonly attribute nullable octet_string<4> channelPage0Mask = 60; + readonly attribute nullable OperationalDatasetComponents operationalDatasetComponents = 61; + readonly attribute NetworkFaultEnum activeNetworkFaultsList[] = 62; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + /** Reception of this command SHALL reset the OverrunCount attributes to 0 */ + command access(invoke: manage) ResetCounts(): DefaultSuccess = 0; +} + +/** Commands to trigger a Node to allow a new Administrator to commission it. */ +cluster AdministratorCommissioning = 60 { + revision 1; // NOTE: Default/not specifically set + + enum CommissioningWindowStatusEnum : enum8 { + kWindowNotOpen = 0; + kEnhancedWindowOpen = 1; + kBasicWindowOpen = 2; + } + + enum StatusCode : enum8 { + kBusy = 2; + kPAKEParameterError = 3; + kWindowNotOpen = 4; + } + + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable vendor_id adminVendorId = 2; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct OpenCommissioningWindowRequest { + int16u commissioningTimeout = 0; + octet_string PAKEPasscodeVerifier = 1; + int16u discriminator = 2; + int32u iterations = 3; + octet_string<32> salt = 4; + } + + request struct OpenBasicCommissioningWindowRequest { + int16u commissioningTimeout = 0; + } + + /** This command is used by a current Administrator to instruct a Node to go into commissioning mode using enhanced commissioning method. */ + timed command access(invoke: administer) OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0; + /** This command is used by a current Administrator to instruct a Node to go into commissioning mode using basic commissioning method, if the node supports it. */ + timed command access(invoke: administer) OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1; + /** This command is used by a current Administrator to instruct a Node to revoke any active Open Commissioning Window or Open Basic Commissioning Window command. */ + timed command access(invoke: administer) RevokeCommissioning(): DefaultSuccess = 2; +} + +/** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ +cluster OperationalCredentials = 62 { + revision 1; // NOTE: Default/not specifically set + + enum CertificateChainTypeEnum : enum8 { + kDACCertificate = 1; + kPAICertificate = 2; + } + + enum NodeOperationalCertStatusEnum : enum8 { + kOK = 0; + kInvalidPublicKey = 1; + kInvalidNodeOpId = 2; + kInvalidNOC = 3; + kMissingCsr = 4; + kTableFull = 5; + kInvalidAdminSubject = 6; + kFabricConflict = 9; + kLabelConflict = 10; + kInvalidFabricIndex = 11; + } + + fabric_scoped struct FabricDescriptorStruct { + octet_string<65> rootPublicKey = 1; + vendor_id vendorID = 2; + fabric_id fabricID = 3; + node_id nodeID = 4; + char_string<32> label = 5; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; + readonly attribute FabricDescriptorStruct fabrics[] = 1; + readonly attribute int8u supportedFabrics = 2; + readonly attribute int8u commissionedFabrics = 3; + readonly attribute octet_string trustedRootCertificates[] = 4; + readonly attribute int8u currentFabricIndex = 5; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AttestationRequestRequest { + octet_string<32> attestationNonce = 0; + } + + response struct AttestationResponse = 1 { + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; + } + + request struct CertificateChainRequestRequest { + CertificateChainTypeEnum certificateType = 0; + } + + response struct CertificateChainResponse = 3 { + octet_string<600> certificate = 0; + } + + request struct CSRRequestRequest { + octet_string<32> CSRNonce = 0; + optional boolean isForUpdateNOC = 1; + } + + response struct CSRResponse = 5 { + octet_string NOCSRElements = 0; + octet_string attestationSignature = 1; + } + + request struct AddNOCRequest { + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; + int64u caseAdminSubject = 3; + vendor_id adminVendorId = 4; + } + + request struct UpdateNOCRequest { + octet_string NOCValue = 0; + optional octet_string ICACValue = 1; + } + + response struct NOCResponse = 8 { + NodeOperationalCertStatusEnum statusCode = 0; + optional fabric_idx fabricIndex = 1; + optional char_string<128> debugText = 2; + } + + request struct UpdateFabricLabelRequest { + char_string<32> label = 0; + } + + request struct RemoveFabricRequest { + fabric_idx fabricIndex = 0; + } + + request struct AddTrustedRootCertificateRequest { + octet_string rootCACertificate = 0; + } + + /** Sender is requesting attestation information from the receiver. */ + command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; + /** Sender is requesting a device attestation certificate from the receiver. */ + command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; + /** Sender is requesting a certificate signing request (CSR) from the receiver. */ + command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; + /** Sender is requesting to add the new node operational certificates. */ + command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; + /** Sender is requesting to update the node operational certificates. */ + fabric command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; + /** This command SHALL be used by an Administrative Node to set the user-visible Label field for a given Fabric, as reflected by entries in the Fabrics attribute. */ + fabric command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + /** This command is used by Administrative Nodes to remove a given fabric index and delete all associated fabric-scoped data. */ + command access(invoke: administer) RemoveFabric(RemoveFabricRequest): NOCResponse = 10; + /** This command SHALL add a Trusted Root CA Certificate, provided as its CHIP Certificate representation. */ + command access(invoke: administer) AddTrustedRootCertificate(AddTrustedRootCertificateRequest): DefaultSuccess = 11; +} + +/** The Group Key Management Cluster is the mechanism by which group keys are managed. */ +cluster GroupKeyManagement = 63 { + revision 1; // NOTE: Default/not specifically set + + enum GroupKeySecurityPolicyEnum : enum8 { + kTrustFirst = 0; + kCacheAndSync = 1; + } + + bitmap Feature : bitmap32 { + kCacheAndSync = 0x1; + } + + fabric_scoped struct GroupInfoMapStruct { + group_id groupId = 1; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct GroupKeyMapStruct { + group_id groupId = 1; + int16u groupKeySetID = 2; + fabric_idx fabricIndex = 254; + } + + struct GroupKeySetStruct { + int16u groupKeySetID = 0; + GroupKeySecurityPolicyEnum groupKeySecurityPolicy = 1; + nullable octet_string<16> epochKey0 = 2; + nullable epoch_us epochStartTime0 = 3; + nullable octet_string<16> epochKey1 = 4; + nullable epoch_us epochStartTime1 = 5; + nullable octet_string<16> epochKey2 = 6; + nullable epoch_us epochStartTime2 = 7; + } + + attribute access(write: manage) GroupKeyMapStruct groupKeyMap[] = 0; + readonly attribute GroupInfoMapStruct groupTable[] = 1; + readonly attribute int16u maxGroupsPerFabric = 2; + readonly attribute int16u maxGroupKeysPerFabric = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct KeySetWriteRequest { + GroupKeySetStruct groupKeySet = 0; + } + + request struct KeySetReadRequest { + int16u groupKeySetID = 0; + } + + response struct KeySetReadResponse = 2 { + GroupKeySetStruct groupKeySet = 0; + } + + request struct KeySetRemoveRequest { + int16u groupKeySetID = 0; + } + + response struct KeySetReadAllIndicesResponse = 5 { + int16u groupKeySetIDs[] = 0; + } + + /** Write a new set of keys for the given key set id. */ + fabric command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; + /** Read the keys for a given key set id. */ + fabric command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; + /** Revoke a Root Key from a Group */ + fabric command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; + /** Return the list of Group Key Sets associated with the accessing fabric */ + fabric command access(invoke: administer) KeySetReadAllIndices(): KeySetReadAllIndicesResponse = 4; +} + +/** The Fixed Label Cluster provides a feature for the device to tag an endpoint with zero or more read only +labels. */ +cluster FixedLabel = 64 { + revision 1; // NOTE: Default/not specifically set + + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + + readonly attribute LabelStruct labelList[] = 0; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** The User Label Cluster provides a feature to tag an endpoint with zero or more labels. */ +cluster UserLabel = 65 { + revision 1; // NOTE: Default/not specifically set + + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + + attribute access(write: manage) LabelStruct labelList[] = 0; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** This cluster supports remotely monitoring and, where supported, changing the operational state of any device where a state machine is a part of the operation. */ +cluster OperationalState = 96 { + revision 1; + + enum ErrorStateEnum : enum8 { + kNoError = 0; + kUnableToStartOrResume = 1; + kUnableToCompleteOperation = 2; + kCommandInvalidInState = 3; + } + + enum OperationalStateEnum : enum8 { + kStopped = 0; + kRunning = 1; + kPaused = 2; + kError = 3; + } + + struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; + } + + struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; + } + + critical event OperationalError = 0 { + ErrorStateStruct errorState = 0; + } + + info event OperationCompletion = 1 { + enum8 completionErrorCode = 0; + optional nullable elapsed_s totalOperationalTime = 1; + optional nullable elapsed_s pausedTime = 2; + } + + readonly attribute nullable char_string phaseList[] = 0; + readonly attribute nullable int8u currentPhase = 1; + readonly attribute optional nullable elapsed_s countdownTime = 2; + readonly attribute OperationalStateStruct operationalStateList[] = 3; + readonly attribute OperationalStateEnum operationalState = 4; + readonly attribute ErrorStateStruct operationalError = 5; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + response struct OperationalCommandResponse = 4 { + ErrorStateStruct commandResponseState = 0; + } + + /** Upon receipt, the device SHALL pause its operation if it is possible based on the current function of the server. */ + command Pause(): OperationalCommandResponse = 0; + /** Upon receipt, the device SHALL stop its operation if it is at a position where it is safe to do so and/or permitted. */ + command Stop(): OperationalCommandResponse = 1; + /** Upon receipt, the device SHALL start its operation if it is safe to do so and the device is in an operational state from which it can be started. */ + command Start(): OperationalCommandResponse = 2; + /** Upon receipt, the device SHALL resume its operation from the point it was at when it received the Pause command, or from the point when it was paused by means outside of this cluster (for example by manual button press). */ + command Resume(): OperationalCommandResponse = 3; +} + +/** This cluster provides a mechanism for querying data about electrical power as measured by the server. */ +cluster ElectricalPowerMeasurement = 144 { + revision 1; + + enum MeasurementTypeEnum : enum16 { + kUnspecified = 0; + kVoltage = 1; + kActiveCurrent = 2; + kReactiveCurrent = 3; + kApparentCurrent = 4; + kActivePower = 5; + kReactivePower = 6; + kApparentPower = 7; + kRMSVoltage = 8; + kRMSCurrent = 9; + kRMSPower = 10; + kFrequency = 11; + kPowerFactor = 12; + kNeutralCurrent = 13; + kElectricalEnergy = 14; + } + + enum PowerModeEnum : enum8 { + kUnknown = 0; + kDC = 1; + kAC = 2; + } + + bitmap Feature : bitmap32 { + kDirectCurrent = 0x1; + kAlternatingCurrent = 0x2; + kPolyphasePower = 0x4; + kHarmonics = 0x8; + kPowerQuality = 0x10; + } + + struct MeasurementAccuracyRangeStruct { + int64s rangeMin = 0; + int64s rangeMax = 1; + optional percent100ths percentMax = 2; + optional percent100ths percentMin = 3; + optional percent100ths percentTypical = 4; + optional int64u fixedMax = 5; + optional int64u fixedMin = 6; + optional int64u fixedTypical = 7; + } + + struct MeasurementAccuracyStruct { + MeasurementTypeEnum measurementType = 0; + boolean measured = 1; + int64s minMeasuredValue = 2; + int64s maxMeasuredValue = 3; + MeasurementAccuracyRangeStruct accuracyRanges[] = 4; + } + + struct HarmonicMeasurementStruct { + int8u order = 0; + nullable int64s measurement = 1; + } + + struct MeasurementRangeStruct { + MeasurementTypeEnum measurementType = 0; + int64s min = 1; + int64s max = 2; + optional epoch_s startTimestamp = 3; + optional epoch_s endTimestamp = 4; + optional epoch_s minTimestamp = 5; + optional epoch_s maxTimestamp = 6; + optional systime_ms startSystime = 7; + optional systime_ms endSystime = 8; + optional systime_ms minSystime = 9; + optional systime_ms maxSystime = 10; + } + + info event MeasurementPeriodRanges = 0 { + MeasurementRangeStruct ranges[] = 0; + } + + readonly attribute PowerModeEnum powerMode = 0; + readonly attribute int8u numberOfMeasurementTypes = 1; + readonly attribute MeasurementAccuracyStruct accuracy[] = 2; + readonly attribute optional MeasurementRangeStruct ranges[] = 3; + readonly attribute optional nullable voltage_mv voltage = 4; + readonly attribute optional nullable amperage_ma activeCurrent = 5; + readonly attribute optional nullable amperage_ma reactiveCurrent = 6; + readonly attribute optional nullable amperage_ma apparentCurrent = 7; + readonly attribute nullable power_mw activePower = 8; + readonly attribute optional nullable power_mw reactivePower = 9; + readonly attribute optional nullable power_mw apparentPower = 10; + readonly attribute optional nullable voltage_mv RMSVoltage = 11; + readonly attribute optional nullable amperage_ma RMSCurrent = 12; + readonly attribute optional nullable power_mw RMSPower = 13; + readonly attribute optional nullable int64s frequency = 14; + readonly attribute optional nullable HarmonicMeasurementStruct harmonicCurrents[] = 15; + readonly attribute optional nullable HarmonicMeasurementStruct harmonicPhases[] = 16; + readonly attribute optional nullable int64s powerFactor = 17; + readonly attribute optional nullable amperage_ma neutralCurrent = 18; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** This cluster provides a mechanism for querying data about the electrical energy imported or provided by the server. */ +cluster ElectricalEnergyMeasurement = 145 { + revision 1; + + enum MeasurementTypeEnum : enum16 { + kUnspecified = 0; + kVoltage = 1; + kActiveCurrent = 2; + kReactiveCurrent = 3; + kApparentCurrent = 4; + kActivePower = 5; + kReactivePower = 6; + kApparentPower = 7; + kRMSVoltage = 8; + kRMSCurrent = 9; + kRMSPower = 10; + kFrequency = 11; + kPowerFactor = 12; + kNeutralCurrent = 13; + kElectricalEnergy = 14; + } + + bitmap Feature : bitmap32 { + kImportedEnergy = 0x1; + kExportedEnergy = 0x2; + kCumulativeEnergy = 0x4; + kPeriodicEnergy = 0x8; + } + + struct MeasurementAccuracyRangeStruct { + int64s rangeMin = 0; + int64s rangeMax = 1; + optional percent100ths percentMax = 2; + optional percent100ths percentMin = 3; + optional percent100ths percentTypical = 4; + optional int64u fixedMax = 5; + optional int64u fixedMin = 6; + optional int64u fixedTypical = 7; + } + + struct MeasurementAccuracyStruct { + MeasurementTypeEnum measurementType = 0; + boolean measured = 1; + int64s minMeasuredValue = 2; + int64s maxMeasuredValue = 3; + MeasurementAccuracyRangeStruct accuracyRanges[] = 4; + } + + struct CumulativeEnergyResetStruct { + optional nullable epoch_s importedResetTimestamp = 0; + optional nullable epoch_s exportedResetTimestamp = 1; + optional nullable systime_ms importedResetSystime = 2; + optional nullable systime_ms exportedResetSystime = 3; + } + + struct EnergyMeasurementStruct { + energy_mwh energy = 0; + optional epoch_s startTimestamp = 1; + optional epoch_s endTimestamp = 2; + optional systime_ms startSystime = 3; + optional systime_ms endSystime = 4; + } + + info event CumulativeEnergyMeasured = 0 { + optional EnergyMeasurementStruct energyImported = 0; + optional EnergyMeasurementStruct energyExported = 1; + } + + info event PeriodicEnergyMeasured = 1 { + optional EnergyMeasurementStruct energyImported = 0; + optional EnergyMeasurementStruct energyExported = 1; + } + + readonly attribute MeasurementAccuracyStruct accuracy = 0; + readonly attribute optional nullable EnergyMeasurementStruct cumulativeEnergyImported = 1; + readonly attribute optional nullable EnergyMeasurementStruct cumulativeEnergyExported = 2; + readonly attribute optional nullable EnergyMeasurementStruct periodicEnergyImported = 3; + readonly attribute optional nullable EnergyMeasurementStruct periodicEnergyExported = 4; + readonly attribute optional nullable CumulativeEnergyResetStruct cumulativeEnergyReset = 5; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** This cluster allows a client to manage the power draw of a device. An example of such a client could be an Energy Management System (EMS) which controls an Energy Smart Appliance (ESA). */ +provisional cluster DeviceEnergyManagement = 152 { + revision 4; + + enum AdjustmentCauseEnum : enum8 { + kLocalOptimization = 0; + kGridOptimization = 1; + } + + enum CauseEnum : enum8 { + kNormalCompletion = 0; + kOffline = 1; + kFault = 2; + kUserOptOut = 3; + kCancelled = 4; + } + + enum CostTypeEnum : enum8 { + kFinancial = 0; + kGHGEmissions = 1; + kComfort = 2; + kTemperature = 3; + } + + enum ESAStateEnum : enum8 { + kOffline = 0; + kOnline = 1; + kFault = 2; + kPowerAdjustActive = 3; + kPaused = 4; + } + + enum ESATypeEnum : enum8 { + kEVSE = 0; + kSpaceHeating = 1; + kWaterHeating = 2; + kSpaceCooling = 3; + kSpaceHeatingCooling = 4; + kBatteryStorage = 5; + kSolarPV = 6; + kFridgeFreezer = 7; + kWashingMachine = 8; + kDishwasher = 9; + kCooking = 10; + kHomeWaterPump = 11; + kIrrigationWaterPump = 12; + kPoolPump = 13; + kOther = 255; + } + + enum ForecastUpdateReasonEnum : enum8 { + kInternalOptimization = 0; + kLocalOptimization = 1; + kGridOptimization = 2; + } + + enum OptOutStateEnum : enum8 { + kNoOptOut = 0; + kLocalOptOut = 1; + kGridOptOut = 2; + kOptOut = 3; + } + + enum PowerAdjustReasonEnum : enum8 { + kNoAdjustment = 0; + kLocalOptimizationAdjustment = 1; + kGridOptimizationAdjustment = 2; + } + + bitmap Feature : bitmap32 { + kPowerAdjustment = 0x1; + kPowerForecastReporting = 0x2; + kStateForecastReporting = 0x4; + kStartTimeAdjustment = 0x8; + kPausable = 0x10; + kForecastAdjustment = 0x20; + kConstraintBasedAdjustment = 0x40; + } + + struct CostStruct { + CostTypeEnum costType = 0; + int32s value = 1; + int8u decimalPoints = 2; + optional int16u currency = 3; + } + + struct PowerAdjustStruct { + power_mw minPower = 0; + power_mw maxPower = 1; + elapsed_s minDuration = 2; + elapsed_s maxDuration = 3; + } + + struct PowerAdjustCapabilityStruct { + nullable PowerAdjustStruct powerAdjustCapability[] = 0; + PowerAdjustReasonEnum cause = 1; + } + + struct SlotStruct { + elapsed_s minDuration = 0; + elapsed_s maxDuration = 1; + elapsed_s defaultDuration = 2; + elapsed_s elapsedSlotTime = 3; + elapsed_s remainingSlotTime = 4; + optional boolean slotIsPausable = 5; + optional elapsed_s minPauseDuration = 6; + optional elapsed_s maxPauseDuration = 7; + optional int16u manufacturerESAState = 8; + optional power_mw nominalPower = 9; + optional power_mw minPower = 10; + optional power_mw maxPower = 11; + optional energy_mwh nominalEnergy = 12; + optional CostStruct costs[] = 13; + optional power_mw minPowerAdjustment = 14; + optional power_mw maxPowerAdjustment = 15; + optional elapsed_s minDurationAdjustment = 16; + optional elapsed_s maxDurationAdjustment = 17; + } + + struct ForecastStruct { + int32u forecastID = 0; + nullable int16u activeSlotNumber = 1; + epoch_s startTime = 2; + epoch_s endTime = 3; + optional nullable epoch_s earliestStartTime = 4; + optional epoch_s latestEndTime = 5; + boolean isPausable = 6; + SlotStruct slots[] = 7; + ForecastUpdateReasonEnum forecastUpdateReason = 8; + } + + struct ConstraintsStruct { + epoch_s startTime = 0; + elapsed_s duration = 1; + optional power_mw nominalPower = 2; + optional energy_mwh maximumEnergy = 3; + optional int8s loadControl = 4; + } + + struct SlotAdjustmentStruct { + int8u slotIndex = 0; + optional power_mw nominalPower = 1; + elapsed_s duration = 2; + } + + info event PowerAdjustStart = 0 { + } + + info event PowerAdjustEnd = 1 { + CauseEnum cause = 0; + elapsed_s duration = 1; + energy_mwh energyUse = 2; + } + + info event Paused = 2 { + } + + info event Resumed = 3 { + CauseEnum cause = 0; + } + + readonly attribute ESATypeEnum ESAType = 0; + readonly attribute boolean ESACanGenerate = 1; + readonly attribute ESAStateEnum ESAState = 2; + readonly attribute power_mw absMinPower = 3; + readonly attribute power_mw absMaxPower = 4; + readonly attribute optional nullable PowerAdjustCapabilityStruct powerAdjustmentCapability = 5; + readonly attribute optional nullable ForecastStruct forecast = 6; + readonly attribute optional OptOutStateEnum optOutState = 7; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct PowerAdjustRequestRequest { + power_mw power = 0; + elapsed_s duration = 1; + AdjustmentCauseEnum cause = 2; + } + + request struct StartTimeAdjustRequestRequest { + epoch_s requestedStartTime = 0; + AdjustmentCauseEnum cause = 1; + } + + request struct PauseRequestRequest { + elapsed_s duration = 0; + AdjustmentCauseEnum cause = 1; + } + + request struct ModifyForecastRequestRequest { + int32u forecastID = 0; + SlotAdjustmentStruct slotAdjustments[] = 1; + AdjustmentCauseEnum cause = 2; + } + + request struct RequestConstraintBasedForecastRequest { + ConstraintsStruct constraints[] = 0; + AdjustmentCauseEnum cause = 1; + } + + /** Allows a client to request an adjustment in the power consumption of an ESA for a specified duration. */ + command PowerAdjustRequest(PowerAdjustRequestRequest): DefaultSuccess = 0; + /** Allows a client to cancel an ongoing PowerAdjustmentRequest operation. */ + command CancelPowerAdjustRequest(): DefaultSuccess = 1; + /** Allows a client to adjust the start time of a Forecast sequence that has not yet started operation (i.e. where the current Forecast StartTime is in the future). */ + command StartTimeAdjustRequest(StartTimeAdjustRequestRequest): DefaultSuccess = 2; + /** Allows a client to temporarily pause an operation and reduce the ESAs energy demand. */ + command PauseRequest(PauseRequestRequest): DefaultSuccess = 3; + /** Allows a client to cancel the PauseRequest command and enable earlier resumption of operation. */ + command ResumeRequest(): DefaultSuccess = 4; + /** Allows a client to modify a Forecast within the limits allowed by the ESA. */ + command ModifyForecastRequest(ModifyForecastRequestRequest): DefaultSuccess = 5; + /** Allows a client to ask the ESA to recompute its Forecast based on power and time constraints. */ + command RequestConstraintBasedForecast(RequestConstraintBasedForecastRequest): DefaultSuccess = 6; + /** Allows a client to request cancellation of a previous adjustment request in a StartTimeAdjustRequest, ModifyForecastRequest or RequestConstraintBasedForecast command */ + command CancelRequest(): DefaultSuccess = 7; +} + +/** The Power Topology Cluster provides a mechanism for expressing how power is flowing between endpoints. */ +cluster PowerTopology = 156 { + revision 1; + + bitmap Feature : bitmap32 { + kNodeTopology = 0x1; + kTreeTopology = 0x2; + kSetTopology = 0x4; + kDynamicPowerFlow = 0x8; + } + + readonly attribute optional endpoint_no availableEndpoints[] = 0; + readonly attribute optional endpoint_no activeEndpoints[] = 1; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Attributes and commands for selecting a mode from a list of supported options. */ +provisional cluster DeviceEnergyManagementMode = 159 { + revision 1; + + enum ModeTag : enum16 { + kAuto = 0; + kQuick = 1; + kQuiet = 2; + kLowNoise = 3; + kLowEnergy = 4; + kVacation = 5; + kMin = 6; + kMax = 7; + kNight = 8; + kDay = 9; + kNoOptimization = 16384; + kDeviceOptimization = 16385; + kLocalOptimization = 16386; + kGridOptimization = 16387; + } + + bitmap Feature : bitmap32 { + kOnOff = 0x1; + } + + struct ModeTagStruct { + optional vendor_id mfgCode = 0; + enum16 value = 1; + } + + struct ModeOptionStruct { + char_string<64> label = 0; + int8u mode = 1; + ModeTagStruct modeTags[] = 2; + } + + readonly attribute ModeOptionStruct supportedModes[] = 0; + readonly attribute int8u currentMode = 1; + attribute optional nullable int8u startUpMode = 2; + attribute optional nullable int8u onMode = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ChangeToModeRequest { + int8u newMode = 0; + } + + response struct ChangeToModeResponse = 1 { + enum8 status = 0; + optional char_string<64> statusText = 1; + } + + /** This command is used to change device modes. + On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */ + command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0; +} + +endpoint 0 { + device type ma_rootdevice = 22, version 1; + + binding cluster OtaSoftwareUpdateProvider; + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + callback attribute featureMap; + callback attribute clusterRevision; + } + + server cluster AccessControl { + emits event AccessControlEntryChanged; + emits event AccessControlExtensionChanged; + callback attribute acl; + callback attribute extension; + callback attribute subjectsPerAccessControlEntry; + callback attribute targetsPerAccessControlEntry; + callback attribute accessControlEntriesPerFabric; + callback attribute attributeList; + ram attribute featureMap default = 0; + callback attribute clusterRevision; + } + + server cluster BasicInformation { + callback attribute dataModelRevision; + callback attribute vendorName; + callback attribute vendorID; + callback attribute productName; + callback attribute productID; + persist attribute nodeLabel; + callback attribute location; + callback attribute hardwareVersion; + callback attribute hardwareVersionString; + callback attribute softwareVersion; + callback attribute softwareVersionString; + callback attribute manufacturingDate; + callback attribute partNumber; + callback attribute productURL; + callback attribute productLabel; + callback attribute serialNumber; + persist attribute localConfigDisabled default = 0; + callback attribute uniqueID; + callback attribute capabilityMinima; + callback attribute specificationVersion; + callback attribute maxPathsPerInvoke; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 3; + } + + server cluster OtaSoftwareUpdateRequestor { + callback attribute defaultOTAProviders; + ram attribute updatePossible default = 1; + ram attribute updateState default = 0; + ram attribute updateStateProgress default = 0; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command AnnounceOTAProvider; + } + + server cluster LocalizationConfiguration { + persist attribute activeLocale default = "en-US"; + callback attribute supportedLocales; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster TimeFormatLocalization { + persist attribute hourFormat default = 0; + persist attribute activeCalendarType default = 0; + callback attribute supportedCalendarTypes; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster UnitLocalization { + persist attribute temperatureUnit default = 1; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster GeneralCommissioning { + ram attribute breadcrumb default = 0x0000000000000000; + callback attribute basicCommissioningInfo; + callback attribute regulatoryConfig; + callback attribute locationCapability; + callback attribute supportsConcurrentConnection; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command ArmFailSafe; + handle command ArmFailSafeResponse; + handle command SetRegulatoryConfig; + handle command SetRegulatoryConfigResponse; + handle command CommissioningComplete; + handle command CommissioningCompleteResponse; + } + + server cluster NetworkCommissioning { + ram attribute maxNetworks; + callback attribute networks; + ram attribute scanMaxTimeSeconds; + ram attribute connectMaxTimeSeconds; + ram attribute interfaceEnabled; + ram attribute lastNetworkingStatus; + ram attribute lastNetworkID; + ram attribute lastConnectErrorValue; + callback attribute supportedThreadFeatures; + callback attribute threadVersion; + ram attribute featureMap default = 2; + ram attribute clusterRevision default = 1; + + handle command ScanNetworks; + handle command ScanNetworksResponse; + handle command AddOrUpdateWiFiNetwork; + handle command AddOrUpdateThreadNetwork; + handle command RemoveNetwork; + handle command NetworkConfigResponse; + handle command ConnectNetwork; + handle command ConnectNetworkResponse; + handle command ReorderNetwork; + } + + server cluster DiagnosticLogs { + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command RetrieveLogsRequest; + } + + server cluster GeneralDiagnostics { + emits event BootReason; + callback attribute networkInterfaces; + callback attribute rebootCount; + callback attribute upTime; + callback attribute totalOperationalHours; + callback attribute bootReason; + callback attribute activeHardwareFaults; + callback attribute activeRadioFaults; + callback attribute activeNetworkFaults; + callback attribute testEventTriggersEnabled default = false; + callback attribute featureMap; + callback attribute clusterRevision; + + handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; + } + + server cluster SoftwareDiagnostics { + emits event SoftwareFault; + callback attribute threadMetrics; + callback attribute currentHeapFree; + callback attribute currentHeapUsed; + callback attribute currentHeapHighWatermark; + callback attribute featureMap; + ram attribute clusterRevision default = 1; + + handle command ResetWatermarks; + } + + server cluster ThreadNetworkDiagnostics { + callback attribute channel; + callback attribute routingRole; + callback attribute networkName; + callback attribute panId; + callback attribute extendedPanId; + callback attribute meshLocalPrefix; + callback attribute overrunCount; + callback attribute neighborTable; + callback attribute routeTable; + callback attribute partitionId; + callback attribute weighting; + callback attribute dataVersion; + callback attribute stableDataVersion; + callback attribute leaderRouterId; + callback attribute detachedRoleCount; + callback attribute childRoleCount; + callback attribute routerRoleCount; + callback attribute leaderRoleCount; + callback attribute attachAttemptCount; + callback attribute partitionIdChangeCount; + callback attribute betterPartitionAttachAttemptCount; + callback attribute parentChangeCount; + callback attribute txTotalCount; + callback attribute txUnicastCount; + callback attribute txBroadcastCount; + callback attribute txAckRequestedCount; + callback attribute txAckedCount; + callback attribute txNoAckRequestedCount; + callback attribute txDataCount; + callback attribute txDataPollCount; + callback attribute txBeaconCount; + callback attribute txBeaconRequestCount; + callback attribute txOtherCount; + callback attribute txRetryCount; + callback attribute txDirectMaxRetryExpiryCount; + callback attribute txIndirectMaxRetryExpiryCount; + callback attribute txErrCcaCount; + callback attribute txErrAbortCount; + callback attribute txErrBusyChannelCount; + callback attribute rxTotalCount; + callback attribute rxUnicastCount; + callback attribute rxBroadcastCount; + callback attribute rxDataCount; + callback attribute rxDataPollCount; + callback attribute rxBeaconCount; + callback attribute rxBeaconRequestCount; + callback attribute rxOtherCount; + callback attribute rxAddressFilteredCount; + callback attribute rxDestAddrFilteredCount; + callback attribute rxDuplicatedCount; + callback attribute rxErrNoFrameCount; + callback attribute rxErrUnknownNeighborCount; + callback attribute rxErrInvalidSrcAddrCount; + callback attribute rxErrSecCount; + callback attribute rxErrFcsCount; + callback attribute rxErrOtherCount; + callback attribute activeTimestamp; + callback attribute pendingTimestamp; + callback attribute delay; + callback attribute securityPolicy; + callback attribute channelPage0Mask; + callback attribute operationalDatasetComponents; + callback attribute activeNetworkFaultsList; + ram attribute featureMap default = 0x000F; + ram attribute clusterRevision default = 2; + + handle command ResetCounts; + } + + server cluster AdministratorCommissioning { + callback attribute windowStatus; + callback attribute adminFabricIndex; + callback attribute adminVendorId; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command OpenCommissioningWindow; + handle command OpenBasicCommissioningWindow; + handle command RevokeCommissioning; + } + + server cluster OperationalCredentials { + callback attribute NOCs; + callback attribute fabrics; + callback attribute supportedFabrics; + callback attribute commissionedFabrics; + callback attribute trustedRootCertificates; + callback attribute currentFabricIndex; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command AttestationRequest; + handle command AttestationResponse; + handle command CertificateChainRequest; + handle command CertificateChainResponse; + handle command CSRRequest; + handle command CSRResponse; + handle command AddNOC; + handle command UpdateNOC; + handle command NOCResponse; + handle command UpdateFabricLabel; + handle command RemoveFabric; + handle command AddTrustedRootCertificate; + } + + server cluster GroupKeyManagement { + callback attribute groupKeyMap; + callback attribute groupTable; + callback attribute maxGroupsPerFabric; + callback attribute maxGroupKeysPerFabric; + callback attribute featureMap; + callback attribute clusterRevision; + + handle command KeySetWrite; + handle command KeySetRead; + handle command KeySetReadResponse; + handle command KeySetRemove; + handle command KeySetReadAllIndices; + handle command KeySetReadAllIndicesResponse; + } + + server cluster FixedLabel { + callback attribute labelList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster UserLabel { + callback attribute labelList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } +} +endpoint 1 { + device type ma_dishwasher = 117, version 1; + + + server cluster Identify { + ram attribute identifyTime default = 0x0; + ram attribute identifyType default = 0x00; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 4; + + handle command Identify; + handle command TriggerEffect; + } + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap; + callback attribute clusterRevision; + } + + server cluster Binding { + callback attribute binding; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster OperationalState { + callback attribute phaseList; + callback attribute currentPhase; + callback attribute operationalStateList; + callback attribute operationalState; + callback attribute operationalError; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command Pause; + handle command Stop; + handle command Start; + handle command Resume; + handle command OperationalCommandResponse; + } +} +endpoint 2 { + device type ma_electricalsensor = 1296, version 1; + + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap; + callback attribute clusterRevision; + } + + server cluster ElectricalPowerMeasurement { + emits event MeasurementPeriodRanges; + callback attribute powerMode; + callback attribute numberOfMeasurementTypes; + callback attribute accuracy; + callback attribute ranges; + callback attribute voltage; + callback attribute activeCurrent; + callback attribute reactiveCurrent; + callback attribute apparentCurrent; + callback attribute activePower; + callback attribute reactivePower; + callback attribute apparentPower; + callback attribute RMSVoltage; + callback attribute RMSCurrent; + callback attribute RMSPower; + callback attribute frequency; + callback attribute harmonicCurrents; + callback attribute harmonicPhases; + callback attribute powerFactor; + callback attribute neutralCurrent; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap; + ram attribute clusterRevision default = 1; + } + + server cluster ElectricalEnergyMeasurement { + emits event CumulativeEnergyMeasured; + callback attribute accuracy; + callback attribute cumulativeEnergyImported; + callback attribute cumulativeEnergyReset; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap; + ram attribute clusterRevision default = 1; + } + + server cluster PowerTopology { + callback attribute availableEndpoints; + callback attribute activeEndpoints; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap; + ram attribute clusterRevision default = 1; + } +} +endpoint 3 { + device type device_energy_management = 1293, version 1; + + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap; + callback attribute clusterRevision; + } + + server cluster DeviceEnergyManagement { + emits event PowerAdjustStart; + emits event PowerAdjustEnd; + emits event Paused; + emits event Resumed; + callback attribute ESAType; + callback attribute ESACanGenerate; + callback attribute ESAState; + callback attribute absMinPower; + callback attribute absMaxPower; + callback attribute powerAdjustmentCapability; + callback attribute forecast; + callback attribute optOutState; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap; + ram attribute clusterRevision default = 3; + + handle command PowerAdjustRequest; + handle command CancelPowerAdjustRequest; + handle command StartTimeAdjustRequest; + handle command PauseRequest; + handle command ResumeRequest; + handle command ModifyForecastRequest; + handle command RequestConstraintBasedForecast; + handle command CancelRequest; + } + + server cluster DeviceEnergyManagementMode { + callback attribute supportedModes; + callback attribute currentMode; + ram attribute startUpMode; + ram attribute onMode; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap; + ram attribute clusterRevision default = 1; + + handle command ChangeToMode; + handle command ChangeToModeResponse; + } +} + + diff --git a/examples/dishwasher-app/silabs/data_model/dishwasher-thread-app.zap b/examples/dishwasher-app/silabs/data_model/dishwasher-thread-app.zap new file mode 100644 index 0000000000..f7927d1a6a --- /dev/null +++ b/examples/dishwasher-app/silabs/data_model/dishwasher-thread-app.zap @@ -0,0 +1,6002 @@ +{ + "fileFormat": 2, + "featureLevel": 103, + "creator": "zap", + "keyValuePairs": [ + { + "key": "commandDiscovery", + "value": "1" + }, + { + "key": "defaultResponsePolicy", + "value": "always" + }, + { + "key": "manufacturerCodes", + "value": "0x1002" + } + ], + "package": [ + { + "pathRelativity": "relativeToZap", + "path": "../../../../src/app/zap-templates/zcl/zcl.json", + "type": "zcl-properties", + "category": "matter", + "version": 1, + "description": "Matter SDK ZCL data" + }, + { + "pathRelativity": "relativeToZap", + "path": "../../../../src/app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "category": "matter", + "version": "chip-v1" + } + ], + "endpointTypes": [ + { + "id": 1, + "name": "MA-rootdevice", + "deviceTypeRef": { + "code": 22, + "profileId": 259, + "label": "MA-rootdevice", + "name": "MA-rootdevice" + }, + "deviceTypes": [ + { + "code": 22, + "profileId": 259, + "label": "MA-rootdevice", + "name": "MA-rootdevice" + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 22 + ], + "deviceTypeName": "MA-rootdevice", + "deviceTypeCode": 22, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Access Control", + "code": 31, + "mfgCode": null, + "define": "ACCESS_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "ACL", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Extension", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SubjectsPerAccessControlEntry", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TargetsPerAccessControlEntry", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AccessControlEntriesPerFabric", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "AccessControlEntryChanged", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "AccessControlExtensionChanged", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Basic Information", + "code": 40, + "mfgCode": null, + "define": "BASIC_INFORMATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DataModelRevision", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorName", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorID", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "vendor_id", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductName", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductID", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NodeLabel", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Location", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersion", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersionString", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersion", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersionString", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ManufacturingDate", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartNumber", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductURL", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "long_char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductLabel", + "code": 14, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SerialNumber", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LocalConfigDisabled", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UniqueID", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CapabilityMinima", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "CapabilityMinimaStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SpecificationVersion", + "code": 21, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxPathsPerInvoke", + "code": 22, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "OTA Software Update Provider", + "code": 41, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER", + "side": "client", + "enabled": 1, + "commands": [ + { + "name": "QueryImage", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "QueryImageResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ApplyUpdateRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ApplyUpdateResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "NotifyUpdateApplied", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "OTA Software Update Requestor", + "code": 42, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "AnnounceOTAProvider", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "DefaultOTAProviders", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UpdatePossible", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpdateState", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "UpdateStateEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpdateStateProgress", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Localization Configuration", + "code": 43, + "mfgCode": null, + "define": "LOCALIZATION_CONFIGURATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "ActiveLocale", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "en-US", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportedLocales", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Time Format Localization", + "code": 44, + "mfgCode": null, + "define": "TIME_FORMAT_LOCALIZATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "HourFormat", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "HourFormatEnum", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveCalendarType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "CalendarTypeEnum", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportedCalendarTypes", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Unit Localization", + "code": 45, + "mfgCode": null, + "define": "UNIT_LOCALIZATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "TemperatureUnit", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "TempUnitEnum", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "General Commissioning", + "code": 48, + "mfgCode": null, + "define": "GENERAL_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ArmFailSafe", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ArmFailSafeResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "SetRegulatoryConfig", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "SetRegulatoryConfigResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "CommissioningComplete", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CommissioningCompleteResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "Breadcrumb", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BasicCommissioningInfo", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "BasicCommissioningInfo", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RegulatoryConfig", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LocationCapability", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportsConcurrentConnection", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Network Commissioning", + "code": 49, + "mfgCode": null, + "define": "NETWORK_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ScanNetworks", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ScanNetworksResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "AddOrUpdateWiFiNetwork", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "AddOrUpdateThreadNetwork", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RemoveNetwork", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "NetworkConfigResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ConnectNetwork", + "code": 6, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ConnectNetworkResponse", + "code": 7, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ReorderNetwork", + "code": 8, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "MaxNetworks", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Networks", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ScanMaxTimeSeconds", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ConnectMaxTimeSeconds", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "InterfaceEnabled", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkingStatus", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "NetworkCommissioningStatusEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkID", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastConnectErrorValue", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int32s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportedThreadFeatures", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "ThreadCapabilitiesBitmap", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ThreadVersion", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Diagnostic Logs", + "code": 50, + "mfgCode": null, + "define": "DIAGNOSTIC_LOGS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "RetrieveLogsRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "General Diagnostics", + "code": 51, + "mfgCode": null, + "define": "GENERAL_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "TestEventTrigger", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "NetworkInterfaces", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RebootCount", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TotalOperationalHours", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BootReason", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "BootReasonEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveHardwareFaults", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveRadioFaults", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveNetworkFaults", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TestEventTriggersEnabled", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "false", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "BootReason", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Software Diagnostics", + "code": 52, + "mfgCode": null, + "define": "SOFTWARE_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ResetWatermarks", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "ThreadMetrics", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentHeapFree", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentHeapUsed", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentHeapHighWatermark", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "SoftwareFault", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Thread Network Diagnostics", + "code": 53, + "mfgCode": null, + "define": "THREAD_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ResetCounts", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "Channel", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RoutingRole", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "RoutingRoleEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NetworkName", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PanId", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ExtendedPanId", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "MeshLocalPrefix", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OverrunCount", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NeighborTable", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RouteTable", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartitionId", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Weighting", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "DataVersion", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "StableDataVersion", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LeaderRouterId", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "DetachedRoleCount", + "code": 14, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ChildRoleCount", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RouterRoleCount", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LeaderRoleCount", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "AttachAttemptCount", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartitionIdChangeCount", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BetterPartitionAttachAttemptCount", + "code": 20, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ParentChangeCount", + "code": 21, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxTotalCount", + "code": 22, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxUnicastCount", + "code": 23, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxBroadcastCount", + "code": 24, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxAckRequestedCount", + "code": 25, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxAckedCount", + "code": 26, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxNoAckRequestedCount", + "code": 27, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxDataCount", + "code": 28, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxDataPollCount", + "code": 29, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxBeaconCount", + "code": 30, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxBeaconRequestCount", + "code": 31, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxOtherCount", + "code": 32, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxRetryCount", + "code": 33, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxDirectMaxRetryExpiryCount", + "code": 34, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxIndirectMaxRetryExpiryCount", + "code": 35, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxErrCcaCount", + "code": 36, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxErrAbortCount", + "code": 37, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxErrBusyChannelCount", + "code": 38, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxTotalCount", + "code": 39, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxUnicastCount", + "code": 40, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxBroadcastCount", + "code": 41, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxDataCount", + "code": 42, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxDataPollCount", + "code": 43, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxBeaconCount", + "code": 44, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxBeaconRequestCount", + "code": 45, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxOtherCount", + "code": 46, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxAddressFilteredCount", + "code": 47, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxDestAddrFilteredCount", + "code": 48, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxDuplicatedCount", + "code": 49, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrNoFrameCount", + "code": 50, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrUnknownNeighborCount", + "code": 51, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrInvalidSrcAddrCount", + "code": 52, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrSecCount", + "code": 53, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrFcsCount", + "code": 54, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrOtherCount", + "code": 55, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ActiveTimestamp", + "code": 56, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PendingTimestamp", + "code": 57, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Delay", + "code": 58, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SecurityPolicy", + "code": 59, + "mfgCode": null, + "side": "server", + "type": "SecurityPolicy", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ChannelPage0Mask", + "code": 60, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OperationalDatasetComponents", + "code": 61, + "mfgCode": null, + "side": "server", + "type": "OperationalDatasetComponents", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ActiveNetworkFaultsList", + "code": 62, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x000F", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Administrator Commissioning", + "code": 60, + "mfgCode": null, + "define": "ADMINISTRATOR_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "OpenCommissioningWindow", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "OpenBasicCommissioningWindow", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RevokeCommissioning", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "WindowStatus", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "CommissioningWindowStatusEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AdminFabricIndex", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "fabric_idx", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AdminVendorId", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "vendor_id", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Operational Credentials", + "code": 62, + "mfgCode": null, + "define": "OPERATIONAL_CREDENTIALS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "AttestationRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "AttestationResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "CertificateChainRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CertificateChainResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "CSRRequest", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CSRResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "AddNOC", + "code": 6, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "UpdateNOC", + "code": 7, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "NOCResponse", + "code": 8, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "UpdateFabricLabel", + "code": 9, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RemoveFabric", + "code": 10, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "AddTrustedRootCertificate", + "code": 11, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "NOCs", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Fabrics", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SupportedFabrics", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CommissionedFabrics", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TrustedRootCertificates", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentFabricIndex", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Group Key Management", + "code": 63, + "mfgCode": null, + "define": "GROUP_KEY_MANAGEMENT_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "KeySetWrite", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetRead", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetReadResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "KeySetRemove", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetReadAllIndices", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetReadAllIndicesResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "GroupKeyMap", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GroupTable", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxGroupsPerFabric", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxGroupKeysPerFabric", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Fixed Label", + "code": 64, + "mfgCode": null, + "define": "FIXED_LABEL_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "LabelList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "User Label", + "code": 65, + "mfgCode": null, + "define": "USER_LABEL_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "LabelList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + }, + { + "id": 2, + "name": "MA-dishwasher", + "deviceTypeRef": { + "code": 117, + "profileId": 259, + "label": "MA-dishwasher", + "name": "MA-dishwasher" + }, + "deviceTypes": [ + { + "code": 117, + "profileId": 259, + "label": "MA-dishwasher", + "name": "MA-dishwasher" + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 117 + ], + "deviceTypeName": "MA-dishwasher", + "deviceTypeCode": 117, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "Identify", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TriggerEffect", + "code": 64, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "IdentifyTime", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "IdentifyType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "IdentifyTypeEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Binding", + "code": 30, + "mfgCode": null, + "define": "BINDING_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "Binding", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Operational State", + "code": 96, + "mfgCode": null, + "define": "OPERATIONAL_STATE_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "Pause", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "Stop", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "Start", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "Resume", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "OperationalCommandResponse", + "code": 4, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "PhaseList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentPhase", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OperationalStateList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OperationalState", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "OperationalStateEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OperationalError", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "ErrorStateStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + }, + { + "id": 3, + "name": "MA-electricalsensor", + "deviceTypeRef": { + "code": 1296, + "profileId": 259, + "label": "MA-electricalsensor", + "name": "MA-electricalsensor" + }, + "deviceTypes": [ + { + "code": 1296, + "profileId": 259, + "label": "MA-electricalsensor", + "name": "MA-electricalsensor" + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 1296 + ], + "deviceTypeName": "MA-electricalsensor", + "deviceTypeCode": 1296, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Electrical Power Measurement", + "code": 144, + "mfgCode": null, + "define": "ELECTRICAL_POWER_MEASUREMENT_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "PowerMode", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "PowerModeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NumberOfMeasurementTypes", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Accuracy", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Ranges", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Voltage", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "voltage_mv", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveCurrent", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "amperage_ma", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ReactiveCurrent", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "amperage_ma", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ApparentCurrent", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "amperage_ma", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActivePower", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "power_mw", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ReactivePower", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "power_mw", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ApparentPower", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "power_mw", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "RMSVoltage", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "voltage_mv", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "RMSCurrent", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "amperage_ma", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "RMSPower", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "power_mw", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Frequency", + "code": 14, + "mfgCode": null, + "side": "server", + "type": "int64s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "HarmonicCurrents", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "HarmonicPhases", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PowerFactor", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "int64s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NeutralCurrent", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "amperage_ma", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "MeasurementPeriodRanges", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Electrical Energy Measurement", + "code": 145, + "mfgCode": null, + "define": "ELECTRICAL_ENERGY_MEASUREMENT_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "Accuracy", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "MeasurementAccuracyStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CumulativeEnergyImported", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "EnergyMeasurementStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CumulativeEnergyReset", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "CumulativeEnergyResetStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "CumulativeEnergyMeasured", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Power Topology", + "code": 156, + "mfgCode": null, + "define": "POWER_TOPOLOGY_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "AvailableEndpoints", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveEndpoints", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + }, + { + "id": 4, + "name": "MA-deviceenergymanagement", + "deviceTypeRef": { + "code": 1293, + "profileId": 259, + "label": "Device Energy Management", + "name": "Device Energy Management" + }, + "deviceTypes": [ + { + "code": 1293, + "profileId": 259, + "label": "Device Energy Management", + "name": "Device Energy Management" + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 1293 + ], + "deviceTypeName": "Device Energy Management", + "deviceTypeCode": 1293, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Device Energy Management", + "code": 152, + "mfgCode": null, + "define": "DEVICE_ENERGY_MANAGEMENT_CLUSTER", + "side": "server", + "enabled": 1, + "apiMaturity": "provisional", + "commands": [ + { + "name": "PowerAdjustRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CancelPowerAdjustRequest", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "StartTimeAdjustRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "PauseRequest", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ResumeRequest", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ModifyForecastRequest", + "code": 5, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RequestConstraintBasedForecast", + "code": 6, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CancelRequest", + "code": 7, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "ESAType", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "ESATypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ESACanGenerate", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ESAState", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "ESAStateEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AbsMinPower", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "power_mw", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AbsMaxPower", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "power_mw", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PowerAdjustmentCapability", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "PowerAdjustCapabilityStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Forecast", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "ForecastStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OptOutState", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "OptOutStateEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "PowerAdjustStart", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "PowerAdjustEnd", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "Paused", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "Resumed", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Device Energy Management Mode", + "code": 159, + "mfgCode": null, + "define": "DEVICE_ENERGY_MANAGEMENT_MODE_CLUSTER", + "side": "server", + "enabled": 1, + "apiMaturity": "provisional", + "commands": [ + { + "name": "ChangeToMode", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ChangeToModeResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "SupportedModes", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentMode", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "StartUpMode", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OnMode", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + } + ], + "endpoints": [ + { + "endpointTypeName": "MA-rootdevice", + "endpointTypeIndex": 0, + "profileId": 259, + "endpointId": 0, + "networkId": 0, + "parentEndpointIdentifier": null + }, + { + "endpointTypeName": "MA-dishwasher", + "endpointTypeIndex": 1, + "profileId": 259, + "endpointId": 1, + "networkId": 0, + "parentEndpointIdentifier": null + }, + { + "endpointTypeName": "MA-electricalsensor", + "endpointTypeIndex": 2, + "profileId": 259, + "endpointId": 2, + "networkId": 0, + "parentEndpointIdentifier": null + }, + { + "endpointTypeName": "MA-deviceenergymanagement", + "endpointTypeIndex": 3, + "profileId": 259, + "endpointId": 3, + "networkId": 0, + "parentEndpointIdentifier": null + } + ] +} \ No newline at end of file diff --git a/examples/dishwasher-app/silabs/data_model/dishwasher-wifi-app.matter b/examples/dishwasher-app/silabs/data_model/dishwasher-wifi-app.matter new file mode 100644 index 0000000000..3c8601d09b --- /dev/null +++ b/examples/dishwasher-app/silabs/data_model/dishwasher-wifi-app.matter @@ -0,0 +1,2669 @@ +// This IDL was generated automatically by ZAP. +// It is for view/code review purposes only. + +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum AtomicRequestTypeEnum : enum8 { + kBeginWrite = 0; + kCommitWrite = 1; + kRollbackWrite = 2; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; +} + +enum RelativePositionTag : enum8 { + kUnder = 0; + kNextTo = 1; + kAround = 2; + kOn = 3; + kAbove = 4; + kFrontOf = 5; + kBehind = 6; +} + +enum TestGlobalEnum : enum8 { + kSomeValue = 0; + kSomeOtherValue = 1; + kFinalValue = 2; +} + +enum ThreeLevelAutoEnum : enum8 { + kLow = 0; + kMedium = 1; + kHigh = 2; + kAutomatic = 3; +} + +bitmap TestGlobalBitmap : bitmap32 { + kFirstBit = 0x1; + kSecondBit = 0x2; +} + +struct TestGlobalStruct { + char_string<128> name = 0; + nullable TestGlobalBitmap myBitmap = 1; + optional nullable TestGlobalEnum myEnum = 2; +} + +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + +struct AtomicAttributeStatusStruct { + attrib_id attributeID = 0; + status statusCode = 1; +} + +/** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ +cluster Identify = 3 { + revision 4; + + enum EffectIdentifierEnum : enum8 { + kBlink = 0; + kBreathe = 1; + kOkay = 2; + kChannelChange = 11; + kFinishEffect = 254; + kStopEffect = 255; + } + + enum EffectVariantEnum : enum8 { + kDefault = 0; + } + + enum IdentifyTypeEnum : enum8 { + kNone = 0; + kLightOutput = 1; + kVisibleIndicator = 2; + kAudibleBeep = 3; + kDisplay = 4; + kActuator = 5; + } + + attribute int16u identifyTime = 0; + readonly attribute IdentifyTypeEnum identifyType = 1; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct IdentifyRequest { + int16u identifyTime = 0; + } + + request struct TriggerEffectRequest { + EffectIdentifierEnum effectIdentifier = 0; + EffectVariantEnum effectVariant = 1; + } + + /** Command description for Identify */ + command access(invoke: manage) Identify(IdentifyRequest): DefaultSuccess = 0; + /** Command description for TriggerEffect */ + command access(invoke: manage) TriggerEffect(TriggerEffectRequest): DefaultSuccess = 64; +} + +/** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ +cluster Descriptor = 29 { + revision 2; + + bitmap Feature : bitmap32 { + kTagList = 0x1; + } + + struct DeviceTypeStruct { + devtype_id deviceType = 0; + int16u revision = 1; + } + + struct SemanticTagStruct { + nullable vendor_id mfgCode = 0; + enum8 namespaceID = 1; + enum8 tag = 2; + optional nullable char_string label = 3; + } + + readonly attribute DeviceTypeStruct deviceTypeList[] = 0; + readonly attribute cluster_id serverList[] = 1; + readonly attribute cluster_id clientList[] = 2; + readonly attribute endpoint_no partsList[] = 3; + readonly attribute optional SemanticTagStruct tagList[] = 4; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** The Binding Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for supporting the binding table. */ +cluster Binding = 30 { + revision 1; // NOTE: Default/not specifically set + + fabric_scoped struct TargetStruct { + optional node_id node = 1; + optional group_id group = 2; + optional endpoint_no endpoint = 3; + optional cluster_id cluster = 4; + fabric_idx fabricIndex = 254; + } + + attribute access(write: manage) TargetStruct binding[] = 0; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** The Access Control Cluster exposes a data model view of a + Node's Access Control List (ACL), which codifies the rules used to manage + and enforce Access Control for the Node's endpoints and their associated + cluster instances. */ +cluster AccessControl = 31 { + revision 2; + + enum AccessControlEntryAuthModeEnum : enum8 { + kPASE = 1; + kCASE = 2; + kGroup = 3; + } + + enum AccessControlEntryPrivilegeEnum : enum8 { + kView = 1; + kProxyView = 2; + kOperate = 3; + kManage = 4; + kAdminister = 5; + } + + enum AccessRestrictionTypeEnum : enum8 { + kAttributeAccessForbidden = 0; + kAttributeWriteForbidden = 1; + kCommandForbidden = 2; + kEventForbidden = 3; + } + + enum ChangeTypeEnum : enum8 { + kChanged = 0; + kAdded = 1; + kRemoved = 2; + } + + bitmap Feature : bitmap32 { + kExtension = 0x1; + kManagedDevice = 0x2; + } + + struct AccessRestrictionStruct { + AccessRestrictionTypeEnum type = 0; + nullable int32u id = 1; + } + + struct CommissioningAccessRestrictionEntryStruct { + endpoint_no endpoint = 0; + cluster_id cluster = 1; + AccessRestrictionStruct restrictions[] = 2; + } + + fabric_scoped struct AccessRestrictionEntryStruct { + fabric_sensitive endpoint_no endpoint = 0; + fabric_sensitive cluster_id cluster = 1; + fabric_sensitive AccessRestrictionStruct restrictions[] = 2; + fabric_idx fabricIndex = 254; + } + + struct AccessControlTargetStruct { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + + fabric_scoped struct AccessControlEntryStruct { + fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; + fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; + nullable fabric_sensitive int64u subjects[] = 3; + nullable fabric_sensitive AccessControlTargetStruct targets[] = 4; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct AccessControlExtensionStruct { + fabric_sensitive octet_string<128> data = 1; + fabric_idx fabricIndex = 254; + } + + fabric_sensitive info event access(read: administer) AccessControlEntryChanged = 0 { + nullable node_id adminNodeID = 1; + nullable int16u adminPasscodeID = 2; + ChangeTypeEnum changeType = 3; + nullable AccessControlEntryStruct latestValue = 4; + fabric_idx fabricIndex = 254; + } + + fabric_sensitive info event access(read: administer) AccessControlExtensionChanged = 1 { + nullable node_id adminNodeID = 1; + nullable int16u adminPasscodeID = 2; + ChangeTypeEnum changeType = 3; + nullable AccessControlExtensionStruct latestValue = 4; + fabric_idx fabricIndex = 254; + } + + fabric_sensitive info event access(read: administer) FabricRestrictionReviewUpdate = 2 { + int64u token = 0; + optional long_char_string instruction = 1; + optional long_char_string ARLRequestFlowUrl = 2; + fabric_idx fabricIndex = 254; + } + + attribute access(read: administer, write: administer) AccessControlEntryStruct acl[] = 0; + attribute access(read: administer, write: administer) optional AccessControlExtensionStruct extension[] = 1; + readonly attribute int16u subjectsPerAccessControlEntry = 2; + readonly attribute int16u targetsPerAccessControlEntry = 3; + readonly attribute int16u accessControlEntriesPerFabric = 4; + readonly attribute optional CommissioningAccessRestrictionEntryStruct commissioningARL[] = 5; + readonly attribute optional AccessRestrictionEntryStruct arl[] = 6; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ReviewFabricRestrictionsRequest { + CommissioningAccessRestrictionEntryStruct arl[] = 0; + } + + response struct ReviewFabricRestrictionsResponse = 1 { + int64u token = 0; + } + + /** This command signals to the service associated with the device vendor that the fabric administrator would like a review of the current restrictions on the accessing fabric. */ + fabric command access(invoke: administer) ReviewFabricRestrictions(ReviewFabricRestrictionsRequest): ReviewFabricRestrictionsResponse = 0; +} + +/** This cluster provides attributes and events for determining basic information about Nodes, which supports both + Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, + which apply to the whole Node. Also allows setting user device information such as location. */ +cluster BasicInformation = 40 { + revision 3; + + enum ColorEnum : enum8 { + kBlack = 0; + kNavy = 1; + kGreen = 2; + kTeal = 3; + kMaroon = 4; + kPurple = 5; + kOlive = 6; + kGray = 7; + kBlue = 8; + kLime = 9; + kAqua = 10; + kRed = 11; + kFuchsia = 12; + kYellow = 13; + kWhite = 14; + kNickel = 15; + kChrome = 16; + kBrass = 17; + kCopper = 18; + kSilver = 19; + kGold = 20; + } + + enum ProductFinishEnum : enum8 { + kOther = 0; + kMatte = 1; + kSatin = 2; + kPolished = 3; + kRugged = 4; + kFabric = 5; + } + + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + + struct ProductAppearanceStruct { + ProductFinishEnum finish = 0; + nullable ColorEnum primaryColor = 1; + } + + critical event StartUp = 0 { + int32u softwareVersion = 0; + } + + critical event ShutDown = 1 { + } + + info event Leave = 2 { + fabric_idx fabricIndex = 0; + } + + info event ReachableChanged = 3 { + boolean reachableNewValue = 0; + } + + readonly attribute int16u dataModelRevision = 0; + readonly attribute char_string<32> vendorName = 1; + readonly attribute vendor_id vendorID = 2; + readonly attribute char_string<32> productName = 3; + readonly attribute int16u productID = 4; + attribute access(write: manage) char_string<32> nodeLabel = 5; + attribute access(write: administer) char_string<2> location = 6; + readonly attribute int16u hardwareVersion = 7; + readonly attribute char_string<64> hardwareVersionString = 8; + readonly attribute int32u softwareVersion = 9; + readonly attribute char_string<64> softwareVersionString = 10; + readonly attribute optional char_string<16> manufacturingDate = 11; + readonly attribute optional char_string<32> partNumber = 12; + readonly attribute optional long_char_string<256> productURL = 13; + readonly attribute optional char_string<64> productLabel = 14; + readonly attribute optional char_string<32> serialNumber = 15; + attribute access(write: manage) optional boolean localConfigDisabled = 16; + readonly attribute optional boolean reachable = 17; + readonly attribute char_string<32> uniqueID = 18; + readonly attribute CapabilityMinimaStruct capabilityMinima = 19; + readonly attribute optional ProductAppearanceStruct productAppearance = 20; + readonly attribute int32u specificationVersion = 21; + readonly attribute int16u maxPathsPerInvoke = 22; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + command MfgSpecificPing(): DefaultSuccess = 0; +} + +/** Provides an interface for providing OTA software updates */ +cluster OtaSoftwareUpdateProvider = 41 { + revision 1; // NOTE: Default/not specifically set + + enum ApplyUpdateActionEnum : enum8 { + kProceed = 0; + kAwaitNextAction = 1; + kDiscontinue = 2; + } + + enum DownloadProtocolEnum : enum8 { + kBDXSynchronous = 0; + kBDXAsynchronous = 1; + kHTTPS = 2; + kVendorSpecific = 3; + } + + enum StatusEnum : enum8 { + kUpdateAvailable = 0; + kBusy = 1; + kNotAvailable = 2; + kDownloadProtocolNotSupported = 3; + } + + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct QueryImageRequest { + vendor_id vendorID = 0; + int16u productID = 1; + int32u softwareVersion = 2; + DownloadProtocolEnum protocolsSupported[] = 3; + optional int16u hardwareVersion = 4; + optional char_string<2> location = 5; + optional boolean requestorCanConsent = 6; + optional octet_string<512> metadataForProvider = 7; + } + + response struct QueryImageResponse = 1 { + StatusEnum status = 0; + optional int32u delayedActionTime = 1; + optional char_string<256> imageURI = 2; + optional int32u softwareVersion = 3; + optional char_string<64> softwareVersionString = 4; + optional octet_string<32> updateToken = 5; + optional boolean userConsentNeeded = 6; + optional octet_string<512> metadataForRequestor = 7; + } + + request struct ApplyUpdateRequestRequest { + octet_string<32> updateToken = 0; + int32u newVersion = 1; + } + + response struct ApplyUpdateResponse = 3 { + ApplyUpdateActionEnum action = 0; + int32u delayedActionTime = 1; + } + + request struct NotifyUpdateAppliedRequest { + octet_string<32> updateToken = 0; + int32u softwareVersion = 1; + } + + /** Determine availability of a new Software Image */ + command QueryImage(QueryImageRequest): QueryImageResponse = 0; + /** Determine next action to take for a downloaded Software Image */ + command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; + /** Notify OTA Provider that an update was applied */ + command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; +} + +/** Provides an interface for downloading and applying OTA software updates */ +cluster OtaSoftwareUpdateRequestor = 42 { + revision 1; // NOTE: Default/not specifically set + + enum AnnouncementReasonEnum : enum8 { + kSimpleAnnouncement = 0; + kUpdateAvailable = 1; + kUrgentUpdateAvailable = 2; + } + + enum ChangeReasonEnum : enum8 { + kUnknown = 0; + kSuccess = 1; + kFailure = 2; + kTimeOut = 3; + kDelayByProvider = 4; + } + + enum UpdateStateEnum : enum8 { + kUnknown = 0; + kIdle = 1; + kQuerying = 2; + kDelayedOnQuery = 3; + kDownloading = 4; + kApplying = 5; + kDelayedOnApply = 6; + kRollingBack = 7; + kDelayedOnUserConsent = 8; + } + + fabric_scoped struct ProviderLocation { + node_id providerNodeID = 1; + endpoint_no endpoint = 2; + fabric_idx fabricIndex = 254; + } + + info event StateTransition = 0 { + UpdateStateEnum previousState = 0; + UpdateStateEnum newState = 1; + ChangeReasonEnum reason = 2; + nullable int32u targetSoftwareVersion = 3; + } + + critical event VersionApplied = 1 { + int32u softwareVersion = 0; + int16u productID = 1; + } + + info event DownloadError = 2 { + int32u softwareVersion = 0; + int64u bytesDownloaded = 1; + nullable int8u progressPercent = 2; + nullable int64s platformCode = 3; + } + + attribute access(write: administer) ProviderLocation defaultOTAProviders[] = 0; + readonly attribute boolean updatePossible = 1; + readonly attribute UpdateStateEnum updateState = 2; + readonly attribute nullable int8u updateStateProgress = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AnnounceOTAProviderRequest { + node_id providerNodeID = 0; + vendor_id vendorID = 1; + AnnouncementReasonEnum announcementReason = 2; + optional octet_string<512> metadataForNode = 3; + endpoint_no endpoint = 4; + } + + /** Announce the presence of an OTA Provider */ + command AnnounceOTAProvider(AnnounceOTAProviderRequest): DefaultSuccess = 0; +} + +/** Nodes should be expected to be deployed to any and all regions of the world. These global regions + may have differing common languages, units of measurements, and numerical formatting + standards. As such, Nodes that visually or audibly convey information need a mechanism by which + they can be configured to use a user’s preferred language, units, etc */ +cluster LocalizationConfiguration = 43 { + revision 1; // NOTE: Default/not specifically set + + attribute access(write: manage) char_string<35> activeLocale = 0; + readonly attribute char_string supportedLocales[] = 1; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Nodes should be expected to be deployed to any and all regions of the world. These global regions + may have differing preferences for how dates and times are conveyed. As such, Nodes that visually + or audibly convey time information need a mechanism by which they can be configured to use a + user’s preferred format. */ +cluster TimeFormatLocalization = 44 { + revision 1; // NOTE: Default/not specifically set + + enum CalendarTypeEnum : enum8 { + kBuddhist = 0; + kChinese = 1; + kCoptic = 2; + kEthiopian = 3; + kGregorian = 4; + kHebrew = 5; + kIndian = 6; + kIslamic = 7; + kJapanese = 8; + kKorean = 9; + kPersian = 10; + kTaiwanese = 11; + kUseActiveLocale = 255; + } + + enum HourFormatEnum : enum8 { + k12hr = 0; + k24hr = 1; + kUseActiveLocale = 255; + } + + bitmap Feature : bitmap32 { + kCalendarFormat = 0x1; + } + + attribute access(write: manage) HourFormatEnum hourFormat = 0; + attribute access(write: manage) optional CalendarTypeEnum activeCalendarType = 1; + readonly attribute optional CalendarTypeEnum supportedCalendarTypes[] = 2; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Nodes should be expected to be deployed to any and all regions of the world. These global regions + may have differing preferences for the units in which values are conveyed in communication to a + user. As such, Nodes that visually or audibly convey measurable values to the user need a + mechanism by which they can be configured to use a user’s preferred unit. */ +cluster UnitLocalization = 45 { + revision 1; + + enum TempUnitEnum : enum8 { + kFahrenheit = 0; + kCelsius = 1; + kKelvin = 2; + } + + bitmap Feature : bitmap32 { + kTemperatureUnit = 0x1; + } + + attribute access(write: manage) optional TempUnitEnum temperatureUnit = 0; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** This cluster is used to manage global aspects of the Commissioning flow. */ +cluster GeneralCommissioning = 48 { + revision 1; // NOTE: Default/not specifically set + + enum CommissioningErrorEnum : enum8 { + kOK = 0; + kValueOutsideRange = 1; + kInvalidAuthentication = 2; + kNoFailSafe = 3; + kBusyWithOtherAdmin = 4; + kRequiredTCNotAccepted = 5; + kTCAcknowledgementsNotReceived = 6; + kTCMinVersionNotMet = 7; + } + + enum RegulatoryLocationTypeEnum : enum8 { + kIndoor = 0; + kOutdoor = 1; + kIndoorOutdoor = 2; + } + + bitmap Feature : bitmap32 { + kTermsAndConditions = 0x1; + } + + struct BasicCommissioningInfo { + int16u failSafeExpiryLengthSeconds = 0; + int16u maxCumulativeFailsafeSeconds = 1; + } + + attribute access(write: administer) int64u breadcrumb = 0; + readonly attribute BasicCommissioningInfo basicCommissioningInfo = 1; + readonly attribute RegulatoryLocationTypeEnum regulatoryConfig = 2; + readonly attribute RegulatoryLocationTypeEnum locationCapability = 3; + readonly attribute boolean supportsConcurrentConnection = 4; + provisional readonly attribute access(read: administer) optional int16u TCAcceptedVersion = 5; + provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; + provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; + provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ArmFailSafeRequest { + int16u expiryLengthSeconds = 0; + int64u breadcrumb = 1; + } + + response struct ArmFailSafeResponse = 1 { + CommissioningErrorEnum errorCode = 0; + char_string<128> debugText = 1; + } + + request struct SetRegulatoryConfigRequest { + RegulatoryLocationTypeEnum newRegulatoryConfig = 0; + char_string<2> countryCode = 1; + int64u breadcrumb = 2; + } + + response struct SetRegulatoryConfigResponse = 3 { + CommissioningErrorEnum errorCode = 0; + char_string debugText = 1; + } + + response struct CommissioningCompleteResponse = 5 { + CommissioningErrorEnum errorCode = 0; + char_string debugText = 1; + } + + request struct SetTCAcknowledgementsRequest { + int16u TCVersion = 0; + bitmap16 TCUserResponse = 1; + } + + response struct SetTCAcknowledgementsResponse = 7 { + CommissioningErrorEnum errorCode = 0; + } + + /** Arm the persistent fail-safe timer with an expiry time of now + ExpiryLengthSeconds using device clock */ + command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; + /** Set the regulatory configuration to be used during commissioning */ + command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; + /** Signals the Server that the Client has successfully completed all steps of Commissioning/Recofiguration needed during fail-safe period. */ + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + /** This command sets the user acknowledgements received in the Enhanced Setup Flow Terms and Conditions into the node. */ + command access(invoke: administer) SetTCAcknowledgements(SetTCAcknowledgementsRequest): SetTCAcknowledgementsResponse = 6; +} + +/** Functionality to configure, enable, disable network credentials and access on a Matter device. */ +cluster NetworkCommissioning = 49 { + revision 1; // NOTE: Default/not specifically set + + enum NetworkCommissioningStatusEnum : enum8 { + kSuccess = 0; + kOutOfRange = 1; + kBoundsExceeded = 2; + kNetworkIDNotFound = 3; + kDuplicateNetworkID = 4; + kNetworkNotFound = 5; + kRegulatoryError = 6; + kAuthFailure = 7; + kUnsupportedSecurity = 8; + kOtherConnectionFailure = 9; + kIPV6Failed = 10; + kIPBindFailed = 11; + kUnknownError = 12; + } + + enum WiFiBandEnum : enum8 { + k2G4 = 0; + k3G65 = 1; + k5G = 2; + k6G = 3; + k60G = 4; + k1G = 5; + } + + bitmap Feature : bitmap32 { + kWiFiNetworkInterface = 0x1; + kThreadNetworkInterface = 0x2; + kEthernetNetworkInterface = 0x4; + kPerDeviceCredentials = 0x8; + } + + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { + kUnencrypted = 0x1; + kWEP = 0x2; + kWPAPersonal = 0x4; + kWPA2Personal = 0x8; + kWPA3Personal = 0x10; + kWPA3MatterPDC = 0x20; + } + + struct NetworkInfoStruct { + octet_string<32> networkID = 0; + boolean connected = 1; + optional nullable octet_string<20> networkIdentifier = 2; + optional nullable octet_string<20> clientIdentifier = 3; + } + + struct ThreadInterfaceScanResultStruct { + int16u panId = 0; + int64u extendedPanId = 1; + char_string<16> networkName = 2; + int16u channel = 3; + int8u version = 4; + octet_string<8> extendedAddress = 5; + int8s rssi = 6; + int8u lqi = 7; + } + + struct WiFiInterfaceScanResultStruct { + WiFiSecurityBitmap security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBandEnum wiFiBand = 4; + int8s rssi = 5; + } + + readonly attribute access(read: administer) int8u maxNetworks = 0; + readonly attribute access(read: administer) NetworkInfoStruct networks[] = 1; + readonly attribute optional int8u scanMaxTimeSeconds = 2; + readonly attribute optional int8u connectMaxTimeSeconds = 3; + attribute access(write: administer) boolean interfaceEnabled = 4; + readonly attribute access(read: administer) nullable NetworkCommissioningStatusEnum lastNetworkingStatus = 5; + readonly attribute access(read: administer) nullable octet_string<32> lastNetworkID = 6; + readonly attribute access(read: administer) nullable int32s lastConnectErrorValue = 7; + provisional readonly attribute optional WiFiBandEnum supportedWiFiBands[] = 8; + provisional readonly attribute optional ThreadCapabilitiesBitmap supportedThreadFeatures = 9; + provisional readonly attribute optional int16u threadVersion = 10; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ScanNetworksRequest { + optional nullable octet_string<32> ssid = 0; + optional int64u breadcrumb = 1; + } + + response struct ScanNetworksResponse = 1 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional char_string debugText = 1; + optional WiFiInterfaceScanResultStruct wiFiScanResults[] = 2; + optional ThreadInterfaceScanResultStruct threadScanResults[] = 3; + } + + request struct AddOrUpdateWiFiNetworkRequest { + octet_string<32> ssid = 0; + octet_string<64> credentials = 1; + optional int64u breadcrumb = 2; + optional octet_string<140> networkIdentity = 3; + optional octet_string<20> clientIdentifier = 4; + optional octet_string<32> possessionNonce = 5; + } + + request struct AddOrUpdateThreadNetworkRequest { + octet_string<254> operationalDataset = 0; + optional int64u breadcrumb = 1; + } + + request struct RemoveNetworkRequest { + octet_string<32> networkID = 0; + optional int64u breadcrumb = 1; + } + + response struct NetworkConfigResponse = 5 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional char_string<512> debugText = 1; + optional int8u networkIndex = 2; + optional octet_string<140> clientIdentity = 3; + optional octet_string<64> possessionSignature = 4; + } + + request struct ConnectNetworkRequest { + octet_string<32> networkID = 0; + optional int64u breadcrumb = 1; + } + + response struct ConnectNetworkResponse = 7 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional char_string debugText = 1; + nullable int32s errorValue = 2; + } + + request struct ReorderNetworkRequest { + octet_string<32> networkID = 0; + int8u networkIndex = 1; + optional int64u breadcrumb = 2; + } + + request struct QueryIdentityRequest { + octet_string<20> keyIdentifier = 0; + optional octet_string<32> possessionNonce = 1; + } + + response struct QueryIdentityResponse = 10 { + octet_string<140> identity = 0; + optional octet_string<64> possessionSignature = 1; + } + + /** Detemine the set of networks the device sees as available. */ + command access(invoke: administer) ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; + /** Add or update the credentials for a given Wi-Fi network. */ + command access(invoke: administer) AddOrUpdateWiFiNetwork(AddOrUpdateWiFiNetworkRequest): NetworkConfigResponse = 2; + /** Add or update the credentials for a given Thread network. */ + command access(invoke: administer) AddOrUpdateThreadNetwork(AddOrUpdateThreadNetworkRequest): NetworkConfigResponse = 3; + /** Remove the definition of a given network (including its credentials). */ + command access(invoke: administer) RemoveNetwork(RemoveNetworkRequest): NetworkConfigResponse = 4; + /** Connect to the specified network, using previously-defined credentials. */ + command access(invoke: administer) ConnectNetwork(ConnectNetworkRequest): ConnectNetworkResponse = 6; + /** Modify the order in which networks will be presented in the Networks attribute. */ + command access(invoke: administer) ReorderNetwork(ReorderNetworkRequest): NetworkConfigResponse = 8; + /** Retrieve details about and optionally proof of possession of a network client identity. */ + command access(invoke: administer) QueryIdentity(QueryIdentityRequest): QueryIdentityResponse = 9; +} + +/** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ +cluster DiagnosticLogs = 50 { + revision 1; // NOTE: Default/not specifically set + + enum IntentEnum : enum8 { + kEndUserSupport = 0; + kNetworkDiag = 1; + kCrashLogs = 2; + } + + enum StatusEnum : enum8 { + kSuccess = 0; + kExhausted = 1; + kNoLogs = 2; + kBusy = 3; + kDenied = 4; + } + + enum TransferProtocolEnum : enum8 { + kResponsePayload = 0; + kBDX = 1; + } + + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct RetrieveLogsRequestRequest { + IntentEnum intent = 0; + TransferProtocolEnum requestedProtocol = 1; + optional char_string<32> transferFileDesignator = 2; + } + + response struct RetrieveLogsResponse = 1 { + StatusEnum status = 0; + long_octet_string logContent = 1; + optional epoch_us UTCTimeStamp = 2; + optional systime_us timeSinceBoot = 3; + } + + /** Retrieving diagnostic logs from a Node */ + command RetrieveLogsRequest(RetrieveLogsRequestRequest): RetrieveLogsResponse = 0; +} + +/** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ +cluster GeneralDiagnostics = 51 { + revision 2; + + enum BootReasonEnum : enum8 { + kUnspecified = 0; + kPowerOnReboot = 1; + kBrownOutReset = 2; + kSoftwareWatchdogReset = 3; + kHardwareWatchdogReset = 4; + kSoftwareUpdateCompleted = 5; + kSoftwareReset = 6; + } + + enum HardwareFaultEnum : enum8 { + kUnspecified = 0; + kRadio = 1; + kSensor = 2; + kResettableOverTemp = 3; + kNonResettableOverTemp = 4; + kPowerSource = 5; + kVisualDisplayFault = 6; + kAudioOutputFault = 7; + kUserInterfaceFault = 8; + kNonVolatileMemoryError = 9; + kTamperDetected = 10; + } + + enum InterfaceTypeEnum : enum8 { + kUnspecified = 0; + kWiFi = 1; + kEthernet = 2; + kCellular = 3; + kThread = 4; + } + + enum NetworkFaultEnum : enum8 { + kUnspecified = 0; + kHardwareFailure = 1; + kNetworkJammed = 2; + kConnectionFailed = 3; + } + + enum RadioFaultEnum : enum8 { + kUnspecified = 0; + kWiFiFault = 1; + kCellularFault = 2; + kThreadFault = 3; + kNFCFault = 4; + kBLEFault = 5; + kEthernetFault = 6; + } + + bitmap Feature : bitmap32 { + kDataModelTest = 0x1; + } + + struct NetworkInterface { + char_string<32> name = 0; + boolean isOperational = 1; + nullable boolean offPremiseServicesReachableIPv4 = 2; + nullable boolean offPremiseServicesReachableIPv6 = 3; + octet_string<8> hardwareAddress = 4; + octet_string IPv4Addresses[] = 5; + octet_string IPv6Addresses[] = 6; + InterfaceTypeEnum type = 7; + } + + critical event HardwareFaultChange = 0 { + HardwareFaultEnum current[] = 0; + HardwareFaultEnum previous[] = 1; + } + + critical event RadioFaultChange = 1 { + RadioFaultEnum current[] = 0; + RadioFaultEnum previous[] = 1; + } + + critical event NetworkFaultChange = 2 { + NetworkFaultEnum current[] = 0; + NetworkFaultEnum previous[] = 1; + } + + critical event BootReason = 3 { + BootReasonEnum bootReason = 0; + } + + readonly attribute NetworkInterface networkInterfaces[] = 0; + readonly attribute int16u rebootCount = 1; + readonly attribute optional int64u upTime = 2; + readonly attribute optional int32u totalOperationalHours = 3; + readonly attribute optional BootReasonEnum bootReason = 4; + readonly attribute optional HardwareFaultEnum activeHardwareFaults[] = 5; + readonly attribute optional RadioFaultEnum activeRadioFaults[] = 6; + readonly attribute optional NetworkFaultEnum activeNetworkFaults[] = 7; + readonly attribute boolean testEventTriggersEnabled = 8; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct TestEventTriggerRequest { + octet_string<16> enableKey = 0; + int64u eventTrigger = 1; + } + + response struct TimeSnapshotResponse = 2 { + systime_ms systemTimeMs = 0; + nullable posix_ms posixTimeMs = 1; + } + + request struct PayloadTestRequestRequest { + octet_string<16> enableKey = 0; + int8u value = 1; + int16u count = 2; + } + + response struct PayloadTestResponse = 4 { + octet_string payload = 0; + } + + /** Provide a means for certification tests to trigger some test-plan-specific events */ + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + /** Take a snapshot of system time and epoch time. */ + command TimeSnapshot(): TimeSnapshotResponse = 1; + /** Request a variable length payload response. */ + command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3; +} + +/** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ +cluster SoftwareDiagnostics = 52 { + revision 1; // NOTE: Default/not specifically set + + bitmap Feature : bitmap32 { + kWatermarks = 0x1; + } + + struct ThreadMetricsStruct { + int64u id = 0; + optional char_string<8> name = 1; + optional int32u stackFreeCurrent = 2; + optional int32u stackFreeMinimum = 3; + optional int32u stackSize = 4; + } + + info event SoftwareFault = 0 { + int64u id = 0; + optional char_string name = 1; + optional octet_string faultRecording = 2; + } + + readonly attribute optional ThreadMetricsStruct threadMetrics[] = 0; + readonly attribute optional int64u currentHeapFree = 1; + readonly attribute optional int64u currentHeapUsed = 2; + readonly attribute optional int64u currentHeapHighWatermark = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + /** Reception of this command SHALL reset the values: The StackFreeMinimum field of the ThreadMetrics attribute, CurrentHeapHighWaterMark attribute. */ + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; +} + +/** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ +cluster WiFiNetworkDiagnostics = 54 { + revision 1; // NOTE: Default/not specifically set + + enum AssociationFailureCauseEnum : enum8 { + kUnknown = 0; + kAssociationFailed = 1; + kAuthenticationFailed = 2; + kSsidNotFound = 3; + } + + enum ConnectionStatusEnum : enum8 { + kConnected = 0; + kNotConnected = 1; + } + + enum SecurityTypeEnum : enum8 { + kUnspecified = 0; + kNone = 1; + kWEP = 2; + kWPA = 3; + kWPA2 = 4; + kWPA3 = 5; + } + + enum WiFiVersionEnum : enum8 { + kA = 0; + kB = 1; + kG = 2; + kN = 3; + kAc = 4; + kAx = 5; + kAh = 6; + } + + bitmap Feature : bitmap32 { + kPacketCounts = 0x1; + kErrorCounts = 0x2; + } + + info event Disconnection = 0 { + int16u reasonCode = 0; + } + + info event AssociationFailure = 1 { + AssociationFailureCauseEnum associationFailureCause = 0; + int16u status = 1; + } + + info event ConnectionStatus = 2 { + ConnectionStatusEnum connectionStatus = 0; + } + + readonly attribute nullable octet_string<6> bssid = 0; + readonly attribute nullable SecurityTypeEnum securityType = 1; + readonly attribute nullable WiFiVersionEnum wiFiVersion = 2; + readonly attribute nullable int16u channelNumber = 3; + readonly attribute nullable int8s rssi = 4; + readonly attribute optional nullable int32u beaconLostCount = 5; + readonly attribute optional nullable int32u beaconRxCount = 6; + readonly attribute optional nullable int32u packetMulticastRxCount = 7; + readonly attribute optional nullable int32u packetMulticastTxCount = 8; + readonly attribute optional nullable int32u packetUnicastRxCount = 9; + readonly attribute optional nullable int32u packetUnicastTxCount = 10; + readonly attribute optional nullable int64u currentMaxRate = 11; + readonly attribute optional nullable int64u overrunCount = 12; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + /** Reception of this command SHALL reset the Breacon and Packet related count attributes to 0 */ + command ResetCounts(): DefaultSuccess = 0; +} + +/** Commands to trigger a Node to allow a new Administrator to commission it. */ +cluster AdministratorCommissioning = 60 { + revision 1; // NOTE: Default/not specifically set + + enum CommissioningWindowStatusEnum : enum8 { + kWindowNotOpen = 0; + kEnhancedWindowOpen = 1; + kBasicWindowOpen = 2; + } + + enum StatusCode : enum8 { + kBusy = 2; + kPAKEParameterError = 3; + kWindowNotOpen = 4; + } + + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable vendor_id adminVendorId = 2; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct OpenCommissioningWindowRequest { + int16u commissioningTimeout = 0; + octet_string PAKEPasscodeVerifier = 1; + int16u discriminator = 2; + int32u iterations = 3; + octet_string<32> salt = 4; + } + + request struct OpenBasicCommissioningWindowRequest { + int16u commissioningTimeout = 0; + } + + /** This command is used by a current Administrator to instruct a Node to go into commissioning mode using enhanced commissioning method. */ + timed command access(invoke: administer) OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0; + /** This command is used by a current Administrator to instruct a Node to go into commissioning mode using basic commissioning method, if the node supports it. */ + timed command access(invoke: administer) OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1; + /** This command is used by a current Administrator to instruct a Node to revoke any active Open Commissioning Window or Open Basic Commissioning Window command. */ + timed command access(invoke: administer) RevokeCommissioning(): DefaultSuccess = 2; +} + +/** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ +cluster OperationalCredentials = 62 { + revision 1; // NOTE: Default/not specifically set + + enum CertificateChainTypeEnum : enum8 { + kDACCertificate = 1; + kPAICertificate = 2; + } + + enum NodeOperationalCertStatusEnum : enum8 { + kOK = 0; + kInvalidPublicKey = 1; + kInvalidNodeOpId = 2; + kInvalidNOC = 3; + kMissingCsr = 4; + kTableFull = 5; + kInvalidAdminSubject = 6; + kFabricConflict = 9; + kLabelConflict = 10; + kInvalidFabricIndex = 11; + } + + fabric_scoped struct FabricDescriptorStruct { + octet_string<65> rootPublicKey = 1; + vendor_id vendorID = 2; + fabric_id fabricID = 3; + node_id nodeID = 4; + char_string<32> label = 5; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; + readonly attribute FabricDescriptorStruct fabrics[] = 1; + readonly attribute int8u supportedFabrics = 2; + readonly attribute int8u commissionedFabrics = 3; + readonly attribute octet_string trustedRootCertificates[] = 4; + readonly attribute int8u currentFabricIndex = 5; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AttestationRequestRequest { + octet_string<32> attestationNonce = 0; + } + + response struct AttestationResponse = 1 { + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; + } + + request struct CertificateChainRequestRequest { + CertificateChainTypeEnum certificateType = 0; + } + + response struct CertificateChainResponse = 3 { + octet_string<600> certificate = 0; + } + + request struct CSRRequestRequest { + octet_string<32> CSRNonce = 0; + optional boolean isForUpdateNOC = 1; + } + + response struct CSRResponse = 5 { + octet_string NOCSRElements = 0; + octet_string attestationSignature = 1; + } + + request struct AddNOCRequest { + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; + int64u caseAdminSubject = 3; + vendor_id adminVendorId = 4; + } + + request struct UpdateNOCRequest { + octet_string NOCValue = 0; + optional octet_string ICACValue = 1; + } + + response struct NOCResponse = 8 { + NodeOperationalCertStatusEnum statusCode = 0; + optional fabric_idx fabricIndex = 1; + optional char_string<128> debugText = 2; + } + + request struct UpdateFabricLabelRequest { + char_string<32> label = 0; + } + + request struct RemoveFabricRequest { + fabric_idx fabricIndex = 0; + } + + request struct AddTrustedRootCertificateRequest { + octet_string rootCACertificate = 0; + } + + /** Sender is requesting attestation information from the receiver. */ + command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; + /** Sender is requesting a device attestation certificate from the receiver. */ + command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; + /** Sender is requesting a certificate signing request (CSR) from the receiver. */ + command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; + /** Sender is requesting to add the new node operational certificates. */ + command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; + /** Sender is requesting to update the node operational certificates. */ + fabric command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; + /** This command SHALL be used by an Administrative Node to set the user-visible Label field for a given Fabric, as reflected by entries in the Fabrics attribute. */ + fabric command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + /** This command is used by Administrative Nodes to remove a given fabric index and delete all associated fabric-scoped data. */ + command access(invoke: administer) RemoveFabric(RemoveFabricRequest): NOCResponse = 10; + /** This command SHALL add a Trusted Root CA Certificate, provided as its CHIP Certificate representation. */ + command access(invoke: administer) AddTrustedRootCertificate(AddTrustedRootCertificateRequest): DefaultSuccess = 11; +} + +/** The Group Key Management Cluster is the mechanism by which group keys are managed. */ +cluster GroupKeyManagement = 63 { + revision 1; // NOTE: Default/not specifically set + + enum GroupKeySecurityPolicyEnum : enum8 { + kTrustFirst = 0; + kCacheAndSync = 1; + } + + bitmap Feature : bitmap32 { + kCacheAndSync = 0x1; + } + + fabric_scoped struct GroupInfoMapStruct { + group_id groupId = 1; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct GroupKeyMapStruct { + group_id groupId = 1; + int16u groupKeySetID = 2; + fabric_idx fabricIndex = 254; + } + + struct GroupKeySetStruct { + int16u groupKeySetID = 0; + GroupKeySecurityPolicyEnum groupKeySecurityPolicy = 1; + nullable octet_string<16> epochKey0 = 2; + nullable epoch_us epochStartTime0 = 3; + nullable octet_string<16> epochKey1 = 4; + nullable epoch_us epochStartTime1 = 5; + nullable octet_string<16> epochKey2 = 6; + nullable epoch_us epochStartTime2 = 7; + } + + attribute access(write: manage) GroupKeyMapStruct groupKeyMap[] = 0; + readonly attribute GroupInfoMapStruct groupTable[] = 1; + readonly attribute int16u maxGroupsPerFabric = 2; + readonly attribute int16u maxGroupKeysPerFabric = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct KeySetWriteRequest { + GroupKeySetStruct groupKeySet = 0; + } + + request struct KeySetReadRequest { + int16u groupKeySetID = 0; + } + + response struct KeySetReadResponse = 2 { + GroupKeySetStruct groupKeySet = 0; + } + + request struct KeySetRemoveRequest { + int16u groupKeySetID = 0; + } + + response struct KeySetReadAllIndicesResponse = 5 { + int16u groupKeySetIDs[] = 0; + } + + /** Write a new set of keys for the given key set id. */ + fabric command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; + /** Read the keys for a given key set id. */ + fabric command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; + /** Revoke a Root Key from a Group */ + fabric command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; + /** Return the list of Group Key Sets associated with the accessing fabric */ + fabric command access(invoke: administer) KeySetReadAllIndices(): KeySetReadAllIndicesResponse = 4; +} + +/** The Fixed Label Cluster provides a feature for the device to tag an endpoint with zero or more read only +labels. */ +cluster FixedLabel = 64 { + revision 1; // NOTE: Default/not specifically set + + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + + readonly attribute LabelStruct labelList[] = 0; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** The User Label Cluster provides a feature to tag an endpoint with zero or more labels. */ +cluster UserLabel = 65 { + revision 1; // NOTE: Default/not specifically set + + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + + attribute access(write: manage) LabelStruct labelList[] = 0; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** This cluster supports remotely monitoring and, where supported, changing the operational state of any device where a state machine is a part of the operation. */ +cluster OperationalState = 96 { + revision 1; + + enum ErrorStateEnum : enum8 { + kNoError = 0; + kUnableToStartOrResume = 1; + kUnableToCompleteOperation = 2; + kCommandInvalidInState = 3; + } + + enum OperationalStateEnum : enum8 { + kStopped = 0; + kRunning = 1; + kPaused = 2; + kError = 3; + } + + struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; + } + + struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; + } + + critical event OperationalError = 0 { + ErrorStateStruct errorState = 0; + } + + info event OperationCompletion = 1 { + enum8 completionErrorCode = 0; + optional nullable elapsed_s totalOperationalTime = 1; + optional nullable elapsed_s pausedTime = 2; + } + + readonly attribute nullable char_string phaseList[] = 0; + readonly attribute nullable int8u currentPhase = 1; + readonly attribute optional nullable elapsed_s countdownTime = 2; + readonly attribute OperationalStateStruct operationalStateList[] = 3; + readonly attribute OperationalStateEnum operationalState = 4; + readonly attribute ErrorStateStruct operationalError = 5; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + response struct OperationalCommandResponse = 4 { + ErrorStateStruct commandResponseState = 0; + } + + /** Upon receipt, the device SHALL pause its operation if it is possible based on the current function of the server. */ + command Pause(): OperationalCommandResponse = 0; + /** Upon receipt, the device SHALL stop its operation if it is at a position where it is safe to do so and/or permitted. */ + command Stop(): OperationalCommandResponse = 1; + /** Upon receipt, the device SHALL start its operation if it is safe to do so and the device is in an operational state from which it can be started. */ + command Start(): OperationalCommandResponse = 2; + /** Upon receipt, the device SHALL resume its operation from the point it was at when it received the Pause command, or from the point when it was paused by means outside of this cluster (for example by manual button press). */ + command Resume(): OperationalCommandResponse = 3; +} + +/** This cluster provides a mechanism for querying data about electrical power as measured by the server. */ +cluster ElectricalPowerMeasurement = 144 { + revision 1; + + enum MeasurementTypeEnum : enum16 { + kUnspecified = 0; + kVoltage = 1; + kActiveCurrent = 2; + kReactiveCurrent = 3; + kApparentCurrent = 4; + kActivePower = 5; + kReactivePower = 6; + kApparentPower = 7; + kRMSVoltage = 8; + kRMSCurrent = 9; + kRMSPower = 10; + kFrequency = 11; + kPowerFactor = 12; + kNeutralCurrent = 13; + kElectricalEnergy = 14; + } + + enum PowerModeEnum : enum8 { + kUnknown = 0; + kDC = 1; + kAC = 2; + } + + bitmap Feature : bitmap32 { + kDirectCurrent = 0x1; + kAlternatingCurrent = 0x2; + kPolyphasePower = 0x4; + kHarmonics = 0x8; + kPowerQuality = 0x10; + } + + struct MeasurementAccuracyRangeStruct { + int64s rangeMin = 0; + int64s rangeMax = 1; + optional percent100ths percentMax = 2; + optional percent100ths percentMin = 3; + optional percent100ths percentTypical = 4; + optional int64u fixedMax = 5; + optional int64u fixedMin = 6; + optional int64u fixedTypical = 7; + } + + struct MeasurementAccuracyStruct { + MeasurementTypeEnum measurementType = 0; + boolean measured = 1; + int64s minMeasuredValue = 2; + int64s maxMeasuredValue = 3; + MeasurementAccuracyRangeStruct accuracyRanges[] = 4; + } + + struct HarmonicMeasurementStruct { + int8u order = 0; + nullable int64s measurement = 1; + } + + struct MeasurementRangeStruct { + MeasurementTypeEnum measurementType = 0; + int64s min = 1; + int64s max = 2; + optional epoch_s startTimestamp = 3; + optional epoch_s endTimestamp = 4; + optional epoch_s minTimestamp = 5; + optional epoch_s maxTimestamp = 6; + optional systime_ms startSystime = 7; + optional systime_ms endSystime = 8; + optional systime_ms minSystime = 9; + optional systime_ms maxSystime = 10; + } + + info event MeasurementPeriodRanges = 0 { + MeasurementRangeStruct ranges[] = 0; + } + + readonly attribute PowerModeEnum powerMode = 0; + readonly attribute int8u numberOfMeasurementTypes = 1; + readonly attribute MeasurementAccuracyStruct accuracy[] = 2; + readonly attribute optional MeasurementRangeStruct ranges[] = 3; + readonly attribute optional nullable voltage_mv voltage = 4; + readonly attribute optional nullable amperage_ma activeCurrent = 5; + readonly attribute optional nullable amperage_ma reactiveCurrent = 6; + readonly attribute optional nullable amperage_ma apparentCurrent = 7; + readonly attribute nullable power_mw activePower = 8; + readonly attribute optional nullable power_mw reactivePower = 9; + readonly attribute optional nullable power_mw apparentPower = 10; + readonly attribute optional nullable voltage_mv RMSVoltage = 11; + readonly attribute optional nullable amperage_ma RMSCurrent = 12; + readonly attribute optional nullable power_mw RMSPower = 13; + readonly attribute optional nullable int64s frequency = 14; + readonly attribute optional nullable HarmonicMeasurementStruct harmonicCurrents[] = 15; + readonly attribute optional nullable HarmonicMeasurementStruct harmonicPhases[] = 16; + readonly attribute optional nullable int64s powerFactor = 17; + readonly attribute optional nullable amperage_ma neutralCurrent = 18; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** This cluster provides a mechanism for querying data about the electrical energy imported or provided by the server. */ +cluster ElectricalEnergyMeasurement = 145 { + revision 1; + + enum MeasurementTypeEnum : enum16 { + kUnspecified = 0; + kVoltage = 1; + kActiveCurrent = 2; + kReactiveCurrent = 3; + kApparentCurrent = 4; + kActivePower = 5; + kReactivePower = 6; + kApparentPower = 7; + kRMSVoltage = 8; + kRMSCurrent = 9; + kRMSPower = 10; + kFrequency = 11; + kPowerFactor = 12; + kNeutralCurrent = 13; + kElectricalEnergy = 14; + } + + bitmap Feature : bitmap32 { + kImportedEnergy = 0x1; + kExportedEnergy = 0x2; + kCumulativeEnergy = 0x4; + kPeriodicEnergy = 0x8; + } + + struct MeasurementAccuracyRangeStruct { + int64s rangeMin = 0; + int64s rangeMax = 1; + optional percent100ths percentMax = 2; + optional percent100ths percentMin = 3; + optional percent100ths percentTypical = 4; + optional int64u fixedMax = 5; + optional int64u fixedMin = 6; + optional int64u fixedTypical = 7; + } + + struct MeasurementAccuracyStruct { + MeasurementTypeEnum measurementType = 0; + boolean measured = 1; + int64s minMeasuredValue = 2; + int64s maxMeasuredValue = 3; + MeasurementAccuracyRangeStruct accuracyRanges[] = 4; + } + + struct CumulativeEnergyResetStruct { + optional nullable epoch_s importedResetTimestamp = 0; + optional nullable epoch_s exportedResetTimestamp = 1; + optional nullable systime_ms importedResetSystime = 2; + optional nullable systime_ms exportedResetSystime = 3; + } + + struct EnergyMeasurementStruct { + energy_mwh energy = 0; + optional epoch_s startTimestamp = 1; + optional epoch_s endTimestamp = 2; + optional systime_ms startSystime = 3; + optional systime_ms endSystime = 4; + } + + info event CumulativeEnergyMeasured = 0 { + optional EnergyMeasurementStruct energyImported = 0; + optional EnergyMeasurementStruct energyExported = 1; + } + + info event PeriodicEnergyMeasured = 1 { + optional EnergyMeasurementStruct energyImported = 0; + optional EnergyMeasurementStruct energyExported = 1; + } + + readonly attribute MeasurementAccuracyStruct accuracy = 0; + readonly attribute optional nullable EnergyMeasurementStruct cumulativeEnergyImported = 1; + readonly attribute optional nullable EnergyMeasurementStruct cumulativeEnergyExported = 2; + readonly attribute optional nullable EnergyMeasurementStruct periodicEnergyImported = 3; + readonly attribute optional nullable EnergyMeasurementStruct periodicEnergyExported = 4; + readonly attribute optional nullable CumulativeEnergyResetStruct cumulativeEnergyReset = 5; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** This cluster allows a client to manage the power draw of a device. An example of such a client could be an Energy Management System (EMS) which controls an Energy Smart Appliance (ESA). */ +provisional cluster DeviceEnergyManagement = 152 { + revision 4; + + enum AdjustmentCauseEnum : enum8 { + kLocalOptimization = 0; + kGridOptimization = 1; + } + + enum CauseEnum : enum8 { + kNormalCompletion = 0; + kOffline = 1; + kFault = 2; + kUserOptOut = 3; + kCancelled = 4; + } + + enum CostTypeEnum : enum8 { + kFinancial = 0; + kGHGEmissions = 1; + kComfort = 2; + kTemperature = 3; + } + + enum ESAStateEnum : enum8 { + kOffline = 0; + kOnline = 1; + kFault = 2; + kPowerAdjustActive = 3; + kPaused = 4; + } + + enum ESATypeEnum : enum8 { + kEVSE = 0; + kSpaceHeating = 1; + kWaterHeating = 2; + kSpaceCooling = 3; + kSpaceHeatingCooling = 4; + kBatteryStorage = 5; + kSolarPV = 6; + kFridgeFreezer = 7; + kWashingMachine = 8; + kDishwasher = 9; + kCooking = 10; + kHomeWaterPump = 11; + kIrrigationWaterPump = 12; + kPoolPump = 13; + kOther = 255; + } + + enum ForecastUpdateReasonEnum : enum8 { + kInternalOptimization = 0; + kLocalOptimization = 1; + kGridOptimization = 2; + } + + enum OptOutStateEnum : enum8 { + kNoOptOut = 0; + kLocalOptOut = 1; + kGridOptOut = 2; + kOptOut = 3; + } + + enum PowerAdjustReasonEnum : enum8 { + kNoAdjustment = 0; + kLocalOptimizationAdjustment = 1; + kGridOptimizationAdjustment = 2; + } + + bitmap Feature : bitmap32 { + kPowerAdjustment = 0x1; + kPowerForecastReporting = 0x2; + kStateForecastReporting = 0x4; + kStartTimeAdjustment = 0x8; + kPausable = 0x10; + kForecastAdjustment = 0x20; + kConstraintBasedAdjustment = 0x40; + } + + struct CostStruct { + CostTypeEnum costType = 0; + int32s value = 1; + int8u decimalPoints = 2; + optional int16u currency = 3; + } + + struct PowerAdjustStruct { + power_mw minPower = 0; + power_mw maxPower = 1; + elapsed_s minDuration = 2; + elapsed_s maxDuration = 3; + } + + struct PowerAdjustCapabilityStruct { + nullable PowerAdjustStruct powerAdjustCapability[] = 0; + PowerAdjustReasonEnum cause = 1; + } + + struct SlotStruct { + elapsed_s minDuration = 0; + elapsed_s maxDuration = 1; + elapsed_s defaultDuration = 2; + elapsed_s elapsedSlotTime = 3; + elapsed_s remainingSlotTime = 4; + optional boolean slotIsPausable = 5; + optional elapsed_s minPauseDuration = 6; + optional elapsed_s maxPauseDuration = 7; + optional int16u manufacturerESAState = 8; + optional power_mw nominalPower = 9; + optional power_mw minPower = 10; + optional power_mw maxPower = 11; + optional energy_mwh nominalEnergy = 12; + optional CostStruct costs[] = 13; + optional power_mw minPowerAdjustment = 14; + optional power_mw maxPowerAdjustment = 15; + optional elapsed_s minDurationAdjustment = 16; + optional elapsed_s maxDurationAdjustment = 17; + } + + struct ForecastStruct { + int32u forecastID = 0; + nullable int16u activeSlotNumber = 1; + epoch_s startTime = 2; + epoch_s endTime = 3; + optional nullable epoch_s earliestStartTime = 4; + optional epoch_s latestEndTime = 5; + boolean isPausable = 6; + SlotStruct slots[] = 7; + ForecastUpdateReasonEnum forecastUpdateReason = 8; + } + + struct ConstraintsStruct { + epoch_s startTime = 0; + elapsed_s duration = 1; + optional power_mw nominalPower = 2; + optional energy_mwh maximumEnergy = 3; + optional int8s loadControl = 4; + } + + struct SlotAdjustmentStruct { + int8u slotIndex = 0; + optional power_mw nominalPower = 1; + elapsed_s duration = 2; + } + + info event PowerAdjustStart = 0 { + } + + info event PowerAdjustEnd = 1 { + CauseEnum cause = 0; + elapsed_s duration = 1; + energy_mwh energyUse = 2; + } + + info event Paused = 2 { + } + + info event Resumed = 3 { + CauseEnum cause = 0; + } + + readonly attribute ESATypeEnum ESAType = 0; + readonly attribute boolean ESACanGenerate = 1; + readonly attribute ESAStateEnum ESAState = 2; + readonly attribute power_mw absMinPower = 3; + readonly attribute power_mw absMaxPower = 4; + readonly attribute optional nullable PowerAdjustCapabilityStruct powerAdjustmentCapability = 5; + readonly attribute optional nullable ForecastStruct forecast = 6; + readonly attribute optional OptOutStateEnum optOutState = 7; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct PowerAdjustRequestRequest { + power_mw power = 0; + elapsed_s duration = 1; + AdjustmentCauseEnum cause = 2; + } + + request struct StartTimeAdjustRequestRequest { + epoch_s requestedStartTime = 0; + AdjustmentCauseEnum cause = 1; + } + + request struct PauseRequestRequest { + elapsed_s duration = 0; + AdjustmentCauseEnum cause = 1; + } + + request struct ModifyForecastRequestRequest { + int32u forecastID = 0; + SlotAdjustmentStruct slotAdjustments[] = 1; + AdjustmentCauseEnum cause = 2; + } + + request struct RequestConstraintBasedForecastRequest { + ConstraintsStruct constraints[] = 0; + AdjustmentCauseEnum cause = 1; + } + + /** Allows a client to request an adjustment in the power consumption of an ESA for a specified duration. */ + command PowerAdjustRequest(PowerAdjustRequestRequest): DefaultSuccess = 0; + /** Allows a client to cancel an ongoing PowerAdjustmentRequest operation. */ + command CancelPowerAdjustRequest(): DefaultSuccess = 1; + /** Allows a client to adjust the start time of a Forecast sequence that has not yet started operation (i.e. where the current Forecast StartTime is in the future). */ + command StartTimeAdjustRequest(StartTimeAdjustRequestRequest): DefaultSuccess = 2; + /** Allows a client to temporarily pause an operation and reduce the ESAs energy demand. */ + command PauseRequest(PauseRequestRequest): DefaultSuccess = 3; + /** Allows a client to cancel the PauseRequest command and enable earlier resumption of operation. */ + command ResumeRequest(): DefaultSuccess = 4; + /** Allows a client to modify a Forecast within the limits allowed by the ESA. */ + command ModifyForecastRequest(ModifyForecastRequestRequest): DefaultSuccess = 5; + /** Allows a client to ask the ESA to recompute its Forecast based on power and time constraints. */ + command RequestConstraintBasedForecast(RequestConstraintBasedForecastRequest): DefaultSuccess = 6; + /** Allows a client to request cancellation of a previous adjustment request in a StartTimeAdjustRequest, ModifyForecastRequest or RequestConstraintBasedForecast command */ + command CancelRequest(): DefaultSuccess = 7; +} + +/** The Power Topology Cluster provides a mechanism for expressing how power is flowing between endpoints. */ +cluster PowerTopology = 156 { + revision 1; + + bitmap Feature : bitmap32 { + kNodeTopology = 0x1; + kTreeTopology = 0x2; + kSetTopology = 0x4; + kDynamicPowerFlow = 0x8; + } + + readonly attribute optional endpoint_no availableEndpoints[] = 0; + readonly attribute optional endpoint_no activeEndpoints[] = 1; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Attributes and commands for selecting a mode from a list of supported options. */ +provisional cluster DeviceEnergyManagementMode = 159 { + revision 1; + + enum ModeTag : enum16 { + kAuto = 0; + kQuick = 1; + kQuiet = 2; + kLowNoise = 3; + kLowEnergy = 4; + kVacation = 5; + kMin = 6; + kMax = 7; + kNight = 8; + kDay = 9; + kNoOptimization = 16384; + kDeviceOptimization = 16385; + kLocalOptimization = 16386; + kGridOptimization = 16387; + } + + bitmap Feature : bitmap32 { + kOnOff = 0x1; + } + + struct ModeTagStruct { + optional vendor_id mfgCode = 0; + enum16 value = 1; + } + + struct ModeOptionStruct { + char_string<64> label = 0; + int8u mode = 1; + ModeTagStruct modeTags[] = 2; + } + + readonly attribute ModeOptionStruct supportedModes[] = 0; + readonly attribute int8u currentMode = 1; + attribute optional nullable int8u startUpMode = 2; + attribute optional nullable int8u onMode = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ChangeToModeRequest { + int8u newMode = 0; + } + + response struct ChangeToModeResponse = 1 { + enum8 status = 0; + optional char_string<64> statusText = 1; + } + + /** This command is used to change device modes. + On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */ + command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0; +} + +endpoint 0 { + device type ma_rootdevice = 22, version 1; + + binding cluster OtaSoftwareUpdateProvider; + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + callback attribute featureMap; + callback attribute clusterRevision; + } + + server cluster AccessControl { + emits event AccessControlEntryChanged; + emits event AccessControlExtensionChanged; + callback attribute acl; + callback attribute extension; + callback attribute subjectsPerAccessControlEntry; + callback attribute targetsPerAccessControlEntry; + callback attribute accessControlEntriesPerFabric; + callback attribute attributeList; + ram attribute featureMap default = 0; + callback attribute clusterRevision; + } + + server cluster BasicInformation { + callback attribute dataModelRevision; + callback attribute vendorName; + callback attribute vendorID; + callback attribute productName; + callback attribute productID; + persist attribute nodeLabel; + callback attribute location; + callback attribute hardwareVersion; + callback attribute hardwareVersionString; + callback attribute softwareVersion; + callback attribute softwareVersionString; + callback attribute manufacturingDate; + callback attribute partNumber; + callback attribute productURL; + callback attribute productLabel; + callback attribute serialNumber; + persist attribute localConfigDisabled default = 0; + callback attribute uniqueID; + callback attribute capabilityMinima; + callback attribute specificationVersion; + callback attribute maxPathsPerInvoke; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 3; + } + + server cluster OtaSoftwareUpdateRequestor { + callback attribute defaultOTAProviders; + ram attribute updatePossible default = 1; + ram attribute updateState default = 0; + ram attribute updateStateProgress default = 0; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command AnnounceOTAProvider; + } + + server cluster LocalizationConfiguration { + persist attribute activeLocale default = "en-US"; + callback attribute supportedLocales; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster TimeFormatLocalization { + persist attribute hourFormat default = 0; + persist attribute activeCalendarType default = 0; + callback attribute supportedCalendarTypes; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster UnitLocalization { + persist attribute temperatureUnit default = 1; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster GeneralCommissioning { + ram attribute breadcrumb default = 0x0000000000000000; + callback attribute basicCommissioningInfo; + callback attribute regulatoryConfig; + callback attribute locationCapability; + callback attribute supportsConcurrentConnection; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command ArmFailSafe; + handle command ArmFailSafeResponse; + handle command SetRegulatoryConfig; + handle command SetRegulatoryConfigResponse; + handle command CommissioningComplete; + handle command CommissioningCompleteResponse; + } + + server cluster NetworkCommissioning { + ram attribute maxNetworks; + callback attribute networks; + ram attribute scanMaxTimeSeconds; + ram attribute connectMaxTimeSeconds; + ram attribute interfaceEnabled; + ram attribute lastNetworkingStatus; + ram attribute lastNetworkID; + ram attribute lastConnectErrorValue; + callback attribute supportedWiFiBands; + ram attribute featureMap default = 2; + ram attribute clusterRevision default = 1; + + handle command ScanNetworks; + handle command ScanNetworksResponse; + handle command AddOrUpdateWiFiNetwork; + handle command AddOrUpdateThreadNetwork; + handle command RemoveNetwork; + handle command NetworkConfigResponse; + handle command ConnectNetwork; + handle command ConnectNetworkResponse; + handle command ReorderNetwork; + } + + server cluster DiagnosticLogs { + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command RetrieveLogsRequest; + } + + server cluster GeneralDiagnostics { + emits event BootReason; + callback attribute networkInterfaces; + callback attribute rebootCount; + callback attribute upTime; + callback attribute totalOperationalHours; + callback attribute bootReason; + callback attribute activeHardwareFaults; + callback attribute activeRadioFaults; + callback attribute activeNetworkFaults; + callback attribute testEventTriggersEnabled default = false; + callback attribute featureMap; + callback attribute clusterRevision; + + handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; + } + + server cluster SoftwareDiagnostics { + emits event SoftwareFault; + callback attribute threadMetrics; + callback attribute currentHeapFree; + callback attribute currentHeapUsed; + callback attribute currentHeapHighWatermark; + callback attribute featureMap; + ram attribute clusterRevision default = 1; + + handle command ResetWatermarks; + } + + server cluster WiFiNetworkDiagnostics { + callback attribute bssid; + callback attribute securityType; + callback attribute wiFiVersion; + callback attribute channelNumber; + callback attribute rssi; + callback attribute beaconLostCount; + callback attribute beaconRxCount; + callback attribute packetMulticastRxCount; + callback attribute packetMulticastTxCount; + callback attribute packetUnicastRxCount; + callback attribute packetUnicastTxCount; + callback attribute currentMaxRate; + callback attribute overrunCount; + ram attribute featureMap default = 3; + ram attribute clusterRevision default = 1; + + handle command ResetCounts; + } + + server cluster AdministratorCommissioning { + callback attribute windowStatus; + callback attribute adminFabricIndex; + callback attribute adminVendorId; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command OpenCommissioningWindow; + handle command OpenBasicCommissioningWindow; + handle command RevokeCommissioning; + } + + server cluster OperationalCredentials { + callback attribute NOCs; + callback attribute fabrics; + callback attribute supportedFabrics; + callback attribute commissionedFabrics; + callback attribute trustedRootCertificates; + callback attribute currentFabricIndex; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command AttestationRequest; + handle command AttestationResponse; + handle command CertificateChainRequest; + handle command CertificateChainResponse; + handle command CSRRequest; + handle command CSRResponse; + handle command AddNOC; + handle command UpdateNOC; + handle command NOCResponse; + handle command UpdateFabricLabel; + handle command RemoveFabric; + handle command AddTrustedRootCertificate; + } + + server cluster GroupKeyManagement { + callback attribute groupKeyMap; + callback attribute groupTable; + callback attribute maxGroupsPerFabric; + callback attribute maxGroupKeysPerFabric; + callback attribute featureMap; + callback attribute clusterRevision; + + handle command KeySetWrite; + handle command KeySetRead; + handle command KeySetReadResponse; + handle command KeySetRemove; + handle command KeySetReadAllIndices; + handle command KeySetReadAllIndicesResponse; + } + + server cluster FixedLabel { + callback attribute labelList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster UserLabel { + callback attribute labelList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } +} +endpoint 1 { + device type ma_dishwasher = 117, version 1; + + + server cluster Identify { + ram attribute identifyTime default = 0x0; + ram attribute identifyType default = 0x00; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 4; + + handle command Identify; + handle command TriggerEffect; + } + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap; + callback attribute clusterRevision; + } + + server cluster Binding { + callback attribute binding; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster OperationalState { + callback attribute phaseList; + callback attribute currentPhase; + callback attribute operationalStateList; + callback attribute operationalState; + callback attribute operationalError; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command Pause; + handle command Stop; + handle command Start; + handle command Resume; + handle command OperationalCommandResponse; + } +} +endpoint 2 { + device type ma_electricalsensor = 1296, version 1; + + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap; + callback attribute clusterRevision; + } + + server cluster ElectricalPowerMeasurement { + emits event MeasurementPeriodRanges; + callback attribute powerMode; + callback attribute numberOfMeasurementTypes; + callback attribute accuracy; + callback attribute ranges; + callback attribute voltage; + callback attribute activeCurrent; + callback attribute reactiveCurrent; + callback attribute apparentCurrent; + callback attribute activePower; + callback attribute reactivePower; + callback attribute apparentPower; + callback attribute RMSVoltage; + callback attribute RMSCurrent; + callback attribute RMSPower; + callback attribute frequency; + callback attribute harmonicCurrents; + callback attribute harmonicPhases; + callback attribute powerFactor; + callback attribute neutralCurrent; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap; + ram attribute clusterRevision default = 1; + } + + server cluster ElectricalEnergyMeasurement { + emits event CumulativeEnergyMeasured; + callback attribute accuracy; + callback attribute cumulativeEnergyImported; + callback attribute cumulativeEnergyReset; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap; + ram attribute clusterRevision default = 1; + } + + server cluster PowerTopology { + callback attribute availableEndpoints; + callback attribute activeEndpoints; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap; + ram attribute clusterRevision default = 1; + } +} +endpoint 3 { + device type device_energy_management = 1293, version 1; + + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap; + callback attribute clusterRevision; + } + + server cluster DeviceEnergyManagement { + emits event PowerAdjustStart; + emits event PowerAdjustEnd; + emits event Paused; + emits event Resumed; + callback attribute ESAType; + callback attribute ESACanGenerate; + callback attribute ESAState; + callback attribute absMinPower; + callback attribute absMaxPower; + callback attribute powerAdjustmentCapability; + callback attribute forecast; + callback attribute optOutState; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap; + ram attribute clusterRevision default = 3; + + handle command PowerAdjustRequest; + handle command CancelPowerAdjustRequest; + handle command StartTimeAdjustRequest; + handle command PauseRequest; + handle command ResumeRequest; + handle command ModifyForecastRequest; + handle command RequestConstraintBasedForecast; + handle command CancelRequest; + } + + server cluster DeviceEnergyManagementMode { + callback attribute supportedModes; + callback attribute currentMode; + ram attribute startUpMode; + ram attribute onMode; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap; + ram attribute clusterRevision default = 1; + + handle command ChangeToMode; + handle command ChangeToModeResponse; + } +} + + diff --git a/examples/dishwasher-app/silabs/data_model/dishwasher-wifi-app.zap b/examples/dishwasher-app/silabs/data_model/dishwasher-wifi-app.zap new file mode 100644 index 0000000000..61d3ad5f4c --- /dev/null +++ b/examples/dishwasher-app/silabs/data_model/dishwasher-wifi-app.zap @@ -0,0 +1,5189 @@ +{ + "fileFormat": 2, + "featureLevel": 100, + "creator": "zap", + "keyValuePairs": [ + { + "key": "commandDiscovery", + "value": "1" + }, + { + "key": "defaultResponsePolicy", + "value": "always" + }, + { + "key": "manufacturerCodes", + "value": "0x1002" + } + ], + "package": [ + { + "pathRelativity": "relativeToZap", + "path": "../../../../src/app/zap-templates/zcl/zcl.json", + "type": "zcl-properties", + "category": "matter", + "version": 1, + "description": "Matter SDK ZCL data" + }, + { + "pathRelativity": "relativeToZap", + "path": "../../../../src/app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "category": "matter", + "version": "chip-v1" + } + ], + "endpointTypes": [ + { + "id": 1, + "name": "MA-rootdevice", + "deviceTypeRef": { + "code": 22, + "profileId": 259, + "label": "MA-rootdevice", + "name": "MA-rootdevice" + }, + "deviceTypes": [ + { + "code": 22, + "profileId": 259, + "label": "MA-rootdevice", + "name": "MA-rootdevice" + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 22 + ], + "deviceTypeName": "MA-rootdevice", + "deviceTypeCode": 22, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Access Control", + "code": 31, + "mfgCode": null, + "define": "ACCESS_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "ACL", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Extension", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SubjectsPerAccessControlEntry", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TargetsPerAccessControlEntry", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AccessControlEntriesPerFabric", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "AccessControlEntryChanged", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "AccessControlExtensionChanged", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Basic Information", + "code": 40, + "mfgCode": null, + "define": "BASIC_INFORMATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DataModelRevision", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorName", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorID", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "vendor_id", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductName", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductID", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NodeLabel", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Location", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersion", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersionString", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersion", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersionString", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ManufacturingDate", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartNumber", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductURL", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "long_char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductLabel", + "code": 14, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SerialNumber", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LocalConfigDisabled", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UniqueID", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CapabilityMinima", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "CapabilityMinimaStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SpecificationVersion", + "code": 21, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxPathsPerInvoke", + "code": 22, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "OTA Software Update Provider", + "code": 41, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER", + "side": "client", + "enabled": 1, + "commands": [ + { + "name": "QueryImage", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "QueryImageResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ApplyUpdateRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ApplyUpdateResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "NotifyUpdateApplied", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "OTA Software Update Requestor", + "code": 42, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "AnnounceOTAProvider", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "DefaultOTAProviders", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UpdatePossible", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpdateState", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "UpdateStateEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpdateStateProgress", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Localization Configuration", + "code": 43, + "mfgCode": null, + "define": "LOCALIZATION_CONFIGURATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "ActiveLocale", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "en-US", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportedLocales", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Time Format Localization", + "code": 44, + "mfgCode": null, + "define": "TIME_FORMAT_LOCALIZATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "HourFormat", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "HourFormatEnum", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveCalendarType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "CalendarTypeEnum", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportedCalendarTypes", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Unit Localization", + "code": 45, + "mfgCode": null, + "define": "UNIT_LOCALIZATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "TemperatureUnit", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "TempUnitEnum", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "General Commissioning", + "code": 48, + "mfgCode": null, + "define": "GENERAL_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ArmFailSafe", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ArmFailSafeResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "SetRegulatoryConfig", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "SetRegulatoryConfigResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "CommissioningComplete", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CommissioningCompleteResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "Breadcrumb", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BasicCommissioningInfo", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "BasicCommissioningInfo", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RegulatoryConfig", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LocationCapability", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportsConcurrentConnection", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Network Commissioning", + "code": 49, + "mfgCode": null, + "define": "NETWORK_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ScanNetworks", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ScanNetworksResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "AddOrUpdateWiFiNetwork", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "AddOrUpdateThreadNetwork", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RemoveNetwork", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "NetworkConfigResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ConnectNetwork", + "code": 6, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ConnectNetworkResponse", + "code": 7, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ReorderNetwork", + "code": 8, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "MaxNetworks", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Networks", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ScanMaxTimeSeconds", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ConnectMaxTimeSeconds", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "InterfaceEnabled", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkingStatus", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "NetworkCommissioningStatusEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkID", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastConnectErrorValue", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int32s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportedWiFiBands", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Diagnostic Logs", + "code": 50, + "mfgCode": null, + "define": "DIAGNOSTIC_LOGS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "RetrieveLogsRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "General Diagnostics", + "code": 51, + "mfgCode": null, + "define": "GENERAL_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "TestEventTrigger", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "NetworkInterfaces", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RebootCount", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TotalOperationalHours", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BootReason", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "BootReasonEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveHardwareFaults", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveRadioFaults", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveNetworkFaults", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TestEventTriggersEnabled", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "false", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "BootReason", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Software Diagnostics", + "code": 52, + "mfgCode": null, + "define": "SOFTWARE_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ResetWatermarks", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "ThreadMetrics", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentHeapFree", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentHeapUsed", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentHeapHighWatermark", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "SoftwareFault", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "WiFi Network Diagnostics", + "code": 54, + "mfgCode": null, + "define": "WIFI_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ResetCounts", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "BSSID", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SecurityType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "SecurityTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "WiFiVersion", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "WiFiVersionEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ChannelNumber", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RSSI", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int8s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BeaconLostCount", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BeaconRxCount", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketMulticastRxCount", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketMulticastTxCount", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketUnicastRxCount", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketUnicastTxCount", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentMaxRate", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OverrunCount", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Administrator Commissioning", + "code": 60, + "mfgCode": null, + "define": "ADMINISTRATOR_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "OpenCommissioningWindow", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "OpenBasicCommissioningWindow", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RevokeCommissioning", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "WindowStatus", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "CommissioningWindowStatusEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AdminFabricIndex", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "fabric_idx", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AdminVendorId", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "vendor_id", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Operational Credentials", + "code": 62, + "mfgCode": null, + "define": "OPERATIONAL_CREDENTIALS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "AttestationRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "AttestationResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "CertificateChainRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CertificateChainResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "CSRRequest", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CSRResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "AddNOC", + "code": 6, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "UpdateNOC", + "code": 7, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "NOCResponse", + "code": 8, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "UpdateFabricLabel", + "code": 9, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RemoveFabric", + "code": 10, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "AddTrustedRootCertificate", + "code": 11, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "NOCs", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Fabrics", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SupportedFabrics", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CommissionedFabrics", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TrustedRootCertificates", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentFabricIndex", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Group Key Management", + "code": 63, + "mfgCode": null, + "define": "GROUP_KEY_MANAGEMENT_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "KeySetWrite", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetRead", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetReadResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "KeySetRemove", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetReadAllIndices", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetReadAllIndicesResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "GroupKeyMap", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GroupTable", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxGroupsPerFabric", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxGroupKeysPerFabric", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Fixed Label", + "code": 64, + "mfgCode": null, + "define": "FIXED_LABEL_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "LabelList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "User Label", + "code": 65, + "mfgCode": null, + "define": "USER_LABEL_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "LabelList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + }, + { + "id": 2, + "name": "MA-dishwasher", + "deviceTypeRef": { + "code": 117, + "profileId": 259, + "label": "MA-dishwasher", + "name": "MA-dishwasher" + }, + "deviceTypes": [ + { + "code": 117, + "profileId": 259, + "label": "MA-dishwasher", + "name": "MA-dishwasher" + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 117 + ], + "deviceTypeName": "MA-dishwasher", + "deviceTypeCode": 117, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "Identify", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TriggerEffect", + "code": 64, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "IdentifyTime", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "IdentifyType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "IdentifyTypeEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Binding", + "code": 30, + "mfgCode": null, + "define": "BINDING_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "Binding", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Operational State", + "code": 96, + "mfgCode": null, + "define": "OPERATIONAL_STATE_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "Pause", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "Stop", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "Start", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "Resume", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "OperationalCommandResponse", + "code": 4, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "PhaseList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentPhase", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OperationalStateList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OperationalState", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "OperationalStateEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OperationalError", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "ErrorStateStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + }, + { + "id": 3, + "name": "MA-electricalsensor", + "deviceTypeRef": { + "code": 1296, + "profileId": 259, + "label": "MA-electricalsensor", + "name": "MA-electricalsensor" + }, + "deviceTypes": [ + { + "code": 1296, + "profileId": 259, + "label": "MA-electricalsensor", + "name": "MA-electricalsensor" + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 1296 + ], + "deviceTypeName": "MA-electricalsensor", + "deviceTypeCode": 1296, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Electrical Power Measurement", + "code": 144, + "mfgCode": null, + "define": "ELECTRICAL_POWER_MEASUREMENT_CLUSTER", + "side": "server", + "enabled": 1, + "apiMaturity": "provisional", + "attributes": [ + { + "name": "PowerMode", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "PowerModeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NumberOfMeasurementTypes", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Accuracy", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Ranges", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Voltage", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "voltage_mv", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveCurrent", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "amperage_ma", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ReactiveCurrent", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "amperage_ma", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ApparentCurrent", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "amperage_ma", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActivePower", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "power_mw", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ReactivePower", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "power_mw", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ApparentPower", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "power_mw", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "RMSVoltage", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "voltage_mv", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "RMSCurrent", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "amperage_ma", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "RMSPower", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "power_mw", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Frequency", + "code": 14, + "mfgCode": null, + "side": "server", + "type": "int64s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "HarmonicCurrents", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "HarmonicPhases", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PowerFactor", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "int64s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NeutralCurrent", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "amperage_ma", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "MeasurementPeriodRanges", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Electrical Energy Measurement", + "code": 145, + "mfgCode": null, + "define": "ELECTRICAL_ENERGY_MEASUREMENT_CLUSTER", + "side": "server", + "enabled": 1, + "apiMaturity": "provisional", + "attributes": [ + { + "name": "Accuracy", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "MeasurementAccuracyStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CumulativeEnergyImported", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "EnergyMeasurementStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CumulativeEnergyReset", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "CumulativeEnergyResetStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "CumulativeEnergyMeasured", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Power Topology", + "code": 156, + "mfgCode": null, + "define": "POWER_TOPOLOGY_CLUSTER", + "side": "server", + "enabled": 1, + "apiMaturity": "provisional", + "attributes": [ + { + "name": "AvailableEndpoints", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveEndpoints", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + }, + { + "id": 4, + "name": "MA-deviceenergymanagement", + "deviceTypeRef": { + "code": 1293, + "profileId": 259, + "label": "Device Energy Management", + "name": "Device Energy Management" + }, + "deviceTypes": [ + { + "code": 1293, + "profileId": 259, + "label": "Device Energy Management", + "name": "Device Energy Management" + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 1293 + ], + "deviceTypeName": "Device Energy Management", + "deviceTypeCode": 1293, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Device Energy Management", + "code": 152, + "mfgCode": null, + "define": "DEVICE_ENERGY_MANAGEMENT_CLUSTER", + "side": "server", + "enabled": 1, + "apiMaturity": "provisional", + "commands": [ + { + "name": "PowerAdjustRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CancelPowerAdjustRequest", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "StartTimeAdjustRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "PauseRequest", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ResumeRequest", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ModifyForecastRequest", + "code": 5, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RequestConstraintBasedForecast", + "code": 6, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CancelRequest", + "code": 7, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "ESAType", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "ESATypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ESACanGenerate", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ESAState", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "ESAStateEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AbsMinPower", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "power_mw", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AbsMaxPower", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "power_mw", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PowerAdjustmentCapability", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Forecast", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "ForecastStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OptOutState", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "OptOutStateEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "PowerAdjustStart", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "PowerAdjustEnd", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "Paused", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "Resumed", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Device Energy Management Mode", + "code": 159, + "mfgCode": null, + "define": "DEVICE_ENERGY_MANAGEMENT_MODE_CLUSTER", + "side": "server", + "enabled": 1, + "apiMaturity": "provisional", + "commands": [ + { + "name": "ChangeToMode", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ChangeToModeResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "SupportedModes", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentMode", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "StartUpMode", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OnMode", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + } + ], + "endpoints": [ + { + "endpointTypeName": "MA-rootdevice", + "endpointTypeIndex": 0, + "profileId": 259, + "endpointId": 0, + "networkId": 0, + "parentEndpointIdentifier": null + }, + { + "endpointTypeName": "MA-dishwasher", + "endpointTypeIndex": 1, + "profileId": 259, + "endpointId": 1, + "networkId": 0, + "parentEndpointIdentifier": null + }, + { + "endpointTypeName": "MA-electricalsensor", + "endpointTypeIndex": 2, + "profileId": 259, + "endpointId": 2, + "networkId": 0, + "parentEndpointIdentifier": null + }, + { + "endpointTypeName": "MA-deviceenergymanagement", + "endpointTypeIndex": 3, + "profileId": 259, + "endpointId": 3, + "networkId": 0, + "parentEndpointIdentifier": null + } + ] +} \ No newline at end of file diff --git a/examples/dishwasher-app/silabs/include/AppConfig.h b/examples/dishwasher-app/silabs/include/AppConfig.h new file mode 100644 index 0000000000..c1633f454d --- /dev/null +++ b/examples/dishwasher-app/silabs/include/AppConfig.h @@ -0,0 +1,88 @@ +/* + * + * 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 "silabs_utils.h" + +// ---- Dishwasher Example App Config ---- + +#define APP_TASK_NAME "DishWasher" + +#define BLE_DEV_NAME "SL-Dishwasher" + +// Number of seconds between event and attribute updates for cumulative energy are emited +#define CUMULATIVE_REPORT_INTERVAL_SECONDS 60 + +// APP Logo, boolean only. must be 64x64 +#define ON_DEMO_BITMAP \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0x7F, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x00, \ + 0x00, 0xF0, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0xFF, \ + 0x07, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x1E, 0x1E, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x1F, 0x1F, 0x00, \ + 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x1F, 0x1F, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x1F, 0x1F, 0x00, 0x00, 0xE0, 0xFF, 0xFF, \ + 0x07, 0x0E, 0x0E, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00, \ + 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0xFF, \ + 0x07, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, \ + 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x7F, 0xFF, \ + 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x7F, 0xFE, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x3F, 0xFC, 0xFF, 0xE0, 0xFF, 0xFF, \ + 0x07, 0xFF, 0x1F, 0xFC, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x1F, 0xF8, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x0F, 0xF0, \ + 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x0F, 0xF0, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x07, 0xE0, 0xFF, 0xE0, 0xFF, 0xFF, \ + 0x07, 0xFF, 0x07, 0xE0, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x03, 0xC0, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x03, 0xC0, \ + 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x01, 0x80, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x01, 0x80, 0xFF, 0xE0, 0xFF, 0xFF, \ + 0x07, 0xFF, 0x01, 0x80, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x01, 0x80, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x01, 0x80, \ + 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x01, 0x80, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x03, 0xC0, 0xFF, 0xE0, 0xFF, 0xFF, \ + 0x07, 0xFF, 0x03, 0xE0, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x0F, 0xF0, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x1F, 0xF8, \ + 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, \ + 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0xFF, \ + 0x07, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x00, \ + 0x00, 0xF8, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF + +#define OFF_DEMO_BITMAP \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F, \ + 0x7F, 0x00, 0x00, 0x00, 0x00, 0xFC, 0xFF, 0x0F, 0x7F, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xFF, 0x07, 0xFE, 0x00, 0x00, 0x00, \ + 0x00, 0xF0, 0xFF, 0x07, 0xFC, 0x01, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x0F, 0xF8, 0x03, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x1F, \ + 0xF0, 0x07, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0xE0, 0x0F, 0x0E, 0x00, 0x00, 0xE0, 0xFF, 0x7F, 0xC0, 0x1F, 0x1F, 0x00, \ + 0x00, 0xE0, 0xFF, 0xFF, 0x80, 0x3F, 0x1F, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x01, 0x7F, 0x1F, 0x00, 0x00, 0xE0, 0xFF, 0xFF, \ + 0x03, 0xFE, 0x0E, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0xFC, 0x01, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0xF8, 0x03, 0x00, \ + 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0xF0, 0x07, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0xE0, 0x0F, 0x00, 0x00, 0xE0, 0xFF, 0xFF, \ + 0x07, 0xC0, 0x1F, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x81, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0x03, 0xFF, 0xFF, \ + 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0x07, 0xFE, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0x0F, 0xFC, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, \ + 0x07, 0x1F, 0xF8, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0x3F, 0xF0, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0x7F, 0xE0, 0xFF, \ + 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0xC0, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x81, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, \ + 0x07, 0xFF, 0x03, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x07, 0xFE, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x0F, 0xFC, \ + 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x0F, 0xF8, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x07, 0xF0, 0xFF, 0xE0, 0xFF, 0xFF, \ + 0x07, 0xFF, 0x07, 0xE0, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x03, 0xC0, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x03, 0x80, \ + 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x01, 0x00, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x01, 0x00, 0xFE, 0xE0, 0xFF, 0xFF, \ + 0x07, 0xFF, 0x01, 0x00, 0xFC, 0xE1, 0xFF, 0xFF, 0x07, 0xFF, 0x01, 0x00, 0xF8, 0xE3, 0xFF, 0xFF, 0x07, 0xFF, 0x01, 0x00, \ + 0xF0, 0xE7, 0xFF, 0xFF, 0x07, 0xFF, 0x01, 0x00, 0xE0, 0xEF, 0xFF, 0xFF, 0x07, 0xFF, 0x03, 0x40, 0xC0, 0xFF, 0xFF, 0xFF, \ + 0x07, 0xFF, 0x03, 0xE0, 0x80, 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0x0F, 0xF0, 0x01, 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0x1F, 0xF8, \ + 0x03, 0xFE, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0x07, 0xFC, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0x0F, 0xF8, 0xFF, 0xFF, \ + 0x07, 0xFF, 0xFF, 0xFF, 0x1F, 0xF0, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0x3F, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, \ + 0x7F, 0xC0, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0x80, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, \ + 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0xFF, 0x1F, 0x00, 0x00, 0x00, \ + 0x00, 0x08, 0xF8, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x3E, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFE, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF diff --git a/examples/dishwasher-app/silabs/include/AppEvent.h b/examples/dishwasher-app/silabs/include/AppEvent.h new file mode 100644 index 0000000000..259034e1b5 --- /dev/null +++ b/examples/dishwasher-app/silabs/include/AppEvent.h @@ -0,0 +1,55 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2018 Nest Labs, Inc. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +struct AppEvent; +typedef void (*EventHandler)(AppEvent *); + +struct AppEvent +{ + enum AppEventTypes + { + kEventType_Button = 0, + kEventType_Timer, + kEventType_Dishwasher, + kEventType_Install, + }; + + uint16_t Type; + + union + { + struct + { + uint8_t Action; + } ButtonEvent; + struct + { + void * Context; + } TimerEvent; + struct + { + uint8_t Action; + int32_t Actor; + } DishwasherEvent; + }; + + EventHandler Handler; +}; diff --git a/examples/dishwasher-app/silabs/include/AppTask.h b/examples/dishwasher-app/silabs/include/AppTask.h new file mode 100644 index 0000000000..63cc97e849 --- /dev/null +++ b/examples/dishwasher-app/silabs/include/AppTask.h @@ -0,0 +1,103 @@ +/* + * + * 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 + +/********************************************************** + * Includes + *********************************************************/ +#include +#include +#include +#include + +#include "BaseApplication.h" + +/********************************************************** + * Defines + *********************************************************/ + +// 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) + +/********************************************************** + * AppTask Declaration + *********************************************************/ +class AppTask : public BaseApplication +{ + +public: + AppTask() = default; + + static AppTask & GetAppTask() { return sAppTask; } + + /** + * @brief AppTask task main loop function + * + * @param pvParameter FreeRTOS task parameter + */ + static void AppTaskMain(void * pvParameter); + + CHIP_ERROR StartAppTask(); + + /** + * @brief Event handler when a button is pressed + * Function posts an event for button processing + * + * @param buttonHandle APP_CONTROL_BUTTON or APP_FUNCTION_BUTTON + * @param btnAction Button action - SL_SIMPLE_BUTTON_PRESSED, + * SL_SIMPLE_BUTTON_RELEASED or + * SL_SIMPLE_BUTTON_DISABLED + */ + static void ButtonEventHandler(uint8_t button, uint8_t btnAction); + +private: + static AppTask sAppTask; + /** + * @brief AppTask initialisation function + * + * @return CHIP_ERROR + */ + CHIP_ERROR Init(); + + /** + * @brief PB0 Button event processing function + * Press and hold will trigger a factory reset timer start + * Press and release will restart BLEAdvertising if not commisionned + * + * @param aEvent button event being processed + */ + static void ButtonHandler(AppEvent * aEvent); + + /** + * @brief PB1 Button event processing function + * Function triggers a switch action sent to the CHIP task + * + * @param aEvent button event being processed + */ + static void DishwasherActionEventHandler(AppEvent * aEvent); + + static void ActionInitiated(chip::app::Clusters::OperationalState::OperationalStateEnum action); + static void ActionCompleted(); +}; diff --git a/examples/dishwasher-app/silabs/include/CHIPProjectConfig.h b/examples/dishwasher-app/silabs/include/CHIPProjectConfig.h new file mode 100644 index 0000000000..57d85a4830 --- /dev/null +++ b/examples/dishwasher-app/silabs/include/CHIPProjectConfig.h @@ -0,0 +1,102 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2019 Google LLC. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * Example project configuration file for CHIP. + * + * This is a place to put application or project-specific overrides + * to the default configuration values for general CHIP features. + * + */ + +#pragma once + +// Use a default pairing code if one hasn't been provisioned in flash. +#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE +#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 +#endif + +#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR +#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 +#endif + +// For convenience, Chip Security Test Mode can be enabled and the +// requirement for authentication in various protocols can be disabled. +// +// WARNING: These options make it possible to circumvent basic Chip security functionality, +// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS. +// +#define CHIP_CONFIG_SECURITY_TEST_MODE 0 + +/** + * CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID + * + * 0xFFF1: Test vendor + */ +#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID 0xFFF1 + +/** + * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID + * + * 0x8005: example Dishwasher + */ +#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x8005 + +/** + * CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE + * + * Enable support for Chip-over-BLE (CHIPoBLE). + */ +#define CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE 1 + +/** + * 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_EVENT_LOGGING_UTC_TIMESTAMPS + * + * Enable recording UTC timestamps. + */ +#define CHIP_DEVICE_CONFIG_EVENT_LOGGING_UTC_TIMESTAMPS 1 + +/** + * CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE + * + * A size, in bytes, of the individual debug event logging buffer. + */ +#define CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE (512) + +/** + * @def CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL + * + * @brief + * Active retransmit interval, or time to wait before retransmission after + * subsequent failures in milliseconds. + * + * This is the default value, that might be adjusted by end device depending on its + * needs (e.g. sleeping period) using Service Discovery TXT record CRA key. + * + */ +#define CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL (2000_ms32) diff --git a/examples/dishwasher-app/silabs/include/DataModelHelper.h b/examples/dishwasher-app/silabs/include/DataModelHelper.h new file mode 100644 index 0000000000..df46629269 --- /dev/null +++ b/examples/dishwasher-app/silabs/include/DataModelHelper.h @@ -0,0 +1,27 @@ +/* + * + * 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 + +namespace DataModelHelper { + +chip::EndpointId GetEndpointIdFromCluster(chip::ClusterId clusterId); + +} // namespace DataModelHelper diff --git a/examples/dishwasher-app/silabs/include/DeviceEnergyManager.h b/examples/dishwasher-app/silabs/include/DeviceEnergyManager.h new file mode 100644 index 0000000000..9b9e1b548e --- /dev/null +++ b/examples/dishwasher-app/silabs/include/DeviceEnergyManager.h @@ -0,0 +1,37 @@ +/* + * + * 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. + */ + +#pragma once + +#include + +class DeviceEnergyManager +{ +public: + ~DeviceEnergyManager() { Shutdown(); } + + static DeviceEnergyManager & Instance(void) { return sDeviceEnergy; } + + chip::app::Clusters::DeviceEnergyManagement::DeviceEnergyManagementDelegate * GetDEMDelegate(); + + CHIP_ERROR Init(); + void Shutdown(); + +private: + static DeviceEnergyManager sDeviceEnergy; +}; diff --git a/examples/dishwasher-app/silabs/include/DishwasherManager.h b/examples/dishwasher-app/silabs/include/DishwasherManager.h new file mode 100644 index 0000000000..f832e6f0b5 --- /dev/null +++ b/examples/dishwasher-app/silabs/include/DishwasherManager.h @@ -0,0 +1,99 @@ +/* + * + * 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 "AppEvent.h" +#include +#include +#include +#include +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace DeviceEnergyManagement { + +class DishwasherManager : public DEMManufacturerDelegate +{ + using OperationalStateEnum = chip::app::Clusters::OperationalState::OperationalStateEnum; + +public: + static constexpr int64_t kApproximateEnergyUsedByESA = 1800'000; // mW + + DishwasherManager(DeviceEnergyManagementManager * aDEMInstance) : mDEMInstance(aDEMInstance) {} + virtual ~DishwasherManager() {} + + CHIP_ERROR Init(); + void CycleOperationalState(); + void UpdateDishwasherLed(); + void UpdateOperationState(OperationalStateEnum state); + OperationalStateEnum GetOperationalState(); + + typedef void (*Callback_fn_initiated)(OperationalStateEnum action); + typedef void (*Callback_fn_completed)(); + void SetCallbacks(Callback_fn_initiated aActionInitiated_CB, Callback_fn_completed aActionCompleted_CB); + + DeviceEnergyManagementDelegate * GetDEMDelegate() + { + if (mDEMInstance) + { + return mDEMInstance->GetDelegate(); + } + return nullptr; + } + + // The PowerAdjustEnd event needs to report the approximate energy used by the ESA during the session. + int64_t GetApproxEnergyDuringSession() override; + + CHIP_ERROR HandleDeviceEnergyManagementPowerAdjustRequest(const int64_t powerMw, const uint32_t durationS, + AdjustmentCauseEnum cause) override; + CHIP_ERROR HandleDeviceEnergyManagementPowerAdjustCompletion() override; + + CHIP_ERROR HandleDeviceEnergyManagementCancelPowerAdjustRequest(CauseEnum cause) override; + CHIP_ERROR HandleDeviceEnergyManagementStartTimeAdjustRequest(const uint32_t requestedStartTimeUtc, + AdjustmentCauseEnum cause) override; + CHIP_ERROR HandleDeviceEnergyManagementPauseRequest(const uint32_t durationS, AdjustmentCauseEnum cause) override; + CHIP_ERROR HandleDeviceEnergyManagementPauseCompletion() override; + CHIP_ERROR HandleDeviceEnergyManagementCancelPauseRequest(CauseEnum cause) override; + CHIP_ERROR HandleDeviceEnergyManagementCancelRequest() override; + CHIP_ERROR + HandleModifyForecastRequest(const uint32_t forecastID, + const DataModel::DecodableList & slotAdjustments, + AdjustmentCauseEnum cause) override; + CHIP_ERROR RequestConstraintBasedForecast( + const DataModel::DecodableList & constraints, + AdjustmentCauseEnum cause) override; + +private: + OperationalStateEnum mState; + + Callback_fn_initiated mActionInitiated_CB; + Callback_fn_completed mActionCompleted_CB; + + // DEM Manufacturer Delegate + DeviceEnergyManagementManager * mDEMInstance; +}; + +DishwasherManager * GetDishwasherManager(); + +} // namespace DeviceEnergyManagement +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/examples/dishwasher-app/silabs/include/ElectricalEnergyMeasurementInstance.h b/examples/dishwasher-app/silabs/include/ElectricalEnergyMeasurementInstance.h new file mode 100644 index 0000000000..dba13b3a51 --- /dev/null +++ b/examples/dishwasher-app/silabs/include/ElectricalEnergyMeasurementInstance.h @@ -0,0 +1,75 @@ +/* + * + * 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 "AppConfig.h" +#include "AppEvent.h" +#include "ElectricalPowerMeasurementDelegate.h" +#include +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace ElectricalEnergyMeasurement { + +class ElectricalEnergyMeasurementInstance : public ElectricalEnergyMeasurementAttrAccess +{ +public: + static constexpr uint32_t kTimerPeriodms = 1000; // Timer period 1000 ms + static constexpr uint32_t kAttributeFrequency = + CUMULATIVE_REPORT_INTERVAL_SECONDS; // Number of seconds between reports for cumulative energy + + ElectricalEnergyMeasurementInstance(EndpointId aEndpointId, + ElectricalPowerMeasurement::ElectricalPowerMeasurementDelegate & aEPMDelegate, + BitMask aFeature, BitMask aOptionalAttrs) : + ElectricalEnergyMeasurementAttrAccess::ElectricalEnergyMeasurementAttrAccess(aFeature, aOptionalAttrs), + mEndpointId(aEndpointId) + { + mEPMDelegate = &aEPMDelegate; + } + + // Delete copy constructor and assignment operator + ElectricalEnergyMeasurementInstance(const ElectricalEnergyMeasurementInstance &) = delete; + ElectricalEnergyMeasurementInstance(const ElectricalEnergyMeasurementInstance &&) = delete; + ElectricalEnergyMeasurementInstance & operator=(const ElectricalEnergyMeasurementInstance &) = delete; + + CHIP_ERROR Init(); + void Shutdown(); + + ElectricalPowerMeasurement::ElectricalPowerMeasurementDelegate * GetEPMDelegate() { return mEPMDelegate; } + + void StartTimer(uint32_t aTimeoutMs); + void CancelTimer(); + +private: + ElectricalPowerMeasurement::ElectricalPowerMeasurementDelegate * mEPMDelegate; + EndpointId mEndpointId; + osTimerId_t mTimer; + + CHIP_ERROR InitTimer(); + + static void TimerEventHandler(void * timerCbArg); + static void UpdateEnergyAttributesAndNotify(AppEvent * aEvent); +}; + +} // namespace ElectricalEnergyMeasurement +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/examples/dishwasher-app/silabs/include/ElectricalSensorManager.h b/examples/dishwasher-app/silabs/include/ElectricalSensorManager.h new file mode 100644 index 0000000000..3d1cfd234a --- /dev/null +++ b/examples/dishwasher-app/silabs/include/ElectricalSensorManager.h @@ -0,0 +1,37 @@ +/* + * + * 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 + +class ElectricalSensorManager +{ + using OperationalStateEnum = chip::app::Clusters::OperationalState::OperationalStateEnum; + +public: + ~ElectricalSensorManager() { Shutdown(); } + + static ElectricalSensorManager & Instance(void) { return sElectricalSensor; } + + CHIP_ERROR Init(); + void Shutdown(); + + void UpdateEPMAttributes(OperationalStateEnum state); + +private: + static ElectricalSensorManager sElectricalSensor; +}; diff --git a/examples/dishwasher-app/silabs/include/PowerTopologyDelegateImpl.h b/examples/dishwasher-app/silabs/include/PowerTopologyDelegateImpl.h new file mode 100644 index 0000000000..c33729fc43 --- /dev/null +++ b/examples/dishwasher-app/silabs/include/PowerTopologyDelegateImpl.h @@ -0,0 +1,50 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace PowerTopology { + +class PowerTopologyDelegateImpl : public PowerTopologyDelegate +{ +public: + ~PowerTopologyDelegateImpl() = default; + + CHIP_ERROR GetAvailableEndpointAtIndex(size_t index, EndpointId & endpointId) override; + CHIP_ERROR GetActiveEndpointAtIndex(size_t index, EndpointId & endpointId) override; + + CHIP_ERROR AddActiveEndpoint(EndpointId endpointId); + CHIP_ERROR RemoveActiveEndpoint(EndpointId endpointId); + + void InitAvailableEndpointList(); + +private: + EndpointId mAvailableEndpointIdList[MAX_ENDPOINT_COUNT]; + EndpointId mActiveEndpointIdList[MAX_ENDPOINT_COUNT]; +}; + +} // namespace PowerTopology +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/examples/dishwasher-app/silabs/include/operational-state-delegate-impl.h b/examples/dishwasher-app/silabs/include/operational-state-delegate-impl.h new file mode 100644 index 0000000000..8b8d24e115 --- /dev/null +++ b/examples/dishwasher-app/silabs/include/operational-state-delegate-impl.h @@ -0,0 +1,90 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace OperationalState { + +// This is an application level delegate to handle operational state commands according to the specific business logic. +class OperationalStateDelegate : public Delegate +{ + +public: + /** + * Get the countdown time. This attribute is not used in this application. + * @return The current countdown time. + */ + DataModel::Nullable GetCountdownTime() override { return {}; } + + CHIP_ERROR GetOperationalStateAtIndex(size_t index, GenericOperationalState & operationalState) override; + CHIP_ERROR GetOperationalPhaseAtIndex(size_t index, MutableCharSpan & operationalPhase) override; + + void HandlePauseStateCallback(GenericOperationalError & err) override; + void HandleResumeStateCallback(GenericOperationalError & err) override; + void HandleStartStateCallback(GenericOperationalError & err) override; + void HandleStopStateCallback(GenericOperationalError & err) override; + + /** + * @brief Calls the MatterPostAttributeChangeCallback for the modified attribute on the operationalState instance + * + * @param attributeId Id of the attribute that changed + * @param type Type of the attribute + * @param size Size of the attribute data + * @param value Value of the attribute data + */ + + /** + * @brief Calls the MatterPostAttributeChangeCallback for the modified attribute on the operationalState instance + * + * @param attributeId Id of the attribute that changed + * @param type Type of the attribute + * @param size Size of the attribute data + * @param value Value of the attribute data + */ + void PostAttributeChangeCallback(AttributeId attributeId, uint8_t type, uint16_t size, uint8_t * value); + + void SetEndpointId(EndpointId endpointId); + +private: + const GenericOperationalState rvcOpStateList[4] = { + GenericOperationalState(to_underlying(OperationalStateEnum::kStopped)), + GenericOperationalState(to_underlying(OperationalStateEnum::kRunning)), + GenericOperationalState(to_underlying(OperationalStateEnum::kPaused)), + GenericOperationalState(to_underlying(OperationalStateEnum::kError)), + }; + + EndpointId mEndpointId; + + DataModel::List mOperationalStateList = Span(rvcOpStateList); + const Span mOperationalPhaseList; +}; + +OperationalState::Instance * GetInstance(); +OperationalState::OperationalStateDelegate * GetDelegate(); +void Shutdown(); + +} // namespace OperationalState +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/examples/dishwasher-app/silabs/openthread.gn b/examples/dishwasher-app/silabs/openthread.gn new file mode 100644 index 0000000000..b05216fc9d --- /dev/null +++ b/examples/dishwasher-app/silabs/openthread.gn @@ -0,0 +1,29 @@ +# 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" + chip_openthread_ftd = true + + import("//openthread.gni") +} diff --git a/examples/dishwasher-app/silabs/openthread.gni b/examples/dishwasher-app/silabs/openthread.gni new file mode 100644 index 0000000000..6794214248 --- /dev/null +++ b/examples/dishwasher-app/silabs/openthread.gni @@ -0,0 +1,28 @@ +# Copyright (c) 2020 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/chip.gni") +import("${chip_root}/config/standalone/args.gni") +import("${chip_root}/src/platform/silabs/efr32/args.gni") + +silabs_sdk_target = get_label_info(":sdk", "label_no_toolchain") + +app_data_model = + "${chip_root}/examples/dishwasher-app/silabs/data_model:silabs-dishwasher" +chip_enable_ota_requestor = true +chip_enable_openthread = true +sl_enable_test_event_trigger = true + +openthread_external_platform = + "${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" diff --git a/examples/dishwasher-app/silabs/src/AppTask.cpp b/examples/dishwasher-app/silabs/src/AppTask.cpp new file mode 100644 index 0000000000..948f1b590b --- /dev/null +++ b/examples/dishwasher-app/silabs/src/AppTask.cpp @@ -0,0 +1,237 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * Copyright (c) 2019 Google LLC. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "AppConfig.h" +#include "AppEvent.h" +#include "AppTask.h" +#include "DeviceEnergyManager.h" +#include "DishwasherManager.h" +#include "ElectricalSensorManager.h" +#include "operational-state-delegate-impl.h" + +#include +#include + +#define APP_FUNCTION_BUTTON 0 +#define APP_CONTROL_BUTTON 1 + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::OperationalState; +using namespace chip::app::Clusters::DeviceEnergyManagement; +using namespace chip::DeviceLayer; +using namespace chip::DeviceLayer::Silabs; +using namespace chip::TLV; + +AppTask AppTask::sAppTask; + +#if SL_MATTER_TEST_EVENT_TRIGGER_ENABLED +static EnergyReportingTestEventTriggerHandler sEnergyReportingTestEventTriggerHandler; +static DeviceEnergyManagementTestEventTriggerHandler sDeviceEnergyManagementTestEventTriggerHandler; +#endif + +CHIP_ERROR AppTask::Init() +{ + CHIP_ERROR err = CHIP_NO_ERROR; + chip::DeviceLayer::Silabs::GetPlatform().SetButtonsCb(AppTask::ButtonEventHandler); + +#ifdef DISPLAY_ENABLED + GetLCD().Init((uint8_t *) "Dishwasher-App"); +#endif + + err = BaseApplication::Init(); + if (err != CHIP_NO_ERROR) + { + SILABS_LOG("BaseApplication::Init() failed"); + appError(err); + } + + PlatformMgr().LockChipStack(); + err = DeviceEnergyManager::Instance().Init(); + PlatformMgr().UnlockChipStack(); + if (err != CHIP_NO_ERROR) + { + SILABS_LOG("DeviceEnergyMgr.Init() failed"); + appError(err); + } + + PlatformMgr().LockChipStack(); + err = ElectricalSensorManager::Instance().Init(); + PlatformMgr().UnlockChipStack(); + if (err != CHIP_NO_ERROR) + { + SILABS_LOG("ElectricalSensorMgr.Init() failed"); + appError(err); + } + +#if SL_MATTER_TEST_EVENT_TRIGGER_ENABLED + // Register DEM & Electrical Sensor Test Event Trigger + if (Server::GetInstance().GetTestEventTriggerDelegate() != nullptr) + { + Server::GetInstance().GetTestEventTriggerDelegate()->AddHandler(&sEnergyReportingTestEventTriggerHandler); + Server::GetInstance().GetTestEventTriggerDelegate()->AddHandler(&sDeviceEnergyManagementTestEventTriggerHandler); + } +#endif + + GetDishwasherManager()->SetCallbacks(ActionInitiated, ActionCompleted); + + // Set the initial state of the dishwasher + OperationalStateEnum state = static_cast(OperationalState::GetInstance()->GetCurrentOperationalState()); + GetDishwasherManager()->UpdateOperationState(state); + +// Update the LCD with the Stored value. Show QR Code if not provisioned +#ifdef DISPLAY_ENABLED + GetLCD().WriteDemoUI((GetDishwasherManager()->GetOperationalState() == OperationalStateEnum::kRunning)); +#ifdef QR_CODE_ENABLED +#ifdef SL_WIFI + if (!ConnectivityMgr().IsWiFiStationProvisioned()) +#else + if (!ConnectivityMgr().IsThreadProvisioned()) +#endif /* !SL_WIFI */ + { + GetLCD().ShowQRCode(true); + } +#endif // QR_CODE_ENABLED +#endif + + return err; +} + +CHIP_ERROR AppTask::StartAppTask() +{ + return BaseApplication::StartAppTask(AppTaskMain); +} + +void AppTask::AppTaskMain(void * pvParameter) +{ + AppEvent event; + osMessageQueueId_t sAppEventQueue = *(static_cast(pvParameter)); + + CHIP_ERROR err = sAppTask.Init(); + if (err != CHIP_NO_ERROR) + { + SILABS_LOG("AppTask.Init() failed"); + appError(err); + } + +#if !(defined(CHIP_CONFIG_ENABLE_ICD_SERVER) && CHIP_CONFIG_ENABLE_ICD_SERVER) + sAppTask.StartStatusLEDTimer(); +#endif + + SILABS_LOG("App Task started"); + + while (true) + { + osStatus_t eventReceived = osMessageQueueGet(sAppEventQueue, &event, NULL, osWaitForever); + while (eventReceived == osOK) + { + sAppTask.DispatchEvent(&event); + eventReceived = osMessageQueueGet(sAppEventQueue, &event, NULL, 0); + } + } +} + +void AppTask::DishwasherActionEventHandler(AppEvent * aEvent) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + if (aEvent->Type != AppEvent::kEventType_Button) + { + err = APP_ERROR_UNHANDLED_EVENT; + } + + if (CHIP_NO_ERROR == err) + { + GetDishwasherManager()->CycleOperationalState(); + } +} + +void AppTask::ButtonEventHandler(uint8_t button, uint8_t btnAction) +{ + AppEvent button_event = {}; + button_event.Type = AppEvent::kEventType_Button; + button_event.ButtonEvent.Action = btnAction; + + if ((button == APP_CONTROL_BUTTON) && (btnAction == static_cast(SilabsPlatform::ButtonAction::ButtonPressed))) + { + button_event.Handler = DishwasherActionEventHandler; + AppTask::GetAppTask().PostEvent(&button_event); + } + else if (button == APP_FUNCTION_BUTTON) + { + button_event.Handler = BaseApplication::ButtonHandler; + AppTask::GetAppTask().PostEvent(&button_event); + } +} + +void AppTask::ActionInitiated(OperationalStateEnum action) +{ + // Action initiated, update the dishwasher state led + if (action == OperationalStateEnum::kRunning) + { + SILABS_LOG("Starting dishwasher"); + } + else if (action == OperationalStateEnum::kStopped) + { + SILABS_LOG("Stoping dishwasher"); + } + else if (action == OperationalStateEnum::kPaused) + { + SILABS_LOG("Pausing dishwasher"); + } + else + { + SILABS_LOG("Action error"); + action = OperationalStateEnum::kError; + } + + PlatformMgr().LockChipStack(); + CHIP_ERROR err = Clusters::OperationalState::GetInstance()->SetOperationalState(to_underlying(action)); + PlatformMgr().UnlockChipStack(); + if (err != CHIP_NO_ERROR) + { + SILABS_LOG("ERR: updating Operational state %x", err); + } + else + { + GetDishwasherManager()->UpdateOperationState(action); + ElectricalSensorManager::Instance().UpdateEPMAttributes(action); + } +} + +void AppTask::ActionCompleted() +{ +#ifdef DISPLAY_ENABLED + sAppTask.GetLCD().WriteDemoUI((GetDishwasherManager()->GetOperationalState() == OperationalStateEnum::kRunning)); +#endif +} diff --git a/examples/dishwasher-app/silabs/src/DataModelHelper.cpp b/examples/dishwasher-app/silabs/src/DataModelHelper.cpp new file mode 100644 index 0000000000..477699f17f --- /dev/null +++ b/examples/dishwasher-app/silabs/src/DataModelHelper.cpp @@ -0,0 +1,42 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include "DataModelHelper.h" + +using namespace chip; + +EndpointId DataModelHelper::GetEndpointIdFromCluster(ClusterId clusterId) +{ + for (uint16_t index = 0; index < emberAfEndpointCount(); index++) + { + if (emberAfEndpointIndexIsEnabled(index)) + { + EndpointId endpointId = emberAfEndpointFromIndex(index); + + if (emberAfContainsServer(endpointId, clusterId)) + { + return endpointId; + } + } + } + + return kInvalidEndpointId; +} diff --git a/examples/dishwasher-app/silabs/src/DeviceEnergyManager.cpp b/examples/dishwasher-app/silabs/src/DeviceEnergyManager.cpp new file mode 100644 index 0000000000..db7bdf853a --- /dev/null +++ b/examples/dishwasher-app/silabs/src/DeviceEnergyManager.cpp @@ -0,0 +1,167 @@ +/* + * + * 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 "AppConfig.h" +#include "AppTask.h" + +#include "DataModelHelper.h" +#include "DeviceEnergyManagementDelegateImpl.h" +#include "DeviceEnergyManager.h" +#include "DishwasherManager.h" +#include "EnergyTimeUtils.h" + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::DeviceEnergyManagement; + +DeviceEnergyManager DeviceEnergyManager::sDeviceEnergy; + +namespace { +std::unique_ptr gDEMDelegate; +std::unique_ptr gDEMInstance; +std::unique_ptr gDishwasherManager; +} // namespace + +DeviceEnergyManagement::DeviceEnergyManagementDelegate * GetDEMDelegate() +{ + VerifyOrDieWithMsg(gDEMDelegate.get() != nullptr, AppServer, "DEM Delegate is null"); + return gDEMDelegate.get(); +} + +DishwasherManager * DeviceEnergyManagement::GetDishwasherManager() +{ + VerifyOrDieWithMsg(gDEMDelegate.get() != nullptr, AppServer, "Dishwasher Manager is null"); + return gDishwasherManager.get(); +} + +/* + * @brief Creates a Delegate and Instance for DEM + * + * The Instance is a container around the Delegate, so + * create the Delegate first, then wrap it in the Instance + * Then call the Instance->Init() to register the attribute and command handlers + */ +CHIP_ERROR DeviceEnergyManagementInit() +{ + EndpointId DEMEndpointId = DataModelHelper::GetEndpointIdFromCluster(DeviceEnergyManagement::Id); + CHIP_ERROR err; + + VerifyOrReturnError((DEMEndpointId != kInvalidEndpointId), CHIP_ERROR_INCORRECT_STATE, + ChipLogError(AppServer, "DEM Cluster not configured")); + + // Initialize DEM (Device Energy Management) and DEMManufacturer (Device Energy Management Manufacturer) + VerifyOrReturnError(!gDEMDelegate && !gDEMInstance, CHIP_ERROR_INCORRECT_STATE, + ChipLogError(AppServer, "DEM Delegate or Instance already exist")); + + gDEMDelegate = std::make_unique(); + VerifyOrReturnError(gDEMDelegate, CHIP_ERROR_NO_MEMORY, ChipLogError(AppServer, "Failed to allocate memory for DEM Delegate")); + + // Manufacturer may optionally not support all features, commands & attributes + // DeviceEnergyManagement::Feature::kStateForecastReporting is removed from the specification [!PA].a,(STA|PAU|FA|CON),O + static uint32_t featureMap = static_cast(DeviceEnergyManagement::Feature::kPowerForecastReporting) + + static_cast(DeviceEnergyManagement::Feature::kStartTimeAdjustment) + + static_cast(DeviceEnergyManagement::Feature::kPausable); + BitMask fmap(featureMap); + + gDEMInstance = std::make_unique(DEMEndpointId, *gDEMDelegate, fmap); + + VerifyOrReturnError(gDEMInstance, CHIP_ERROR_NO_MEMORY, ChipLogError(AppServer, "Failed to allocate memory for DEM Instance"); + gDEMDelegate.reset()); + + gDEMDelegate->SetDeviceEnergyManagementInstance(*gDEMInstance); + + // Register Attribute & Command handlers + err = gDEMInstance->Init(); + VerifyOrReturnError(CHIP_NO_ERROR == err, err, ChipLogError(AppServer, "Init failed on gDEMInstance"); gDEMInstance.reset(); + gDEMDelegate.reset()); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR DeviceEnergyManagementShutdown() +{ + /* Do this in the order Instance first, then delegate + * Ensure we call the Instance->Shutdown to free attribute & command handlers first + */ + if (gDEMInstance) + { + /* deregister attribute & command handlers */ + gDEMInstance->Shutdown(); + gDEMInstance.reset(); + } + if (gDEMDelegate) + { + gDEMDelegate.reset(); + } + return CHIP_NO_ERROR; +} + +CHIP_ERROR DeviceEnergyManager::Init() +{ + CHIP_ERROR err; + + err = DeviceEnergyManagementInit(); + VerifyOrReturnError(CHIP_NO_ERROR == err, err, ChipLogError(AppServer, "DEM Init failed"); DeviceEnergyManagementShutdown();); + + // DEM Manufacturer + VerifyOrReturnError(!gDishwasherManager, CHIP_ERROR_INCORRECT_STATE, + ChipLogError(AppServer, "Dishwasher manager already initialized");); + + gDishwasherManager = std::make_unique(gDEMInstance.get()); + VerifyOrReturnError(gDishwasherManager, CHIP_ERROR_NO_MEMORY, + ChipLogError(AppServer, "Failed to allocate memory for DEM ManufacturerDelegate")); + + err = gDishwasherManager->Init(); + VerifyOrReturnError(CHIP_NO_ERROR == err, err, ChipLogError(AppServer, "Init failed on gDishwasherManager")); + + gDEMDelegate->SetDEMManufacturerDelegate(*gDishwasherManager.get()); + + return CHIP_NO_ERROR; +} + +void DeviceEnergyManager::Shutdown() +{ + /* Do this in the order Instance first, then delegate + * Ensure we call the Instance->Shutdown to free attribute & command handlers first + */ + + // Shutdown DEM + if (gDEMInstance) + { + // Deregister attribute & command handlers + gDEMInstance->Shutdown(); + gDEMInstance.reset(); + } + + if (gDEMDelegate) + { + gDEMDelegate.reset(); + } + + // Shutdown DEMManufacturer + if (gDishwasherManager) + { + gDishwasherManager.reset(); + } +} + +DeviceEnergyManagementDelegate * DeviceEnergyManager::GetDEMDelegate() +{ + return gDEMDelegate.get(); +}; diff --git a/examples/dishwasher-app/silabs/src/DishwasherManager.cpp b/examples/dishwasher-app/silabs/src/DishwasherManager.cpp new file mode 100644 index 0000000000..01f30e70f5 --- /dev/null +++ b/examples/dishwasher-app/silabs/src/DishwasherManager.cpp @@ -0,0 +1,209 @@ +/* + * + * 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 "LEDWidget.h" + +#include "AppConfig.h" +#include "AppTask.h" +#include "DishwasherManager.h" +#include "operational-state-delegate-impl.h" + +#ifdef SL_CATALOG_SIMPLE_LED_LED1_PRESENT +#define DW_STATE_LED 1 +#else +#define DW_STATE_LED 0 +#endif + +namespace { +LEDWidget sDishwasherLED; +} + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::OperationalState; +using namespace chip::app::Clusters::DeviceEnergyManagement; +using namespace chip::DeviceLayer; + +CHIP_ERROR DishwasherManager::Init() +{ + sDishwasherLED.Init(DW_STATE_LED); + AppTask::GetAppTask().LinkAppLed(&sDishwasherLED); + + chip::app::Clusters::DeviceEnergyManagement::DeviceEnergyManagementDelegate * dem = GetDEMDelegate(); + VerifyOrReturnLogError(dem != nullptr, CHIP_ERROR_UNINITIALIZED); + + /* For Device Energy Management we need the ESA to be Online and ready to accept commands */ + dem->SetESAState(ESAStateEnum::kOnline); + dem->SetESAType(ESATypeEnum::kDishwasher); + + // Set the abs min and max power + dem->SetAbsMinPower(1200000); // 1.2KW + dem->SetAbsMaxPower(7600000); // 7.6KW + + return CHIP_NO_ERROR; +} + +OperationalStateEnum DishwasherManager::GetOperationalState() +{ + return mState; +} + +void DishwasherManager::UpdateDishwasherLed() +{ + OperationalStateEnum opState = GetOperationalState(); + sDishwasherLED.Set(false); + + switch (opState) + { + case OperationalStateEnum::kRunning: + sDishwasherLED.Set(true); + break; + case OperationalStateEnum::kPaused: + sDishwasherLED.Blink(300, 700); + break; + case OperationalStateEnum::kError: + sDishwasherLED.Blink(100); + break; + default: + break; + } +} + +void DishwasherManager::SetCallbacks(Callback_fn_initiated aActionInitiated_CB, Callback_fn_completed aActionCompleted_CB) +{ + mActionInitiated_CB = aActionInitiated_CB; + mActionCompleted_CB = aActionCompleted_CB; +} + +void DishwasherManager::CycleOperationalState() +{ + if (mActionInitiated_CB) + { + OperationalStateEnum action; + switch (mState) + { + case OperationalStateEnum::kRunning: + action = OperationalStateEnum::kPaused; + break; + case OperationalStateEnum::kPaused: + action = OperationalStateEnum::kStopped; + break; + case OperationalStateEnum::kStopped: + action = OperationalStateEnum::kRunning; + break; + case OperationalStateEnum::kError: + action = OperationalStateEnum::kStopped; + break; + default: + break; + } + mActionInitiated_CB(action); + } +} + +void DishwasherManager::UpdateOperationState(OperationalStateEnum state) +{ + mState = state; + UpdateDishwasherLed(); + + if (mActionCompleted_CB) + { + mActionCompleted_CB(); + } +} + +int64_t DishwasherManager::GetApproxEnergyDuringSession() +{ + return kApproximateEnergyUsedByESA; +}; + +CHIP_ERROR DishwasherManager::HandleDeviceEnergyManagementPowerAdjustRequest(const int64_t powerMw, const uint32_t durationS, + AdjustmentCauseEnum cause) +{ + // Currently not implemented by our dishwasher app + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +CHIP_ERROR DishwasherManager::HandleDeviceEnergyManagementPowerAdjustCompletion() +{ + // Currently not implemented by our dishwasher app + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +CHIP_ERROR DishwasherManager::HandleDeviceEnergyManagementCancelPowerAdjustRequest(CauseEnum cause) +{ + // Currently not implemented by our dishwasher app + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +// kNoOptOut = 0x00, +// kLocalOptOut = 0x01, +// kGridOptOut = 0x02, +// kOptOut = 0x03, +CHIP_ERROR DishwasherManager::HandleDeviceEnergyManagementStartTimeAdjustRequest(const uint32_t requestedStartTimeUtc, + AdjustmentCauseEnum cause) +{ + AppEvent event; + event.Type = AppEvent::kEventType_Timer; + event.Handler = nullptr; + AppTask::GetAppTask().PostEvent(&event); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR DishwasherManager::HandleDeviceEnergyManagementPauseRequest(const uint32_t durationS, AdjustmentCauseEnum cause) +{ + mActionInitiated_CB(OperationalStateEnum::kPaused); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR DishwasherManager::HandleDeviceEnergyManagementPauseCompletion() +{ + mActionInitiated_CB(OperationalStateEnum::kRunning); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DishwasherManager::HandleDeviceEnergyManagementCancelPauseRequest(CauseEnum cause) +{ + mActionInitiated_CB(OperationalStateEnum::kRunning); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DishwasherManager::HandleDeviceEnergyManagementCancelRequest() +{ + mActionInitiated_CB(OperationalStateEnum::kStopped); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DishwasherManager::HandleModifyForecastRequest( + const uint32_t forecastId, const DataModel::DecodableList & slotAdjustments, + AdjustmentCauseEnum cause) +{ + // Currently not implemented by our dishwasher app + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +CHIP_ERROR DishwasherManager::RequestConstraintBasedForecast( + const DataModel::DecodableList & constraints, + AdjustmentCauseEnum cause) +{ + // Currently not implemented by our dishwasher app + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} diff --git a/examples/dishwasher-app/silabs/src/ElectricalEnergyMeasurementInstance.cpp b/examples/dishwasher-app/silabs/src/ElectricalEnergyMeasurementInstance.cpp new file mode 100644 index 0000000000..2d48dd821d --- /dev/null +++ b/examples/dishwasher-app/silabs/src/ElectricalEnergyMeasurementInstance.cpp @@ -0,0 +1,193 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "AppConfig.h" +#include "AppTask.h" +#include "ElectricalEnergyMeasurementInstance.h" +#include "EnergyTimeUtils.h" + +#define mWms_TO_mWh(power) ((power) / 3600'000) + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::DeviceEnergyManagement; +using namespace chip::app::Clusters::ElectricalEnergyMeasurement; +using namespace chip::app::Clusters::ElectricalEnergyMeasurement::Attributes; +using namespace chip::app::Clusters::ElectricalEnergyMeasurement::Structs; +using namespace chip::app::DataModel; + +// Example of setting CumulativeEnergyReset structure - for now set these to 0 +// but the manufacturer may want to store these in non volatile storage for timestamp (based on epoch_s) +// Create an accuracy entry which is between +/-0.5 and +/- 5% across the range of all possible energy readings +static const MeasurementAccuracyRangeStruct::Type kEnergyAccuracyRanges[] = { + { .rangeMin = 0, + .rangeMax = 1'000'000'000'000'000, // 1 million Mwh + .percentMax = MakeOptional(static_cast(500)), + .percentMin = MakeOptional(static_cast(50)) } +}; + +static const MeasurementAccuracyStruct::Type kAccuracy = { + .measurementType = MeasurementTypeEnum::kElectricalEnergy, + .measured = false, // this should be made true in an implementation where a real metering device is used. + .minMeasuredValue = 0, + .maxMeasuredValue = 1'000'000'000'000'000, // 1 million Mwh + .accuracyRanges = List(kEnergyAccuracyRanges) +}; + +static const CumulativeEnergyResetStruct::Type kResetStruct = { + .importedResetTimestamp = MakeOptional(MakeNullable(static_cast(0))), + .exportedResetTimestamp = MakeOptional(MakeNullable(static_cast(0))), + .importedResetSystime = MakeOptional(MakeNullable(static_cast(0))), + .exportedResetSystime = MakeOptional(MakeNullable(static_cast(0))), +}; + +static EnergyMeasurementStruct::Type sCumulativeImported = { + .energy = static_cast(0), +}; + +static const EnergyMeasurementStruct::Type sCumulativeExported = { + .energy = static_cast(0), +}; + +namespace { +ElectricalPowerMeasurement::ElectricalPowerMeasurementDelegate * gEPMDelegate; +EndpointId gEndpointId; +int64_t sCumulativeActivePower = 0; +uint8_t sSecondsSinceUpdate = 0; +} // namespace + +CHIP_ERROR ElectricalEnergyMeasurementInstance::Init() +{ + // Initialize attributes + SetMeasurementAccuracy(mEndpointId, kAccuracy); + SetCumulativeReset(mEndpointId, MakeOptional(kResetStruct)); + + // Assign class attributes to instantiated global variables + // for the access to TimerEventHandler + gEPMDelegate = GetEPMDelegate(); + gEndpointId = mEndpointId; + + CHIP_ERROR err; + + uint32_t currentTimestamp; + ReturnErrorOnFailure(GetEpochTS(currentTimestamp)); + + sCumulativeImported.startTimestamp.SetValue(currentTimestamp); + sCumulativeImported.startSystime.SetValue(System::SystemClock().GetMonotonicTimestamp().count()); + + // Initialize and start timer to calculate cumulative energy + err = InitTimer(); + VerifyOrReturnError(CHIP_NO_ERROR == err, err, ChipLogError(AppServer, "Init failed on EEM Timer")); + + StartTimer(kTimerPeriodms); + + return ElectricalEnergyMeasurementAttrAccess::Init(); +} + +void ElectricalEnergyMeasurementInstance::Shutdown() +{ + CancelTimer(); + ElectricalEnergyMeasurementAttrAccess::Shutdown(); +} + +CHIP_ERROR ElectricalEnergyMeasurementInstance::InitTimer() +{ + // Create cmsis os sw timer for EEM Cumulative timer + mTimer = osTimerNew(TimerEventHandler, // Timer callback handler + osTimerPeriodic, // Timer reload + (void *) this, // Pass the app task obj context + NULL // No osTimerAttr_t to provide. + ); + + VerifyOrReturnError(mTimer != NULL, APP_ERROR_CREATE_TIMER_FAILED, SILABS_LOG("Timer create failed")); + + return CHIP_NO_ERROR; +} + +void ElectricalEnergyMeasurementInstance::StartTimer(uint32_t aTimeoutMs) +{ + // Start or restart the function timer + if (osTimerStart(mTimer, pdMS_TO_TICKS(aTimeoutMs)) != osOK) + { + SILABS_LOG("Timer start failed"); + appError(APP_ERROR_START_TIMER_FAILED); + } +} + +void ElectricalEnergyMeasurementInstance::CancelTimer() +{ + if (osTimerStop(mTimer) == osError) + { + SILABS_LOG("Timer stop failed"); + appError(APP_ERROR_STOP_TIMER_FAILED); + } +} + +void ElectricalEnergyMeasurementInstance::TimerEventHandler(void * timerCbArg) +{ + // Get different EPM Active Power values according to operational mode change + Nullable EPMActivePower = gEPMDelegate ? gEPMDelegate->GetActivePower() : Nullable(0); + int64_t activePower = (EPMActivePower.IsNull()) ? 0 : EPMActivePower.Value(); + + // Calculate cumulative imported active power + sCumulativeActivePower += activePower; + sSecondsSinceUpdate += 1; + + if (sSecondsSinceUpdate >= ElectricalEnergyMeasurementInstance::kAttributeFrequency) + { + sSecondsSinceUpdate = 0; + + AppEvent event; + event.Type = AppEvent::kEventType_Timer; + event.Handler = UpdateEnergyAttributesAndNotify; + AppTask::GetAppTask().PostEvent(&event); + } +} + +void ElectricalEnergyMeasurementInstance::UpdateEnergyAttributesAndNotify(AppEvent * aEvent) +{ + // cumulativeImported update code - To update energy (mWs to mWh), startSystime and endSystime + // Convert the unit : mW * ms -> mWh + sCumulativeImported.energy = mWms_TO_mWh(sCumulativeActivePower * kTimerPeriodms); + + uint32_t currentTimestamp; + if (GetEpochTS(currentTimestamp) == CHIP_NO_ERROR) + { + // Use EpochTS + sCumulativeImported.endTimestamp.SetValue(currentTimestamp); + } + + sCumulativeImported.endSystime.SetValue(System::SystemClock().GetMonotonicTimestamp().count()); + + // Call the SDK to update attributes and generate an event + chip::DeviceLayer::PlatformMgr().LockChipStack(); + NotifyCumulativeEnergyMeasured(gEndpointId, MakeOptional(sCumulativeImported), MakeOptional(sCumulativeExported)); + MatterReportingAttributeChangeCallback(gEndpointId, ElectricalEnergyMeasurement::Id, CumulativeEnergyImported::Id); + chip::DeviceLayer::PlatformMgr().UnlockChipStack(); +} diff --git a/examples/dishwasher-app/silabs/src/ElectricalSensorManager.cpp b/examples/dishwasher-app/silabs/src/ElectricalSensorManager.cpp new file mode 100644 index 0000000000..c751c71c26 --- /dev/null +++ b/examples/dishwasher-app/silabs/src/ElectricalSensorManager.cpp @@ -0,0 +1,215 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include +#include + +#include "AppConfig.h" +#include "AppTask.h" +#include "DataModelHelper.h" +#include "DishwasherManager.h" +#include "ElectricalEnergyMeasurementInstance.h" +#include "ElectricalSensorManager.h" +#include "EnergyTimeUtils.h" +#include "PowerTopologyDelegate.h" +#include + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::ElectricalEnergyMeasurement; +using namespace chip::app::Clusters::ElectricalEnergyMeasurement::Structs; +using namespace chip::app::Clusters::ElectricalPowerMeasurement; +using namespace chip::app::Clusters::DeviceEnergyManagement; +using namespace chip::app::Clusters::OperationalState; +using namespace chip::app::Clusters::PowerTopology; +using namespace chip::app::DataModel; + +ElectricalSensorManager ElectricalSensorManager::sElectricalSensor; + +static std::unique_ptr gEEMInstance; +static std::unique_ptr gEPMDelegate; +static std::unique_ptr gEPMInstance; +static std::unique_ptr gPTDelegate; +static std::unique_ptr gPTInstance; + +static const struct +{ + PowerModeEnum PowerMode; + int64_t Voltage; // mV + int64_t ActiveCurrent; // mA + int64_t ActivePower; // mW + int64_t Frequency; // Hz +} kAttributes[4] = { + { PowerModeEnum::kAc, 120'000, 0, 0, 60 }, // kStopped + { PowerModeEnum::kAc, 120'000, 15'000, 1800'000, 60 }, // kRunning + { PowerModeEnum::kAc, 120'000, 125, 17'000, 60 }, // kPaused + { PowerModeEnum::kUnknown, 0, 0, 0, 0 } // kError +}; + +/* + * @brief Creates a Delegate and Instance for Electrical Power/Energy Measurement and Power Topology clusters + * + * The Instance is a container around the Delegate, so + * create the Delegate first, then wrap it in the Instance + * Then call the Instance->Init() to register the attribute and command handlers + */ +CHIP_ERROR ElectricalSensorManager::Init() +{ + EndpointId EPMEndpointId = DataModelHelper::GetEndpointIdFromCluster(ElectricalPowerMeasurement::Id); + EndpointId EEMEndpointId = DataModelHelper::GetEndpointIdFromCluster(ElectricalEnergyMeasurement::Id); + EndpointId PTEndpointId = DataModelHelper::GetEndpointIdFromCluster(PowerTopology::Id); + CHIP_ERROR err; + + VerifyOrReturnError((EPMEndpointId != kInvalidEndpointId) && (EEMEndpointId != kInvalidEndpointId) && + (PTEndpointId != kInvalidEndpointId), + CHIP_ERROR_INCORRECT_STATE, ChipLogError(AppServer, "EPM, EEM or PT Cluster not configured")); + + // Initialize EPM (Electrical Power Management) + VerifyOrReturnError(!gEPMDelegate && !gEPMInstance, CHIP_ERROR_INCORRECT_STATE, + ChipLogError(AppServer, "EPM Delegate or Instance already exist")); + + gEPMDelegate = std::make_unique(); + VerifyOrReturnError(gEPMDelegate, CHIP_ERROR_NO_MEMORY, ChipLogError(AppServer, "Failed to allocate memory for EPM Delegate")); + + /* Manufacturer may optionally not support all features, commands & attributes */ + /* Turning on all optional features and attributes for test certification purposes */ + gEPMInstance = std::make_unique( + EPMEndpointId, *gEPMDelegate, + BitMask(ElectricalPowerMeasurement::Feature::kDirectCurrent, + ElectricalPowerMeasurement::Feature::kAlternatingCurrent), + BitMask( + ElectricalPowerMeasurement::OptionalAttributes::kOptionalAttributeVoltage, + ElectricalPowerMeasurement::OptionalAttributes::kOptionalAttributeActiveCurrent)); + + VerifyOrReturnError(gEPMInstance, CHIP_ERROR_NO_MEMORY, ChipLogError(AppServer, "Failed to allocate memory for EPM Instance"); + gEPMDelegate.reset()); + + // Register Attribute & Command handlers + err = gEPMInstance->Init(); + VerifyOrReturnError(CHIP_NO_ERROR == err, err, ChipLogError(AppServer, "Init failed on gEPMInstance"); gEPMInstance.reset(); + gEPMDelegate.reset()); + + // Initialize EPM attributes + OperationalStateEnum state = GetDishwasherManager()->GetOperationalState(); + UpdateEPMAttributes(state); + + // Initialize EEM (Electrical Energy Management) + VerifyOrReturnError(!gEEMInstance, CHIP_ERROR_INCORRECT_STATE, ChipLogError(AppServer, "EEM Instance already exist")); + + gEEMInstance = std::make_unique( + EEMEndpointId, *gEPMDelegate, + BitMask(ElectricalEnergyMeasurement::Feature::kImportedEnergy, + ElectricalEnergyMeasurement::Feature::kCumulativeEnergy), + BitMask( + ElectricalEnergyMeasurement::OptionalAttributes::kOptionalAttributeCumulativeEnergyReset)); + + VerifyOrReturnError(gEEMInstance, CHIP_ERROR_NO_MEMORY, ChipLogError(AppServer, "Failed to allocate memory for EEM Instance")); + + // Register Attribute & Command handlers + err = gEEMInstance->Init(); + VerifyOrReturnError(CHIP_NO_ERROR == err, err, ChipLogError(AppServer, "Init failed on gEEMInstance"); gPTInstance.reset()); + + // Initialize PT (Power Topology) + VerifyOrReturnError(!gPTDelegate && !gPTInstance, CHIP_ERROR_INCORRECT_STATE, + ChipLogError(AppServer, "PowerTopology Delegate or Instance already exist")); + + gPTDelegate = std::make_unique(); + VerifyOrReturnError(gPTDelegate, CHIP_ERROR_NO_MEMORY, ChipLogError(AppServer, "Failed to allocate memory for PT Delegate")); + + gPTInstance = std::make_unique( + PTEndpointId, *gPTDelegate, BitMask(PowerTopology::Feature::kNodeTopology), + BitMask()); + + VerifyOrReturnError(gPTInstance, CHIP_ERROR_NO_MEMORY, ChipLogError(AppServer, "Failed to allocate memory for PT Instance"); + gPTDelegate.reset()); + + // Register Attribute & Command handlers + err = gPTInstance->Init(); + VerifyOrReturnError(CHIP_NO_ERROR == err, err, ChipLogError(AppServer, "Init failed on gPTInstance"); gPTInstance.reset(); + gPTDelegate.reset();); + + return CHIP_NO_ERROR; +} + +void ElectricalSensorManager::Shutdown() +{ + /* Do this in the order Instance first, then delegate + * Ensure we call the Instance->Shutdown to free attribute & command handlers first + */ + + // Shutdown PT (Power Topology) + if (gPTInstance) + { + // Deregister attribute & command handlers + gPTInstance->Shutdown(); + gPTInstance.reset(); + } + + if (gPTDelegate) + { + gPTDelegate.reset(); + } + + // Shutdown EEM (Electrical Energy Management) + if (gEEMInstance) + { + // Deregister attribute & command handlers + gEEMInstance->Shutdown(); + gEEMInstance.reset(); + } + + // Shutdown EPM (Electrical Power Management) + if (gEPMInstance) + { + // Deregister attribute & command handlers + gEPMInstance->Shutdown(); + gEPMInstance.reset(); + } + + if (gEPMDelegate) + { + gEPMDelegate.reset(); + } +} + +void ElectricalSensorManager::UpdateEPMAttributes(OperationalStateEnum state) +{ + if (gEPMDelegate) + { + uint16_t updateState = to_underlying(state); + uint16_t ERROR_STATE_INDEX = ArraySize(kAttributes) - 1; + // Check state range + if ((updateState < 0) || (updateState > ERROR_STATE_INDEX)) + { + updateState = ERROR_STATE_INDEX; + } + + ChipLogDetail(AppServer, "UpdateAllAttributes to Operational State : %d", updateState); + + // Added to support testing using a static array for now + gEPMDelegate->SetPowerMode(kAttributes[updateState].PowerMode); + gEPMDelegate->SetVoltage(MakeNullable(kAttributes[updateState].Voltage)); + gEPMDelegate->SetActiveCurrent(MakeNullable(kAttributes[updateState].ActiveCurrent)); + gEPMDelegate->SetActivePower(MakeNullable(kAttributes[updateState].ActivePower)); + } +} diff --git a/examples/dishwasher-app/silabs/src/PowerTopologyDelegateImpl.cpp b/examples/dishwasher-app/silabs/src/PowerTopologyDelegateImpl.cpp new file mode 100644 index 0000000000..7e3a68a707 --- /dev/null +++ b/examples/dishwasher-app/silabs/src/PowerTopologyDelegateImpl.cpp @@ -0,0 +1,101 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include + +#include "PowerTopologyDelegateImpl.h" + +using namespace chip; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::PowerTopology; + +CHIP_ERROR PowerTopologyDelegateImpl::GetAvailableEndpointAtIndex(size_t index, EndpointId & endpointId) +{ + VerifyOrReturnError(index < ArraySize(mAvailableEndpointIdList), CHIP_ERROR_PROVIDER_LIST_EXHAUSTED); + + endpointId = mAvailableEndpointIdList[index]; + + return (endpointId == kInvalidEndpointId) ? CHIP_ERROR_INVALID_ARGUMENT : CHIP_NO_ERROR; +} + +CHIP_ERROR PowerTopologyDelegateImpl::GetActiveEndpointAtIndex(size_t index, EndpointId & endpointId) +{ + VerifyOrReturnError(index < ArraySize(mActiveEndpointIdList), CHIP_ERROR_PROVIDER_LIST_EXHAUSTED); + + endpointId = mActiveEndpointIdList[index]; + + return (endpointId == kInvalidEndpointId) ? CHIP_ERROR_INVALID_ARGUMENT : CHIP_NO_ERROR; +} + +CHIP_ERROR PowerTopologyDelegateImpl::AddActiveEndpoint(EndpointId endpointId) +{ + bool AvailableEndpointFlag = false; + bool ActiveEndpointFlag = false; + uint16_t availableIndexToAdd = MAX_ENDPOINT_COUNT; + + for (uint16_t index = 0; index < MAX_ENDPOINT_COUNT; index++) + { + if (mAvailableEndpointIdList[index] == endpointId) + { + AvailableEndpointFlag = true; + } + if (mActiveEndpointIdList[index] == endpointId) + { + ActiveEndpointFlag = true; + } + if (mActiveEndpointIdList[index] == kInvalidEndpointId) + { + availableIndexToAdd = index; + } + } + + // Availability and duplication check + VerifyOrReturnError(AvailableEndpointFlag && !ActiveEndpointFlag && (availableIndexToAdd != MAX_ENDPOINT_COUNT), + CHIP_ERROR_INVALID_ARGUMENT); + + mActiveEndpointIdList[availableIndexToAdd] = endpointId; + + return CHIP_NO_ERROR; +} + +CHIP_ERROR PowerTopologyDelegateImpl::RemoveActiveEndpoint(EndpointId endpointId) +{ + for (uint16_t index = 0; index < MAX_ENDPOINT_COUNT; index++) + { + if (mActiveEndpointIdList[index] == endpointId) + { + mActiveEndpointIdList[index] = kInvalidEndpointId; + return CHIP_NO_ERROR; + } + } + + return CHIP_ERROR_INVALID_ARGUMENT; +} + +void PowerTopologyDelegateImpl::InitAvailableEndpointList() +{ + for (uint16_t index = 0; index < MAX_ENDPOINT_COUNT; index++) + { + mAvailableEndpointIdList[index] = + (emberAfEndpointIndexIsEnabled(index)) ? emberAfEndpointFromIndex(index) : kInvalidEndpointId; + + mActiveEndpointIdList[index] = kInvalidEndpointId; + } +} diff --git a/examples/dishwasher-app/silabs/src/ZclCallbacks.cpp b/examples/dishwasher-app/silabs/src/ZclCallbacks.cpp new file mode 100644 index 0000000000..cc972c6454 --- /dev/null +++ b/examples/dishwasher-app/silabs/src/ZclCallbacks.cpp @@ -0,0 +1,56 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * This file implements the handler for data model messages. + */ +#include +#include +#include +#include + +#include "AppConfig.h" +#include "DishwasherManager.h" +#include "ElectricalSensorManager.h" + +#ifdef DIC_ENABLE +#include "dic.h" +#endif // DIC_ENABLE + +using namespace chip; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::DeviceEnergyManagement; + +void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & attributePath, uint8_t type, uint16_t size, + uint8_t * value) +{ + ClusterId clusterId = attributePath.mClusterId; + AttributeId attributeId = attributePath.mAttributeId; + ChipLogProgress(Zcl, "Cluster callback: " ChipLogFormatMEI, ChipLogValueMEI(clusterId)); + + if ((clusterId == OperationalState::Id) && (attributeId == OperationalState::Attributes::OperationalState::Id)) + { + GetDishwasherManager()->UpdateOperationState(static_cast(*value)); + ElectricalSensorManager::Instance().UpdateEPMAttributes(static_cast(*value)); + } + else if (clusterId == Identify::Id) + { + ChipLogProgress(Zcl, "Identify attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u", + ChipLogValueMEI(attributeId), type, *value, size); + } +} diff --git a/examples/dishwasher-app/silabs/src/operational-state-delegate-impl.cpp b/examples/dishwasher-app/silabs/src/operational-state-delegate-impl.cpp new file mode 100644 index 0000000000..df4e9e7ae8 --- /dev/null +++ b/examples/dishwasher-app/silabs/src/operational-state-delegate-impl.cpp @@ -0,0 +1,217 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include +#include + +#include "DataModelHelper.h" +#include "EnergyTimeUtils.h" +#include "operational-state-delegate-impl.h" + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::OperationalState; + +static std::unique_ptr gOperationalStateDelegate; +static std::unique_ptr gOperationalStateInstance; + +/** + * Get the list of supported operational states. + * Fills in the provided GenericOperationalState with the state at `index` if there is one, + * or returns CHIP_ERROR_NOT_FOUND if the index is out of range for the list of states. + * @param index The index of the state, with 0 representing the first state. + * @param operationalState The GenericOperationalState is filled. + */ +CHIP_ERROR OperationalStateDelegate::GetOperationalStateAtIndex(size_t index, GenericOperationalState & operationalState) +{ + VerifyOrReturnError(index < mOperationalStateList.size(), CHIP_ERROR_NOT_FOUND); + + operationalState = mOperationalStateList[index]; + + return CHIP_NO_ERROR; +} + +/** + * Get the list of supported operational phases. + * Fills in the provided MutableCharSpan with the phase at index `index` if there is one, + * or returns CHIP_ERROR_NOT_FOUND if the index is out of range for the list of phases. + * + * If CHIP_ERROR_NOT_FOUND is returned for index 0, that indicates that the PhaseList attribute is null + * (there are no phases defined at all). + * + * @param index The index of the phase, with 0 representing the first phase. + * @param operationalPhase The MutableCharSpan is filled. + */ +CHIP_ERROR OperationalStateDelegate::GetOperationalPhaseAtIndex(size_t index, MutableCharSpan & operationalPhase) +{ + VerifyOrReturnError(index < mOperationalPhaseList.size(), CHIP_ERROR_NOT_FOUND); + + return CopyCharSpanToMutableCharSpan(mOperationalPhaseList[index], operationalPhase); +} + +/** + * Handle Command Callback in application: Pause + * @param[out] get Operational error after callback + */ +void OperationalStateDelegate::HandlePauseStateCallback(GenericOperationalError & err) +{ + auto error = GetInstance()->SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kPaused)); + if (error == CHIP_NO_ERROR) + { + err.Set(to_underlying(ErrorStateEnum::kNoError)); + uint8_t value = to_underlying(OperationalStateEnum::kPaused); + PostAttributeChangeCallback(Attributes::OperationalState::Id, ZCL_INT8U_ATTRIBUTE_TYPE, sizeof(uint8_t), &value); + } + else + { + err.Set(to_underlying(ErrorStateEnum::kUnableToCompleteOperation)); + } +} + +/** + * Handle Command Callback in application: Resume + * @param[out] get Operational error after callback + */ +void OperationalStateDelegate::HandleResumeStateCallback(GenericOperationalError & err) +{ + auto error = GetInstance()->SetOperationalState(to_underlying(OperationalStateEnum::kRunning)); + if (error == CHIP_NO_ERROR) + { + err.Set(to_underlying(ErrorStateEnum::kNoError)); + uint8_t value = to_underlying(OperationalStateEnum::kRunning); + PostAttributeChangeCallback(Attributes::OperationalState::Id, ZCL_INT8U_ATTRIBUTE_TYPE, sizeof(uint8_t), &value); + } + else + { + err.Set(to_underlying(ErrorStateEnum::kUnableToCompleteOperation)); + } +} + +/** + * Handle Command Callback in application: Start + * @param[out] get Operational error after callback + */ +void OperationalStateDelegate::HandleStartStateCallback(GenericOperationalError & err) +{ + auto error = GetInstance()->SetOperationalState(to_underlying(OperationalStateEnum::kRunning)); + if (error == CHIP_NO_ERROR) + { + err.Set(to_underlying(ErrorStateEnum::kNoError)); + uint8_t value = to_underlying(OperationalStateEnum::kRunning); + PostAttributeChangeCallback(Attributes::OperationalState::Id, ZCL_INT8U_ATTRIBUTE_TYPE, sizeof(uint8_t), &value); + } + else + { + err.Set(to_underlying(ErrorStateEnum::kUnableToCompleteOperation)); + } +} + +/** + * Handle Command Callback in application: Stop + * @param[out] get Operational error after callback. + */ +void OperationalStateDelegate::HandleStopStateCallback(GenericOperationalError & err) +{ + auto error = GetInstance()->SetOperationalState(to_underlying(OperationalStateEnum::kStopped)); + + VerifyOrReturn(error == CHIP_NO_ERROR, err.Set(to_underlying(ErrorStateEnum::kUnableToCompleteOperation))); + if (error == CHIP_NO_ERROR) + { + err.Set(to_underlying(ErrorStateEnum::kNoError)); + uint8_t value = to_underlying(OperationalStateEnum::kStopped); + PostAttributeChangeCallback(Attributes::OperationalState::Id, ZCL_INT8U_ATTRIBUTE_TYPE, sizeof(uint8_t), &value); + } + else + { + err.Set(to_underlying(ErrorStateEnum::kUnableToCompleteOperation)); + } +} + +/** + * @brief Calls the MatterPostAttributeChangeCallback for the modified attribute on the operationalState instance + * + * @param attributeId Id of the attribute that changed + * @param type Type of the attribute + * @param size Size of the attribute data + * @param value Value of the attribute data + */ +void OperationalStateDelegate::PostAttributeChangeCallback(AttributeId attributeId, uint8_t type, uint16_t size, uint8_t * value) +{ + ConcreteAttributePath info; + info.mClusterId = OperationalState::Id; + info.mAttributeId = attributeId; + info.mEndpointId = mEndpointId; + MatterPostAttributeChangeCallback(info, type, size, value); +} + +void OperationalStateDelegate::SetEndpointId(EndpointId endpointId) +{ + mEndpointId = endpointId; +} + +OperationalState::Instance * OperationalState::GetInstance() +{ + return gOperationalStateInstance.get(); +} + +OperationalState::OperationalStateDelegate * OperationalState::GetDelegate() +{ + return gOperationalStateDelegate.get(); +} + +void emberAfOperationalStateClusterInitCallback(EndpointId endpointId) +{ + CHIP_ERROR err; + + EndpointId OperationalStateEndpointId = DataModelHelper::GetEndpointIdFromCluster(OperationalState::Id); + VerifyOrDie((OperationalStateEndpointId != kInvalidEndpointId) && (OperationalStateEndpointId == endpointId)); + + VerifyOrDie(!gOperationalStateDelegate && !gOperationalStateInstance); + + gOperationalStateDelegate = std::make_unique(); + VerifyOrDie(gOperationalStateDelegate); + + gOperationalStateInstance = + std::make_unique(gOperationalStateDelegate.get(), OperationalStateEndpointId); + VerifyOrDie(gOperationalStateInstance); + + err = gOperationalStateInstance->Init(); + VerifyOrDie(CHIP_NO_ERROR == err); + + gOperationalStateInstance->SetOperationalState(to_underlying(OperationalStateEnum::kStopped)); + + gOperationalStateDelegate->SetEndpointId(OperationalStateEndpointId); +} + +void OperationalState::Shutdown() +{ + if (gOperationalStateInstance) + { + gOperationalStateInstance.reset(); + } + + if (gOperationalStateDelegate) + { + gOperationalStateDelegate.reset(); + } +} diff --git a/examples/dishwasher-app/silabs/third_party/connectedhomeip b/examples/dishwasher-app/silabs/third_party/connectedhomeip new file mode 120000 index 0000000000..c866b86874 --- /dev/null +++ b/examples/dishwasher-app/silabs/third_party/connectedhomeip @@ -0,0 +1 @@ +../../../.. \ No newline at end of file diff --git a/examples/energy-management-app/energy-management-common/energy-evse/include/EnergyTimeUtils.h b/examples/energy-management-app/energy-management-common/common/include/EnergyTimeUtils.h similarity index 100% rename from examples/energy-management-app/energy-management-common/energy-evse/include/EnergyTimeUtils.h rename to examples/energy-management-app/energy-management-common/common/include/EnergyTimeUtils.h diff --git a/examples/energy-management-app/energy-management-common/device-energy-management/include/DEMManufacturerDelegate.h b/examples/energy-management-app/energy-management-common/device-energy-management/include/DEMManufacturerDelegate.h index 65d214d319..f70b9bf33c 100644 --- a/examples/energy-management-app/energy-management-common/device-energy-management/include/DEMManufacturerDelegate.h +++ b/examples/energy-management-app/energy-management-common/device-energy-management/include/DEMManufacturerDelegate.h @@ -80,6 +80,45 @@ class DEMManufacturerDelegate { return CHIP_NO_ERROR; } + + /** + * @brief Allows a client application to send in power readings into the system + * + * @param[in] aEndpointId - Endpoint to send to EPM Cluster + * @param[in] aActivePower_mW - ActivePower measured in milli-watts + * @param[in] aVoltage_mV - Voltage measured in milli-volts + * @param[in] aActiveCurrent_mA - ActiveCurrent measured in milli-amps + */ + virtual CHIP_ERROR SendPowerReading(EndpointId aEndpointId, int64_t aActivePower_mW, int64_t aVoltage_mV, int64_t aCurrent_mA) + { + return CHIP_NO_ERROR; + } + /** + * @brief Allows a client application to send cumulative energy readings into the system + * + * This is a helper function to add timestamps to the readings + * + * @param[in] aCumulativeEnergyImported -total energy imported in milli-watthours + * @param[in] aCumulativeEnergyExported -total energy exported in milli-watthours + */ + virtual CHIP_ERROR SendCumulativeEnergyReading(EndpointId aEndpointId, int64_t aCumulativeEnergyImported, + int64_t aCumulativeEnergyExported) + { + return CHIP_NO_ERROR; + } + /** + * @brief Allows a client application to send periodic energy readings into the system + * + * This is a helper function to add timestamps to the readings + * + * @param[in] aPeriodicEnergyImported - energy imported in milli-watthours in last period + * @param[in] aPeriodicEnergyExported - energy exported in milli-watthours in last period + */ + virtual CHIP_ERROR SendPeriodicEnergyReading(EndpointId aEndpointId, int64_t aCumulativeEnergyImported, + int64_t aCumulativeEnergyExported) + { + return CHIP_NO_ERROR; + } }; } // namespace DeviceEnergyManagement diff --git a/examples/energy-management-app/energy-management-common/device-energy-management/include/DeviceEnergyManagementDelegateImpl.h b/examples/energy-management-app/energy-management-common/device-energy-management/include/DeviceEnergyManagementDelegateImpl.h index da563910f7..568c4b753d 100644 --- a/examples/energy-management-app/energy-management-common/device-energy-management/include/DeviceEnergyManagementDelegateImpl.h +++ b/examples/energy-management-app/energy-management-common/device-energy-management/include/DeviceEnergyManagementDelegateImpl.h @@ -39,6 +39,7 @@ class DeviceEnergyManagementDelegate : public DeviceEnergyManagement::Delegate void SetDEMManufacturerDelegate(DEMManufacturerDelegate & deviceEnergyManagementManufacturerDelegate); + chip::app::Clusters::DeviceEnergyManagement::DEMManufacturerDelegate * GetDEMManufacturerDelegate(); /** * * Implement the DeviceEnergyManagement::Delegate interface diff --git a/examples/energy-management-app/energy-management-common/device-energy-management/src/DEMTestEventTriggers.cpp b/examples/energy-management-app/energy-management-common/device-energy-management/src/DEMTestEventTriggers.cpp index ff545ecf38..58258b73cd 100644 --- a/examples/energy-management-app/energy-management-common/device-energy-management/src/DEMTestEventTriggers.cpp +++ b/examples/energy-management-app/energy-management-common/device-energy-management/src/DEMTestEventTriggers.cpp @@ -18,7 +18,6 @@ #include #include -#include #include #include diff --git a/examples/energy-management-app/energy-management-common/device-energy-management/src/DeviceEnergyManagementDelegateImpl.cpp b/examples/energy-management-app/energy-management-common/device-energy-management/src/DeviceEnergyManagementDelegateImpl.cpp index 157b85d477..3adefb0953 100644 --- a/examples/energy-management-app/energy-management-common/device-energy-management/src/DeviceEnergyManagementDelegateImpl.cpp +++ b/examples/energy-management-app/energy-management-common/device-energy-management/src/DeviceEnergyManagementDelegateImpl.cpp @@ -62,6 +62,11 @@ void DeviceEnergyManagementDelegate::SetDEMManufacturerDelegate( mpDEMManufacturerDelegate = &deviceEnergyManagementManufacturerDelegate; } +chip::app::Clusters::DeviceEnergyManagement::DEMManufacturerDelegate * DeviceEnergyManagementDelegate::GetDEMManufacturerDelegate() +{ + return mpDEMManufacturerDelegate; +} + /** * @brief Delegate handler for PowerAdjustRequest * diff --git a/examples/energy-management-app/energy-management-common/device-energy-management/src/device-energy-management-mode.cpp b/examples/energy-management-app/energy-management-common/device-energy-management/src/device-energy-management-mode.cpp index 3323519875..d993e5c163 100644 --- a/examples/energy-management-app/energy-management-common/device-energy-management/src/device-energy-management-mode.cpp +++ b/examples/energy-management-app/energy-management-common/device-energy-management/src/device-energy-management-mode.cpp @@ -90,10 +90,14 @@ void DeviceEnergyManagementMode::Shutdown() void emberAfDeviceEnergyManagementModeClusterInitCallback(chip::EndpointId endpointId) { - VerifyOrDie(endpointId == 1); // this cluster is only enabled for endpoint 1. VerifyOrDie(!gDeviceEnergyManagementModeDelegate && !gDeviceEnergyManagementModeInstance); gDeviceEnergyManagementModeDelegate = std::make_unique(); - gDeviceEnergyManagementModeInstance = - std::make_unique(gDeviceEnergyManagementModeDelegate.get(), 0x1, DeviceEnergyManagementMode::Id, 0); + gDeviceEnergyManagementModeInstance = std::make_unique(gDeviceEnergyManagementModeDelegate.get(), + endpointId, DeviceEnergyManagementMode::Id, 0); gDeviceEnergyManagementModeInstance->Init(); } + +void MatterDeviceEnergyManagementModeClusterServerShutdownCallback(chip::EndpointId endpoint) +{ + DeviceEnergyManagementMode::Shutdown(); +} diff --git a/examples/energy-management-app/energy-management-common/energy-evse/include/EVSEManufacturerImpl.h b/examples/energy-management-app/energy-management-common/energy-evse/include/EVSEManufacturerImpl.h index 17d2c865bb..c802cf8e04 100644 --- a/examples/energy-management-app/energy-management-common/energy-evse/include/EVSEManufacturerImpl.h +++ b/examples/energy-management-app/energy-management-common/energy-evse/include/EVSEManufacturerImpl.h @@ -153,7 +153,7 @@ class EVSEManufacturer : public DEMManufacturerDelegate * @param[in] aVoltage_mV - Voltage measured in milli-volts * @param[in] aActiveCurrent_mA - ActiveCurrent measured in milli-amps */ - CHIP_ERROR SendPowerReading(EndpointId aEndpointId, int64_t aActivePower_mW, int64_t aVoltage_mV, int64_t aCurrent_mA); + CHIP_ERROR SendPowerReading(EndpointId aEndpointId, int64_t aActivePower_mW, int64_t aVoltage_mV, int64_t aCurrent_mA) override; /** * @brief Allows a client application to send cumulative energy readings into the system @@ -164,7 +164,7 @@ class EVSEManufacturer : public DEMManufacturerDelegate * @param[in] aCumulativeEnergyExported -total energy exported in milli-watthours */ CHIP_ERROR SendCumulativeEnergyReading(EndpointId aEndpointId, int64_t aCumulativeEnergyImported, - int64_t aCumulativeEnergyExported); + int64_t aCumulativeEnergyExported) override; /** * @brief Allows a client application to send periodic energy readings into the system @@ -175,7 +175,7 @@ class EVSEManufacturer : public DEMManufacturerDelegate * @param[in] aPeriodicEnergyExported - energy exported in milli-watthours in last period */ CHIP_ERROR SendPeriodicEnergyReading(EndpointId aEndpointId, int64_t aCumulativeEnergyImported, - int64_t aCumulativeEnergyExported); + int64_t aCumulativeEnergyExported) override; /** Fake Meter data generation - used for testing EPM/EEM clusters */ /** diff --git a/examples/energy-management-app/energy-management-common/energy-reporting/src/FakeReadings.cpp b/examples/energy-management-app/energy-management-common/energy-reporting/src/FakeReadings.cpp index 78795976c0..bffe3c900d 100644 --- a/examples/energy-management-app/energy-management-common/energy-reporting/src/FakeReadings.cpp +++ b/examples/energy-management-app/energy-management-common/energy-reporting/src/FakeReadings.cpp @@ -16,16 +16,13 @@ * limitations under the License. */ +#include #include -#include -#include -#include #include #include #include #include -#include #include #include @@ -38,7 +35,6 @@ using namespace chip; using namespace chip::app; using namespace chip::app::DataModel; using namespace chip::app::Clusters; -using namespace chip::app::Clusters::EnergyEvse; using namespace chip::app::Clusters::ElectricalPowerMeasurement; using namespace chip::app::Clusters::ElectricalEnergyMeasurement; using namespace chip::app::Clusters::ElectricalEnergyMeasurement::Structs; @@ -145,7 +141,7 @@ void FakeReadings::FakeReadingsUpdate() int64_t current = (static_cast(rand()) % (2 * mCurrentRandomness_mA)) - mCurrentRandomness_mA; current += mCurrent_mA; // add in the base current - GetEvseManufacturer()->SendPowerReading(mEndpointId, power, voltage, current); + GetDEMDelegate()->GetDEMManufacturerDelegate()->SendPowerReading(mEndpointId, power, voltage, current); // update the energy meter - we'll assume that the power has been constant during the previous interval if (mPower_mW > 0) @@ -163,9 +159,11 @@ void FakeReadings::FakeReadingsUpdate() mTotalEnergyExported += mPeriodicEnergyExported; } - GetEvseManufacturer()->SendPeriodicEnergyReading(mEndpointId, mPeriodicEnergyImported, mPeriodicEnergyExported); + GetDEMDelegate()->GetDEMManufacturerDelegate()->SendPeriodicEnergyReading(mEndpointId, mPeriodicEnergyImported, + mPeriodicEnergyExported); - GetEvseManufacturer()->SendCumulativeEnergyReading(mEndpointId, mTotalEnergyImported, mTotalEnergyExported); + GetDEMDelegate()->GetDEMManufacturerDelegate()->SendCumulativeEnergyReading(mEndpointId, mTotalEnergyImported, + mTotalEnergyExported); // start/restart the timer DeviceLayer::SystemLayer().StartTimer(System::Clock::Seconds32(mInterval_s), FakeReadingsTimerExpiry, this); 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 386ba20c6d..29aaae7280 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 @@ -2685,4 +2685,17 @@ limitations under the License. + + Device Energy Management + CHIP + Matter Device Energy Management + Simple + 0x0103 + 0x050D + + + + + +
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRDeviceTypeMetadata.mm b/src/darwin/Framework/CHIP/zap-generated/MTRDeviceTypeMetadata.mm index 7bab05ab23..d743598efe 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRDeviceTypeMetadata.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRDeviceTypeMetadata.mm @@ -96,6 +96,7 @@ { 0x00000306, DeviceTypeClass::Simple, "Matter Flow Sensor" }, { 0x00000307, DeviceTypeClass::Simple, "Matter Humidity Sensor" }, { 0x0000050C, DeviceTypeClass::Simple, "Matter EVSE" }, + { 0x0000050D, DeviceTypeClass::Simple, "Matter Device Energy Management" }, { 0x00000510, DeviceTypeClass::Utility, "Matter Electrical Sensor" }, { 0x00000840, DeviceTypeClass::Simple, "Matter Control Bridge" }, { 0x00000850, DeviceTypeClass::Simple, "Matter On/Off Sensor" }, diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp index b4f5366038..f42faea3c0 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp @@ -6596,6 +6596,8 @@ char const * DeviceTypeIdToText(chip::DeviceTypeId id) return "Matter Humidity Sensor"; case 0x0000050C: return "Matter EVSE"; + case 0x0000050D: + return "Matter Device Energy Management"; case 0x00000510: return "Matter Electrical Sensor"; case 0x00000840: From 1ed1dca33dc7f018faf2b714c4b7343a2ebad5df Mon Sep 17 00:00:00 2001 From: Terence Hampson Date: Thu, 10 Oct 2024 09:58:34 -0400 Subject: [PATCH 076/127] Add unit test for EcosystemInformation cluster server implementation (#35953) --- .../ecosystem-information-server.cpp | 9 +- .../ecosystem-information-server.h | 1 + src/app/tests/BUILD.gn | 15 + .../tests/TestEcosystemInformationCluster.cpp | 392 ++++++++++++++++++ 4 files changed, 414 insertions(+), 3 deletions(-) create mode 100644 src/app/tests/TestEcosystemInformationCluster.cpp 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 4880c1058d..5793ebfd1a 100644 --- a/src/app/clusters/ecosystem-information-server/ecosystem-information-server.cpp +++ b/src/app/clusters/ecosystem-information-server/ecosystem-information-server.cpp @@ -215,9 +215,11 @@ EcosystemLocationStruct::Builder::SetLocationDescriptorLastEdit(uint64_t aLocati std::unique_ptr EcosystemLocationStruct::Builder::Build() { VerifyOrReturnValue(!mIsAlreadyBuilt, nullptr, ChipLogError(Zcl, "Build() already called")); - VerifyOrReturnValue(!mLocationDescriptor.mLocationName.empty(), nullptr, ChipLogError(Zcl, "Must Provided Location Name")); - VerifyOrReturnValue(mLocationDescriptor.mLocationName.size() <= kLocationDescriptorNameMaxSize, nullptr, - ChipLogError(Zcl, "Must Location Name must be less than 64 bytes")); + VerifyOrReturnValue(!mLocationDescriptor.mLocationName.empty(), nullptr, ChipLogError(Zcl, "Must Provide Location Name")); + static_assert(kLocationDescriptorNameMaxSize <= std::numeric_limits::max()); + VerifyOrReturnValue( + mLocationDescriptor.mLocationName.size() <= kLocationDescriptorNameMaxSize, nullptr, + ChipLogError(Zcl, "Location Name must be less than %u bytes", static_cast(kLocationDescriptorNameMaxSize))); // std::make_unique does not have access to private constructor we workaround with using new std::unique_ptr ret{ new EcosystemLocationStruct(std::move(mLocationDescriptor), @@ -271,6 +273,7 @@ CHIP_ERROR EcosystemInformationServer::AddLocationInfo(EndpointId aEndpoint, con VerifyOrReturnError(aLocation, CHIP_ERROR_INVALID_ARGUMENT); VerifyOrReturnError((aEndpoint != kRootEndpointId && aEndpoint != kInvalidEndpointId), CHIP_ERROR_INVALID_ARGUMENT); VerifyOrReturnError(!aLocationId.empty(), CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(aLocationId.size() <= kUniqueLocationIdMaxSize, CHIP_ERROR_INVALID_ARGUMENT); VerifyOrReturnError(aFabricIndex >= kMinValidFabricIndex, CHIP_ERROR_INVALID_ARGUMENT); VerifyOrReturnError(aFabricIndex <= kMaxValidFabricIndex, CHIP_ERROR_INVALID_ARGUMENT); 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 3fe1621813..13d2bc8a6d 100644 --- a/src/app/clusters/ecosystem-information-server/ecosystem-information-server.h +++ b/src/app/clusters/ecosystem-information-server/ecosystem-information-server.h @@ -26,6 +26,7 @@ #include #include +#include #include diff --git a/src/app/tests/BUILD.gn b/src/app/tests/BUILD.gn index 104a57a2fc..e3ad975bce 100644 --- a/src/app/tests/BUILD.gn +++ b/src/app/tests/BUILD.gn @@ -154,6 +154,18 @@ source_set("thread-border-router-management-test-srcs") { ] } +source_set("ecosystem-information-test-srcs") { + sources = [ + "${chip_root}/src/app/clusters/ecosystem-information-server/ecosystem-information-server.cpp", + "${chip_root}/src/app/clusters/ecosystem-information-server/ecosystem-information-server.h", + ] + public_deps = [ + "${chip_root}/src/app:interaction-model", + "${chip_root}/src/app/common:cluster-objects", + "${chip_root}/src/lib/core", + ] +} + source_set("app-test-stubs") { sources = [ "test-ember-api.cpp", @@ -201,6 +213,7 @@ chip_test_suite("tests") { "TestDataModelSerialization.cpp", "TestDefaultOTARequestorStorage.cpp", "TestDefaultThreadNetworkDirectoryStorage.cpp", + "TestEcosystemInformationCluster.cpp", "TestEventLoggingNoUTCTime.cpp", "TestEventOverflow.cpp", "TestEventPathParams.cpp", @@ -228,6 +241,7 @@ chip_test_suite("tests") { public_deps = [ ":app-test-stubs", ":binding-test-srcs", + ":ecosystem-information-test-srcs", ":operational-state-test-srcs", ":ota-requestor-test-srcs", ":power-cluster-test-srcs", @@ -236,6 +250,7 @@ chip_test_suite("tests") { "${chip_root}/src/app", "${chip_root}/src/app/codegen-data-model-provider:instance-header", "${chip_root}/src/app/common:cluster-objects", + "${chip_root}/src/app/data-model-provider/tests:encode-decode", "${chip_root}/src/app/icd/client:manager", "${chip_root}/src/app/tests:helpers", "${chip_root}/src/app/util/mock:mock_codegen_data_model", diff --git a/src/app/tests/TestEcosystemInformationCluster.cpp b/src/app/tests/TestEcosystemInformationCluster.cpp new file mode 100644 index 0000000000..f8d9f34642 --- /dev/null +++ b/src/app/tests/TestEcosystemInformationCluster.cpp @@ -0,0 +1,392 @@ +/* + * 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 "lib/support/CHIPMem.h" + +#include +#include +#include + +namespace chip { +namespace app { +namespace { + +using namespace Clusters; +using namespace Clusters::EcosystemInformation; + +const EndpointId kValidEndpointId = 1; +const Structs::DeviceTypeStruct::Type kValidDeviceType = { .deviceType = 0, .revision = 1 }; +constexpr Access::SubjectDescriptor kSubjectDescriptor = Testing::kAdminSubjectDescriptor; +const FabricIndex kValidFabricIndex = kSubjectDescriptor.fabricIndex; + +struct RequiredEcosystemDeviceParams +{ + EndpointId originalEndpointId = kValidEndpointId; + Structs::DeviceTypeStruct::Type deviceType = kValidDeviceType; + FabricIndex fabicIndex = kValidFabricIndex; +}; + +const RequiredEcosystemDeviceParams kDefaultRequiredDeviceParams; + +const EndpointId kAnotherValidEndpointId = 2; +static_assert(kValidEndpointId != kAnotherValidEndpointId); +const char * kValidLocationName = "AValidLocationName"; +const ClusterId kEcosystemInfoClusterId = EcosystemInformation::Id; +const AttributeId kDeviceDirectoryAttributeId = EcosystemInformation::Attributes::DeviceDirectory::Id; +const AttributeId kLocationDirectoryAttributeId = EcosystemInformation::Attributes::LocationDirectory::Id; + +} // namespace + +class TestEcosystemInformationCluster : public ::testing::Test +{ +public: + static void SetUpTestSuite() { ASSERT_EQ(chip::Platform::MemoryInit(), CHIP_NO_ERROR); } + static void TearDownTestSuite() { chip::Platform::MemoryShutdown(); } + + Clusters::EcosystemInformation::EcosystemInformationServer & EcoInfoCluster() { return mClusterServer; } + + std::unique_ptr + CreateSimplestValidDeviceStruct(const RequiredEcosystemDeviceParams & requiredParams = kDefaultRequiredDeviceParams) + { + std::unique_ptr deviceInfo = EcosystemDeviceStruct::Builder() + .SetOriginalEndpoint(requiredParams.originalEndpointId) + .AddDeviceType(requiredParams.deviceType) + .SetFabricIndex(requiredParams.fabicIndex) + .Build(); + VerifyOrDie(deviceInfo); + return deviceInfo; + } + + std::unique_ptr CreateValidLocationStruct(const char * requiredLocationName = kValidLocationName) + { + std::string locationName(requiredLocationName); + std::unique_ptr locationInfo = + EcosystemLocationStruct::Builder().SetLocationName(locationName).Build(); + VerifyOrDie(locationInfo); + return locationInfo; + } + +private: + Clusters::EcosystemInformation::EcosystemInformationServer mClusterServer; +}; + +TEST_F(TestEcosystemInformationCluster, UnsupportedClusterWhenReadingDeviceDirectoryOnNewClusterServer) +{ + ConcreteAttributePath path(kValidEndpointId, kEcosystemInfoClusterId, kDeviceDirectoryAttributeId); + + Testing::ReadOperation testRequest(path); + std::unique_ptr encoder = testRequest.StartEncoding(); + + ASSERT_EQ(EcoInfoCluster().ReadAttribute(path, *encoder), CHIP_IM_GLOBAL_STATUS(UnsupportedCluster)); +} + +TEST_F(TestEcosystemInformationCluster, UnsupportedClusterWhenReadingLocationDirectoryOnNewClusterServer) +{ + ConcreteAttributePath path(kValidEndpointId, kEcosystemInfoClusterId, kLocationDirectoryAttributeId); + + Testing::ReadOperation testRequest(path); + std::unique_ptr encoder = testRequest.StartEncoding(); + + ASSERT_EQ(EcoInfoCluster().ReadAttribute(path, *encoder), CHIP_IM_GLOBAL_STATUS(UnsupportedCluster)); +} + +TEST_F(TestEcosystemInformationCluster, EmptyReadAfterAddEcosystemInformationClusterToEndpoint) +{ + ConcreteAttributePath deviceDirectoryPath(kValidEndpointId, kEcosystemInfoClusterId, kDeviceDirectoryAttributeId); + ConcreteAttributePath locationDirectoryPath(kValidEndpointId, kEcosystemInfoClusterId, kLocationDirectoryAttributeId); + + ASSERT_EQ(EcoInfoCluster().AddEcosystemInformationClusterToEndpoint(kValidEndpointId), CHIP_NO_ERROR); + + Testing::ReadOperation testDeviceDirectoryRequest(deviceDirectoryPath); + std::unique_ptr deviceDirectoryEncoder = testDeviceDirectoryRequest.StartEncoding(); + ASSERT_EQ(EcoInfoCluster().ReadAttribute(deviceDirectoryPath, *deviceDirectoryEncoder), CHIP_NO_ERROR); + ASSERT_EQ(testDeviceDirectoryRequest.FinishEncoding(), CHIP_NO_ERROR); + std::vector deviceDirectoryAttributeData; + ASSERT_EQ(testDeviceDirectoryRequest.GetEncodedIBs().Decode(deviceDirectoryAttributeData), CHIP_NO_ERROR); + ASSERT_EQ(deviceDirectoryAttributeData.size(), 1u); + Testing::DecodedAttributeData & deviceDirectoryEncodedData = deviceDirectoryAttributeData[0]; + ASSERT_EQ(deviceDirectoryEncodedData.attributePath, testDeviceDirectoryRequest.GetRequest().path); + EcosystemInformation::Attributes::DeviceDirectory::TypeInfo::DecodableType decodableDeviceDirectory; + ASSERT_EQ(decodableDeviceDirectory.Decode(deviceDirectoryEncodedData.dataReader), CHIP_NO_ERROR); + size_t deviceDirectorySize = 0; + ASSERT_EQ(decodableDeviceDirectory.ComputeSize(&deviceDirectorySize), CHIP_NO_ERROR); + ASSERT_EQ(deviceDirectorySize, 0u); + + Testing::ReadOperation testLocationDirectoryRequest(locationDirectoryPath); + std::unique_ptr locationDirectoryEncoder = testLocationDirectoryRequest.StartEncoding(); + ASSERT_EQ(EcoInfoCluster().ReadAttribute(locationDirectoryPath, *locationDirectoryEncoder), CHIP_NO_ERROR); + ASSERT_EQ(testLocationDirectoryRequest.FinishEncoding(), CHIP_NO_ERROR); + std::vector locationDirectoryAttributeData; + ASSERT_EQ(testLocationDirectoryRequest.GetEncodedIBs().Decode(locationDirectoryAttributeData), CHIP_NO_ERROR); + ASSERT_EQ(locationDirectoryAttributeData.size(), 1u); + Testing::DecodedAttributeData & locationDirectoryEncodedData = locationDirectoryAttributeData[0]; + ASSERT_EQ(locationDirectoryEncodedData.attributePath, testLocationDirectoryRequest.GetRequest().path); + EcosystemInformation::Attributes::LocationDirectory::TypeInfo::DecodableType decodableLocationDirectory; + ASSERT_EQ(decodableLocationDirectory.Decode(locationDirectoryEncodedData.dataReader), CHIP_NO_ERROR); + size_t locationDirectorySize = 0; + ASSERT_EQ(decodableLocationDirectory.ComputeSize(&locationDirectorySize), CHIP_NO_ERROR); + ASSERT_EQ(locationDirectorySize, 0u); +} + +TEST_F(TestEcosystemInformationCluster, BuildingEcosystemDeviceStruct) +{ + EcosystemDeviceStruct::Builder deviceInfoBuilder; + std::unique_ptr deviceInfo = deviceInfoBuilder.Build(); + ASSERT_FALSE(deviceInfo); + + deviceInfoBuilder.SetOriginalEndpoint(1); + deviceInfo = deviceInfoBuilder.Build(); + ASSERT_FALSE(deviceInfo); + + auto deviceType = Structs::DeviceTypeStruct::Type(); + deviceType.revision = 1; + deviceInfoBuilder.AddDeviceType(deviceType); + deviceInfo = deviceInfoBuilder.Build(); + ASSERT_FALSE(deviceInfo); + + deviceInfoBuilder.SetFabricIndex(1); + deviceInfo = deviceInfoBuilder.Build(); + ASSERT_TRUE(deviceInfo); + + // Building a second device info with previously successfully built deviceInfoBuilder + // is expected to fail. + std::unique_ptr secondDeviceInfo = deviceInfoBuilder.Build(); + ASSERT_FALSE(secondDeviceInfo); +} + +TEST_F(TestEcosystemInformationCluster, BuildingInvalidEcosystemDeviceStruct) +{ + auto deviceType = Structs::DeviceTypeStruct::Type(); + deviceType.revision = 1; + const FabricIndex kFabricIndexTooLow = 0; + const FabricIndex kFabricIndexTooHigh = kMaxValidFabricIndex + 1; + + EcosystemDeviceStruct::Builder deviceInfoBuilder; + deviceInfoBuilder.SetOriginalEndpoint(1); + deviceInfoBuilder.AddDeviceType(deviceType); + deviceInfoBuilder.SetFabricIndex(kFabricIndexTooLow); + std::unique_ptr deviceInfo = deviceInfoBuilder.Build(); + ASSERT_FALSE(deviceInfo); + + deviceInfoBuilder.SetFabricIndex(kFabricIndexTooHigh); + deviceInfo = deviceInfoBuilder.Build(); + ASSERT_FALSE(deviceInfo); + + deviceInfoBuilder.SetFabricIndex(1); + // At this point deviceInfoBuilder would be able to be built successfully. + + std::string nameThatsTooLong(65, 'x'); + uint64_t nameEpochValueUs = 0; // This values doesn't matter. + deviceInfoBuilder.SetDeviceName(std::move(nameThatsTooLong), nameEpochValueUs); + deviceInfo = deviceInfoBuilder.Build(); + ASSERT_FALSE(deviceInfo); + + // Ending unit test by building something that should work just to make sure + // Builder isn't silently failing on building for some other reason. + std::string nameThatsMaxLength(64, 'x'); + deviceInfoBuilder.SetDeviceName(std::move(nameThatsMaxLength), nameEpochValueUs); + deviceInfo = deviceInfoBuilder.Build(); + ASSERT_TRUE(deviceInfo); +} + +TEST_F(TestEcosystemInformationCluster, AddDeviceInfoInvalidArguments) +{ + ASSERT_EQ(EcoInfoCluster().AddDeviceInfo(kValidEndpointId, nullptr), CHIP_ERROR_INVALID_ARGUMENT); + + std::unique_ptr deviceInfo = CreateSimplestValidDeviceStruct(); + ASSERT_TRUE(deviceInfo); + ASSERT_EQ(EcoInfoCluster().AddDeviceInfo(kRootEndpointId, std::move(deviceInfo)), CHIP_ERROR_INVALID_ARGUMENT); + + deviceInfo = CreateSimplestValidDeviceStruct(); + ASSERT_TRUE(deviceInfo); + ASSERT_EQ(EcoInfoCluster().AddDeviceInfo(kInvalidEndpointId, std::move(deviceInfo)), CHIP_ERROR_INVALID_ARGUMENT); +} + +TEST_F(TestEcosystemInformationCluster, AddDeviceInfo) +{ + std::unique_ptr deviceInfo = CreateSimplestValidDeviceStruct(); + // originalEndpoint and path endpoint do not need to be the same, for that reason we use a different value for + // path endpoint + static_assert(kAnotherValidEndpointId != kValidEndpointId); + ASSERT_EQ(EcoInfoCluster().AddDeviceInfo(kAnotherValidEndpointId, std::move(deviceInfo)), CHIP_NO_ERROR); + ConcreteAttributePath deviceDirectoryPath(kAnotherValidEndpointId, kEcosystemInfoClusterId, kDeviceDirectoryAttributeId); + Testing::ReadOperation testDeviceDirectoryRequest(deviceDirectoryPath); + testDeviceDirectoryRequest.SetSubjectDescriptor(kSubjectDescriptor); + std::unique_ptr deviceDirectoryEncoder = testDeviceDirectoryRequest.StartEncoding(); + + ASSERT_EQ(EcoInfoCluster().ReadAttribute(deviceDirectoryPath, *deviceDirectoryEncoder), CHIP_NO_ERROR); + ASSERT_EQ(testDeviceDirectoryRequest.FinishEncoding(), CHIP_NO_ERROR); + + std::vector attributeData; + ASSERT_EQ(testDeviceDirectoryRequest.GetEncodedIBs().Decode(attributeData), CHIP_NO_ERROR); + ASSERT_EQ(attributeData.size(), 1u); + Testing::DecodedAttributeData & encodedData = attributeData[0]; + ASSERT_EQ(encodedData.attributePath, testDeviceDirectoryRequest.GetRequest().path); + EcosystemInformation::Attributes::DeviceDirectory::TypeInfo::DecodableType decodableDeviceDirectory; + ASSERT_EQ(decodableDeviceDirectory.Decode(encodedData.dataReader), CHIP_NO_ERROR); + size_t size = 0; + ASSERT_EQ(decodableDeviceDirectory.ComputeSize(&size), CHIP_NO_ERROR); + ASSERT_EQ(size, 1u); + auto iterator = decodableDeviceDirectory.begin(); + ASSERT_TRUE(iterator.Next()); + auto deviceDirectoryEntry = iterator.GetValue(); + ASSERT_FALSE(deviceDirectoryEntry.deviceName.HasValue()); + ASSERT_FALSE(deviceDirectoryEntry.deviceNameLastEdit.HasValue()); + ASSERT_EQ(deviceDirectoryEntry.bridgedEndpoint, kInvalidEndpointId); + ASSERT_EQ(deviceDirectoryEntry.originalEndpoint, kValidEndpointId); + size_t deviceTypeListSize = 0; + ASSERT_EQ(deviceDirectoryEntry.deviceTypes.ComputeSize(&deviceTypeListSize), CHIP_NO_ERROR); + ASSERT_EQ(deviceTypeListSize, 1u); + auto deviceTypeIterator = deviceDirectoryEntry.deviceTypes.begin(); + ASSERT_TRUE(deviceTypeIterator.Next()); + auto deviceTypeEntry = deviceTypeIterator.GetValue(); + ASSERT_EQ(deviceTypeEntry.deviceType, 0u); + ASSERT_EQ(deviceTypeEntry.revision, 1); + ASSERT_FALSE(deviceTypeIterator.Next()); + size_t uniqueLocationIdListSize = 0; + ASSERT_EQ(deviceDirectoryEntry.uniqueLocationIDs.ComputeSize(&uniqueLocationIdListSize), CHIP_NO_ERROR); + ASSERT_EQ(uniqueLocationIdListSize, 0u); + ASSERT_EQ(deviceDirectoryEntry.uniqueLocationIDsLastEdit, 0u); + ASSERT_EQ(deviceDirectoryEntry.fabricIndex, kSubjectDescriptor.fabricIndex); + ASSERT_FALSE(iterator.Next()); +} + +TEST_F(TestEcosystemInformationCluster, BuildingEcosystemLocationStruct) +{ + EcosystemLocationStruct::Builder locationInfoBuilder; + + std::string validLocationName = "validName"; + locationInfoBuilder.SetLocationName(validLocationName); + + std::unique_ptr locationInfo = locationInfoBuilder.Build(); + ASSERT_TRUE(locationInfo); + + // Building a second device info with previously successfully built deviceInfoBuilder + // is expected to fail. + locationInfo = locationInfoBuilder.Build(); + ASSERT_FALSE(locationInfo); +} + +TEST_F(TestEcosystemInformationCluster, BuildingInvalidEcosystemLocationStruct) +{ + EcosystemLocationStruct::Builder locationInfoBuilder; + + std::string nameThatsTooLong(129, 'x'); + locationInfoBuilder.SetLocationName(nameThatsTooLong); + + std::unique_ptr locationInfo = locationInfoBuilder.Build(); + ASSERT_FALSE(locationInfo); + + // Ending unit test by building something that should work just to make sure + // Builder isn't silently failing on building for some other reason. + std::string nameThatsMaxLength(128, 'x'); + locationInfoBuilder.SetLocationName(nameThatsMaxLength); + locationInfo = locationInfoBuilder.Build(); + ASSERT_TRUE(locationInfo); +} + +TEST_F(TestEcosystemInformationCluster, AddLocationInfoInvalidArguments) +{ + const FabricIndex kFabricIndexTooLow = 0; + const FabricIndex kFabricIndexTooHigh = kMaxValidFabricIndex + 1; + const std::string kEmptyLocationIdStr; + const std::string kValidLocationIdStr = "SomeLocationString"; + const std::string kInvalidLocationIdTooLongStr(65, 'x'); + + std::unique_ptr locationInfo = CreateValidLocationStruct(); + ASSERT_TRUE(locationInfo); + ASSERT_EQ(EcoInfoCluster().AddLocationInfo(kInvalidEndpointId, kValidLocationIdStr, kValidFabricIndex, std::move(locationInfo)), + CHIP_ERROR_INVALID_ARGUMENT); + + locationInfo = CreateValidLocationStruct(); + ASSERT_TRUE(locationInfo); + ASSERT_EQ(EcoInfoCluster().AddLocationInfo(kRootEndpointId, kValidLocationIdStr, kValidFabricIndex, std::move(locationInfo)), + CHIP_ERROR_INVALID_ARGUMENT); + + locationInfo = CreateValidLocationStruct(); + ASSERT_TRUE(locationInfo); + ASSERT_EQ(EcoInfoCluster().AddLocationInfo(kValidEndpointId, kEmptyLocationIdStr, kValidFabricIndex, std::move(locationInfo)), + CHIP_ERROR_INVALID_ARGUMENT); + + locationInfo = CreateValidLocationStruct(); + ASSERT_TRUE(locationInfo); + ASSERT_EQ(EcoInfoCluster().AddLocationInfo(kValidEndpointId, kInvalidLocationIdTooLongStr, kValidFabricIndex, + std::move(locationInfo)), + CHIP_ERROR_INVALID_ARGUMENT); + + locationInfo = CreateValidLocationStruct(); + ASSERT_TRUE(locationInfo); + ASSERT_EQ(EcoInfoCluster().AddLocationInfo(kValidEndpointId, kValidLocationIdStr, kFabricIndexTooLow, std::move(locationInfo)), + CHIP_ERROR_INVALID_ARGUMENT); + + locationInfo = CreateValidLocationStruct(); + ASSERT_TRUE(locationInfo); + ASSERT_EQ(EcoInfoCluster().AddLocationInfo(kValidEndpointId, kValidLocationIdStr, kFabricIndexTooHigh, std::move(locationInfo)), + CHIP_ERROR_INVALID_ARGUMENT); + + // Sanity check that we can successfully add something after all the previously failed attempts + locationInfo = CreateValidLocationStruct(); + ASSERT_TRUE(locationInfo); + ASSERT_EQ(EcoInfoCluster().AddLocationInfo(kValidEndpointId, kValidLocationIdStr, kValidFabricIndex, std::move(locationInfo)), + CHIP_NO_ERROR); + + // Adding a second identical entry is expected to fail + locationInfo = CreateValidLocationStruct(); + ASSERT_TRUE(locationInfo); + ASSERT_EQ(EcoInfoCluster().AddLocationInfo(kValidEndpointId, kValidLocationIdStr, kValidFabricIndex, std::move(locationInfo)), + CHIP_ERROR_INVALID_ARGUMENT); +} + +TEST_F(TestEcosystemInformationCluster, AddLocationInfo) +{ + std::unique_ptr locationInfo = CreateValidLocationStruct(); + const char * kValidLocationIdStr = "SomeLocationIdString"; + ASSERT_EQ(EcoInfoCluster().AddLocationInfo(kValidEndpointId, kValidLocationIdStr, Testing::kAdminSubjectDescriptor.fabricIndex, + std::move(locationInfo)), + CHIP_NO_ERROR); + + ConcreteAttributePath locationDirectoryPath(kValidEndpointId, kEcosystemInfoClusterId, kLocationDirectoryAttributeId); + Testing::ReadOperation testLocationDirectoryRequest(locationDirectoryPath); + testLocationDirectoryRequest.SetSubjectDescriptor(Testing::kAdminSubjectDescriptor); + std::unique_ptr locationDirectoryEncoder = testLocationDirectoryRequest.StartEncoding(); + ASSERT_EQ(EcoInfoCluster().ReadAttribute(locationDirectoryPath, *locationDirectoryEncoder), CHIP_NO_ERROR); + ASSERT_EQ(testLocationDirectoryRequest.FinishEncoding(), CHIP_NO_ERROR); + + std::vector locationDirectoryAttributeData; + ASSERT_EQ(testLocationDirectoryRequest.GetEncodedIBs().Decode(locationDirectoryAttributeData), CHIP_NO_ERROR); + ASSERT_EQ(locationDirectoryAttributeData.size(), 1u); + Testing::DecodedAttributeData & locationDirectoryEncodedData = locationDirectoryAttributeData[0]; + ASSERT_EQ(locationDirectoryEncodedData.attributePath, testLocationDirectoryRequest.GetRequest().path); + EcosystemInformation::Attributes::LocationDirectory::TypeInfo::DecodableType decodableLocationDirectory; + ASSERT_EQ(decodableLocationDirectory.Decode(locationDirectoryEncodedData.dataReader), CHIP_NO_ERROR); + size_t locationDirectorySize = 0; + ASSERT_EQ(decodableLocationDirectory.ComputeSize(&locationDirectorySize), CHIP_NO_ERROR); + ASSERT_EQ(locationDirectorySize, 1u); + auto iterator = decodableLocationDirectory.begin(); + ASSERT_TRUE(iterator.Next()); + auto locationDirectoryEntry = iterator.GetValue(); + ASSERT_TRUE(locationDirectoryEntry.uniqueLocationID.data_equal(CharSpan::fromCharString(kValidLocationIdStr))); + ASSERT_TRUE(locationDirectoryEntry.locationDescriptor.locationName.data_equal(CharSpan::fromCharString(kValidLocationName))); + ASSERT_TRUE(locationDirectoryEntry.locationDescriptor.floorNumber.IsNull()); + ASSERT_TRUE(locationDirectoryEntry.locationDescriptor.areaType.IsNull()); + ASSERT_EQ(locationDirectoryEntry.locationDescriptorLastEdit, 0u); + ASSERT_EQ(locationDirectoryEntry.fabricIndex, Testing::kAdminSubjectDescriptor.fabricIndex); + ASSERT_FALSE(iterator.Next()); +} + +} // namespace app +} // namespace chip From 33991c5dee47abecd70e87f45d4dd0ac4925d5db Mon Sep 17 00:00:00 2001 From: shripad621git <79364691+shripad621git@users.noreply.github.com> Date: Thu, 10 Oct 2024 19:34:21 +0530 Subject: [PATCH 077/127] Reduced the ESP32 CI tests to be run on CI build (#35931) --- .github/workflows/examples-esp32.yaml | 15 +++++++++------ .github/workflows/qemu.yaml | 2 +- .../lighting-app/esp32/sdkconfig.defaults.esp32c6 | 4 ++++ 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/examples-esp32.yaml b/.github/workflows/examples-esp32.yaml index a2dca96dc6..b3a6ed24e6 100644 --- a/.github/workflows/examples-esp32.yaml +++ b/.github/workflows/examples-esp32.yaml @@ -105,14 +105,11 @@ jobs: example_binaries/esp32-build/chip-all-clusters-app.elf \ /tmp/bloat_reports/ - - name: Build example Pigweed App - run: scripts/examples/esp_example.sh pigweed-app sdkconfig.defaults - - name: Build example Lighting App (Target:ESP32H2) run: scripts/examples/esp_example.sh lighting-app sdkconfig.defaults.esp32h2 esp32h2 - - name: Build example Lock App (Target:ESP32C6) - run: scripts/examples/esp_example.sh lock-app sdkconfig.defaults.esp32c6 esp32c6 + - name: Build example Lighting App (Target:ESP32C6) + run: scripts/examples/esp_example.sh lighting-app sdkconfig.defaults.esp32c6 esp32c6 - name: Uploading Size Reports uses: ./.github/actions/upload-size-reports @@ -124,7 +121,7 @@ jobs: name: ESP32_1 runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' + if: github.actor != 'restyled-io[bot]' && github.repository_owner == 'espressif' container: image: ghcr.io/project-chip/chip-build-esp32:81 @@ -168,3 +165,9 @@ jobs: - name: Build example LIT ICD App (Target:ESP32H2) run: scripts/examples/esp_example.sh lit-icd-app sdkconfig.defaults esp32h2 + + - name: Build example Pigweed App + run: scripts/examples/esp_example.sh pigweed-app sdkconfig.defaults + + - name: Build example Lock App (Target:ESP32C6) + run: scripts/examples/esp_example.sh lock-app sdkconfig.defaults.esp32c6 esp32c6 diff --git a/.github/workflows/qemu.yaml b/.github/workflows/qemu.yaml index b3115f2ff3..783c46ef41 100644 --- a/.github/workflows/qemu.yaml +++ b/.github/workflows/qemu.yaml @@ -38,7 +38,7 @@ jobs: BUILD_TYPE: esp32-qemu runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' + if: github.actor != 'restyled-io[bot]' && github.repository_owner == 'espressif' container: image: ghcr.io/project-chip/chip-build-esp32-qemu:81 diff --git a/examples/lighting-app/esp32/sdkconfig.defaults.esp32c6 b/examples/lighting-app/esp32/sdkconfig.defaults.esp32c6 index 104777a72b..161fdd52ae 100644 --- a/examples/lighting-app/esp32/sdkconfig.defaults.esp32c6 +++ b/examples/lighting-app/esp32/sdkconfig.defaults.esp32c6 @@ -65,3 +65,7 @@ CONFIG_ENABLE_CHIP_SHELL=y # Enable HKDF in mbedtls CONFIG_MBEDTLS_HKDF_C=y + +# Serial Flasher config +CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y +CONFIG_ESPTOOLPY_FLASHSIZE="4MB" From 35fcc332bd910ea02293f59566b6880e73cc78ae Mon Sep 17 00:00:00 2001 From: Sergio Soares Date: Thu, 10 Oct 2024 11:09:13 -0400 Subject: [PATCH 078/127] =?UTF-8?q?Revert=20"Refactoring=20of=20support=20?= =?UTF-8?q?test=20scripts=20to=20enhance=20matter=20testing=20infrast?= =?UTF-8?q?=E2=80=A6"=20(#36016)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b1cd9fdc010748e6fa52dc5043f4b842952fe284. --- docs/testing/python.md | 10 +- scripts/spec_xml/generate_spec_xml.py | 60 ++++++---- scripts/spec_xml/paths.py | 109 ------------------ src/python_testing/MinimalRepresentation.py | 6 +- src/python_testing/TCP_Tests.py | 2 +- src/python_testing/TC_ACE_1_2.py | 2 +- src/python_testing/TC_ACE_1_3.py | 2 +- src/python_testing/TC_ACE_1_4.py | 2 +- src/python_testing/TC_ACE_1_5.py | 2 +- src/python_testing/TC_ACL_2_11.py | 4 +- src/python_testing/TC_ACL_2_2.py | 2 +- src/python_testing/TC_AccessChecker.py | 10 +- src/python_testing/TC_BOOLCFG_2_1.py | 2 +- src/python_testing/TC_BOOLCFG_3_1.py | 2 +- src/python_testing/TC_BOOLCFG_4_1.py | 2 +- src/python_testing/TC_BOOLCFG_4_2.py | 2 +- src/python_testing/TC_BOOLCFG_4_3.py | 2 +- src/python_testing/TC_BOOLCFG_4_4.py | 2 +- src/python_testing/TC_BOOLCFG_5_1.py | 2 +- src/python_testing/TC_BOOLCFG_5_2.py | 2 +- src/python_testing/TC_BRBINFO_4_1.py | 2 +- src/python_testing/TC_CADMIN_1_9.py | 2 +- src/python_testing/TC_CCTRL_2_1.py | 2 +- src/python_testing/TC_CCTRL_2_2.py | 4 +- src/python_testing/TC_CCTRL_2_3.py | 4 +- src/python_testing/TC_CC_10_1.py | 2 +- src/python_testing/TC_CC_2_2.py | 7 +- src/python_testing/TC_CGEN_2_4.py | 2 +- src/python_testing/TC_CNET_1_4.py | 2 +- src/python_testing/TC_CNET_4_4.py | 2 +- src/python_testing/TC_DA_1_2.py | 5 +- src/python_testing/TC_DA_1_5.py | 2 +- src/python_testing/TC_DA_1_7.py | 4 +- src/python_testing/TC_DEMTestBase.py | 2 +- src/python_testing/TC_DEM_2_1.py | 2 +- src/python_testing/TC_DEM_2_10.py | 4 +- src/python_testing/TC_DEM_2_2.py | 2 +- src/python_testing/TC_DEM_2_3.py | 2 +- src/python_testing/TC_DEM_2_4.py | 2 +- src/python_testing/TC_DEM_2_5.py | 2 +- src/python_testing/TC_DEM_2_6.py | 2 +- src/python_testing/TC_DEM_2_7.py | 2 +- src/python_testing/TC_DEM_2_8.py | 2 +- src/python_testing/TC_DEM_2_9.py | 2 +- src/python_testing/TC_DGGEN_2_4.py | 5 +- src/python_testing/TC_DGGEN_3_2.py | 2 +- src/python_testing/TC_DGSW_2_1.py | 2 +- src/python_testing/TC_DRLK_2_12.py | 2 +- src/python_testing/TC_DRLK_2_13.py | 2 +- src/python_testing/TC_DRLK_2_2.py | 2 +- src/python_testing/TC_DRLK_2_3.py | 2 +- src/python_testing/TC_DRLK_2_5.py | 2 +- src/python_testing/TC_DRLK_2_9.py | 2 +- .../TC_DeviceBasicComposition.py | 23 ++-- src/python_testing/TC_DeviceConformance.py | 18 +-- src/python_testing/TC_ECOINFO_2_1.py | 2 +- src/python_testing/TC_ECOINFO_2_2.py | 2 +- src/python_testing/TC_EEM_2_1.py | 2 +- src/python_testing/TC_EEM_2_2.py | 2 +- src/python_testing/TC_EEM_2_3.py | 2 +- src/python_testing/TC_EEM_2_4.py | 2 +- src/python_testing/TC_EEM_2_5.py | 2 +- src/python_testing/TC_EEVSE_2_2.py | 2 +- src/python_testing/TC_EEVSE_2_3.py | 4 +- src/python_testing/TC_EEVSE_2_4.py | 2 +- src/python_testing/TC_EEVSE_2_5.py | 2 +- src/python_testing/TC_EEVSE_2_6.py | 4 +- src/python_testing/TC_EPM_2_1.py | 5 +- src/python_testing/TC_EPM_2_2.py | 2 +- src/python_testing/TC_EWATERHTR_2_1.py | 2 +- src/python_testing/TC_EWATERHTR_2_2.py | 2 +- src/python_testing/TC_EWATERHTR_2_3.py | 2 +- src/python_testing/TC_FAN_3_1.py | 2 +- src/python_testing/TC_FAN_3_2.py | 2 +- src/python_testing/TC_FAN_3_3.py | 2 +- src/python_testing/TC_FAN_3_4.py | 2 +- src/python_testing/TC_FAN_3_5.py | 2 +- src/python_testing/TC_ICDM_2_1.py | 2 +- src/python_testing/TC_ICDM_3_1.py | 2 +- src/python_testing/TC_ICDM_3_2.py | 2 +- src/python_testing/TC_ICDM_3_3.py | 2 +- src/python_testing/TC_ICDM_3_4.py | 4 +- src/python_testing/TC_ICDM_5_1.py | 2 +- src/python_testing/TC_ICDManagementCluster.py | 2 +- src/python_testing/TC_IDM_1_2.py | 2 +- src/python_testing/TC_IDM_1_4.py | 2 +- src/python_testing/TC_IDM_4_2.py | 2 +- src/python_testing/TC_LVL_2_3.py | 4 +- src/python_testing/TC_MCORE_FS_1_1.py | 2 +- src/python_testing/TC_MCORE_FS_1_2.py | 2 +- src/python_testing/TC_MCORE_FS_1_3.py | 2 +- src/python_testing/TC_MCORE_FS_1_4.py | 2 +- src/python_testing/TC_MCORE_FS_1_5.py | 2 +- src/python_testing/TC_MWOCTRL_2_1.py | 2 +- src/python_testing/TC_MWOCTRL_2_2.py | 2 +- src/python_testing/TC_MWOCTRL_2_4.py | 2 +- src/python_testing/TC_MWOM_1_2.py | 2 +- src/python_testing/TC_OCC_2_1.py | 2 +- src/python_testing/TC_OCC_2_2.py | 5 +- src/python_testing/TC_OCC_2_3.py | 2 +- src/python_testing/TC_OCC_3_1.py | 4 +- src/python_testing/TC_OCC_3_2.py | 4 +- src/python_testing/TC_OPCREDS_3_1.py | 2 +- src/python_testing/TC_OPCREDS_3_2.py | 2 +- src/python_testing/TC_OPSTATE_2_1.py | 2 +- src/python_testing/TC_OPSTATE_2_2.py | 2 +- src/python_testing/TC_OPSTATE_2_3.py | 2 +- src/python_testing/TC_OPSTATE_2_4.py | 2 +- src/python_testing/TC_OPSTATE_2_5.py | 2 +- src/python_testing/TC_OPSTATE_2_6.py | 2 +- src/python_testing/TC_OVENOPSTATE_2_1.py | 2 +- src/python_testing/TC_OVENOPSTATE_2_2.py | 2 +- src/python_testing/TC_OVENOPSTATE_2_3.py | 2 +- src/python_testing/TC_OVENOPSTATE_2_4.py | 2 +- src/python_testing/TC_OVENOPSTATE_2_5.py | 2 +- src/python_testing/TC_OVENOPSTATE_2_6.py | 2 +- src/python_testing/TC_OpstateCommon.py | 2 +- src/python_testing/TC_PS_2_3.py | 4 +- src/python_testing/TC_PWRTL_2_1.py | 2 +- src/python_testing/TC_RR_1_1.py | 2 +- src/python_testing/TC_RVCCLEANM_1_2.py | 2 +- src/python_testing/TC_RVCCLEANM_2_1.py | 2 +- src/python_testing/TC_RVCCLEANM_2_2.py | 2 +- src/python_testing/TC_RVCOPSTATE_2_1.py | 2 +- src/python_testing/TC_RVCOPSTATE_2_3.py | 2 +- src/python_testing/TC_RVCOPSTATE_2_4.py | 2 +- src/python_testing/TC_RVCRUNM_1_2.py | 2 +- src/python_testing/TC_RVCRUNM_2_1.py | 2 +- src/python_testing/TC_RVCRUNM_2_2.py | 2 +- src/python_testing/TC_SC_3_6.py | 2 +- src/python_testing/TC_SC_7_1.py | 5 +- src/python_testing/TC_SEAR_1_2.py | 2 +- src/python_testing/TC_SEAR_1_3.py | 8 +- src/python_testing/TC_SEAR_1_4.py | 2 +- src/python_testing/TC_SEAR_1_5.py | 2 +- src/python_testing/TC_SEAR_1_6.py | 2 +- src/python_testing/TC_SWTCH.py | 9 +- src/python_testing/TC_TIMESYNC_2_1.py | 4 +- src/python_testing/TC_TIMESYNC_2_10.py | 4 +- src/python_testing/TC_TIMESYNC_2_11.py | 4 +- src/python_testing/TC_TIMESYNC_2_12.py | 4 +- src/python_testing/TC_TIMESYNC_2_13.py | 2 +- src/python_testing/TC_TIMESYNC_2_2.py | 3 +- src/python_testing/TC_TIMESYNC_2_4.py | 3 +- src/python_testing/TC_TIMESYNC_2_5.py | 2 +- src/python_testing/TC_TIMESYNC_2_6.py | 2 +- src/python_testing/TC_TIMESYNC_2_7.py | 4 +- src/python_testing/TC_TIMESYNC_2_8.py | 4 +- src/python_testing/TC_TIMESYNC_2_9.py | 4 +- src/python_testing/TC_TIMESYNC_3_1.py | 2 +- src/python_testing/TC_TMP_2_1.py | 2 +- src/python_testing/TC_TSTAT_4_2.py | 2 +- src/python_testing/TC_TestEventTrigger.py | 2 +- src/python_testing/TC_VALCC_2_1.py | 2 +- src/python_testing/TC_VALCC_3_1.py | 2 +- src/python_testing/TC_VALCC_3_2.py | 2 +- src/python_testing/TC_VALCC_3_3.py | 2 +- src/python_testing/TC_VALCC_3_4.py | 2 +- src/python_testing/TC_VALCC_4_1.py | 2 +- src/python_testing/TC_VALCC_4_2.py | 2 +- src/python_testing/TC_VALCC_4_3.py | 2 +- src/python_testing/TC_VALCC_4_4.py | 3 +- src/python_testing/TC_VALCC_4_5.py | 2 +- src/python_testing/TC_WHM_1_2.py | 2 +- src/python_testing/TC_WHM_2_1.py | 2 +- src/python_testing/TC_pics_checker.py | 12 +- src/python_testing/TestBatchInvoke.py | 2 +- .../TestChoiceConformanceSupport.py | 8 +- .../TestCommissioningTimeSync.py | 2 +- src/python_testing/TestConformanceSupport.py | 8 +- src/python_testing/TestConformanceTest.py | 10 +- src/python_testing/TestGroupTableReports.py | 2 +- src/python_testing/TestIdChecks.py | 7 +- .../TestMatterTestingSupport.py | 13 +-- .../TestSpecParsingDeviceType.py | 6 +- src/python_testing/TestSpecParsingSupport.py | 17 +-- .../TestTimeSyncTrustedTimeSource.py | 2 +- .../TestUnitTestingErrorPath.py | 2 +- ...sition.py => basic_composition_support.py} | 0 ...mance.py => choice_conformance_support.py} | 8 +- .../conformance.py => conformance_support.py} | 0 src/python_testing/drlk_2_x_common.py | 2 +- src/python_testing/execute_python_tests.py | 10 +- .../chip/testing => }/global_attribute_ids.py | 0 src/python_testing/hello_external_runner.py | 2 +- src/python_testing/hello_test.py | 2 +- .../matter_testing_infrastructure/BUILD.gn | 9 +- .../chip/testing/apps.py | 2 +- ...r_testing.py => matter_testing_support.py} | 6 +- .../chip/testing/pics.py => pics_support.py} | 0 .../production_device_checks.py | 12 +- ...pec_parsing.py => spec_parsing_support.py} | 43 +++---- ...y => taglist_and_topology_test_support.py} | 0 .../test_plan_table_generator.py | 2 +- .../test_testing/MockTestRunner.py | 18 ++- .../test_testing/TestDecorators.py | 16 ++- .../test_testing/test_IDM_10_4.py | 8 +- .../test_testing/test_TC_CCNTL_2_2.py | 4 +- .../test_testing/test_TC_MCORE_FS_1_1.py | 4 +- .../test_testing/test_TC_SC_7_1.py | 9 +- src/tools/PICS-generator/PICSGenerator.py | 6 +- src/tools/PICS-generator/XMLPICSValidator.py | 2 +- src/tools/device-graph/matter-device-graph.py | 4 +- 203 files changed, 391 insertions(+), 495 deletions(-) delete mode 100644 scripts/spec_xml/paths.py rename src/python_testing/{matter_testing_infrastructure/chip/testing/basic_composition.py => basic_composition_support.py} (100%) rename src/python_testing/{matter_testing_infrastructure/chip/testing/choice_conformance.py => choice_conformance_support.py} (93%) rename src/python_testing/{matter_testing_infrastructure/chip/testing/conformance.py => conformance_support.py} (100%) rename src/python_testing/{matter_testing_infrastructure/chip/testing => }/global_attribute_ids.py (100%) rename src/python_testing/{matter_testing_infrastructure/chip/testing/matter_testing.py => matter_testing_support.py} (99%) rename src/python_testing/{matter_testing_infrastructure/chip/testing/pics.py => pics_support.py} (100%) rename src/python_testing/{matter_testing_infrastructure/chip/testing/spec_parsing.py => spec_parsing_support.py} (95%) rename src/python_testing/{matter_testing_infrastructure/chip/testing/taglist_and_topology_test.py => taglist_and_topology_test_support.py} (100%) diff --git a/docs/testing/python.md b/docs/testing/python.md index 4541871dcb..a957074e3c 100644 --- a/docs/testing/python.md +++ b/docs/testing/python.md @@ -25,7 +25,7 @@ Python tests located in src/python_testing section should include various parameters and their respective values, which will guide the test runner on how to execute the tests. - All test classes inherit from `MatterBaseTest` in - [matter_testing.py](https://github.com/project-chip/connectedhomeip/blob/master/src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py) + [matter_testing_support.py](https://github.com/project-chip/connectedhomeip/blob/master/src/python_testing/matter_testing_support.py) - Support for commissioning using the python controller - Default controller (`self.default_controller`) of type `ChipDeviceCtrl` - `MatterBaseTest` inherits from the Mobly BaseTestClass @@ -38,7 +38,7 @@ Python tests located in src/python_testing decorated with the @async_test_body decorator - Use `ChipDeviceCtrl` to interact with the DUT - Controller API is in `ChipDeviceCtrl.py` (see API doc in file) - - Some support methods in `matter_testing.py` + - Some support methods in `matter_testing_support.py` - Use Mobly assertions for failing tests - `self.step()` along with a `steps_*` method to mark test plan steps for cert tests @@ -379,7 +379,7 @@ pai = await dev_ctrl.SendCommand(nodeid, 0, Clusters.OperationalCredentials.Comm ## Mobly helpers The test system is based on Mobly, and the -[matter_testing.py](https://github.com/project-chip/connectedhomeip/blob/master/src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py) +[matter_testing_support.py](https://github.com/project-chip/connectedhomeip/blob/master/src/python_testing/matter_testing_support.py) class provides some helpers for Mobly integration. - `default_matter_test_main` @@ -561,11 +561,11 @@ these steps to set this up: ## Other support utilities -- `basic_composition` +- `basic_composition_support` - wildcard read, whole device analysis - `CommissioningFlowBlocks` - various commissioning support for core tests -- `spec_parsing` +- `spec_parsing_support` - parsing data model XML into python readable format # Running tests locally diff --git a/scripts/spec_xml/generate_spec_xml.py b/scripts/spec_xml/generate_spec_xml.py index 43582fdb36..0d41b3f519 100755 --- a/scripts/spec_xml/generate_spec_xml.py +++ b/scripts/spec_xml/generate_spec_xml.py @@ -24,17 +24,26 @@ from pathlib import Path import click -from paths import Branch, get_chip_root, get_data_model_path, get_documentation_file_path, get_in_progress_defines -# Use the get_in_progress_defines() function to fetch the in-progress defines -CURRENT_IN_PROGRESS_DEFINES = get_in_progress_defines() - -# Replace hardcoded paths with dynamic paths using paths.py functions -DEFAULT_CHIP_ROOT = get_chip_root() -DEFAULT_OUTPUT_DIR_1_3 = get_data_model_path(Branch.V1_3) -DEFAULT_OUTPUT_DIR_IN_PROGRESS = get_data_model_path(Branch.IN_PROGRESS) -DEFAULT_OUTPUT_DIR_TOT = get_data_model_path(Branch.MASTER) -DEFAULT_DOCUMENTATION_FILE = get_documentation_file_path() +DEFAULT_CHIP_ROOT = os.path.abspath( + os.path.join(os.path.dirname(__file__), '..', '..')) +DEFAULT_OUTPUT_DIR_1_3 = os.path.abspath( + os.path.join(DEFAULT_CHIP_ROOT, 'data_model', '1.3')) +DEFAULT_OUTPUT_DIR_IN_PROGRESS = os.path.abspath( + os.path.join(DEFAULT_CHIP_ROOT, 'data_model', 'in_progress')) +DEFAULT_OUTPUT_DIR_TOT = os.path.abspath( + os.path.join(DEFAULT_CHIP_ROOT, 'data_model', 'master')) +DEFAULT_DOCUMENTATION_FILE = os.path.abspath( + os.path.join(DEFAULT_CHIP_ROOT, 'docs', 'spec_clusters.md')) + +# questions +# is energy-calendar still in? +# is heat-pump out? wasn't in 0.7 +# location-cluster - is this define gone now? +# queuedpreset - is this define gone now? +CURRENT_IN_PROGRESS_DEFINES = ['aliro', 'atomicwrites', 'battery-storage', 'device-location', 'e2e-jf', 'energy-calendar', 'energy-drlc', + 'energy-management', 'heat-pump', 'hrap-1', 'hvac', 'matter-fabric-synchronization', 'metering', 'secondary-net', + 'service-area-cluster', 'solar-power', 'tcp', 'water-heater', 'wifiSetup'] def get_xml_path(filename, output_dir): @@ -81,6 +90,7 @@ def make_asciidoc(target: str, include_in_progress: str, spec_dir: str, dry_run: '--include-in-progress', type=click.Choice(['All', 'None', 'Current']), default='All') def main(scraper, spec_root, output_dir, dry_run, include_in_progress): + # Clusters need to be scraped first because the cluster directory is passed to the device type directory if not output_dir: output_dir_map = {'All': DEFAULT_OUTPUT_DIR_TOT, 'None': DEFAULT_OUTPUT_DIR_1_3, 'Current': DEFAULT_OUTPUT_DIR_IN_PROGRESS} output_dir = output_dir_map[include_in_progress] @@ -93,28 +103,30 @@ def main(scraper, spec_root, output_dir, dry_run, include_in_progress): def scrape_clusters(scraper, spec_root, output_dir, dry_run, include_in_progress): src_dir = os.path.abspath(os.path.join(spec_root, 'src')) - sdm_clusters_dir = os.path.abspath(os.path.join(src_dir, 'service_device_management')) + sdm_clusters_dir = os.path.abspath( + os.path.join(src_dir, 'service_device_management')) app_clusters_dir = os.path.abspath(os.path.join(src_dir, 'app_clusters')) dm_clusters_dir = os.path.abspath(os.path.join(src_dir, 'data_model')) - media_clusters_dir = os.path.abspath(os.path.join(app_clusters_dir, 'media')) - - clusters_output_dir = os.path.join(output_dir, 'clusters') + media_clusters_dir = os.path.abspath( + os.path.join(app_clusters_dir, 'media')) + clusters_output_dir = os.path.abspath(os.path.join(output_dir, 'clusters')) if not os.path.exists(clusters_output_dir): os.makedirs(clusters_output_dir) - print('Generating main spec to get file include list - this may take a few minutes') + print('Generating main spec to get file include list - this make take a few minutes') main_out = make_asciidoc('pdf', include_in_progress, spec_root, dry_run) - print('Generating cluster spec to get file include list - this may take a few minutes') + print('Generating cluster spec to get file include list - this make take a few minutes') cluster_out = make_asciidoc('pdf-appclusters-book', include_in_progress, spec_root, dry_run) def scrape_cluster(filename: str) -> None: base = Path(filename).stem if base not in main_out and base not in cluster_out: - print(f'Skipping file: {base} as it is not compiled into the asciidoc') + print(f'skipping file: {base} as it is not compiled into the asciidoc') return xml_path = get_xml_path(filename, clusters_output_dir) - cmd = [scraper, 'cluster', '-i', filename, '-o', xml_path, '-nd'] + cmd = [scraper, 'cluster', '-i', filename, '-o', + xml_path, '-nd'] if include_in_progress == 'All': cmd.extend(['--define', 'in-progress']) elif include_in_progress == 'Current': @@ -138,29 +150,33 @@ def scrape_all_clusters(dir: str, exclude_list: list[str] = []) -> None: tree = ElementTree.parse(f'{xml_path}') root = tree.getroot() cluster = next(root.iter('cluster')) + # If there's no cluster ID table, this isn't a cluster try: next(cluster.iter('clusterIds')) except StopIteration: + # If there's no cluster ID table, this isn't a cluster just some kind of intro adoc print(f'Removing file {xml_path} as it does not include any cluster definitions') os.remove(xml_path) continue def scrape_device_types(scraper, spec_root, output_dir, dry_run, include_in_progress): - device_type_dir = os.path.abspath(os.path.join(spec_root, 'src', 'device_types')) - device_types_output_dir = os.path.abspath(os.path.join(output_dir, 'device_types')) + device_type_dir = os.path.abspath( + os.path.join(spec_root, 'src', 'device_types')) + device_types_output_dir = os.path.abspath( + os.path.join(output_dir, 'device_types')) clusters_output_dir = os.path.abspath(os.path.join(output_dir, 'clusters')) if not os.path.exists(device_types_output_dir): os.makedirs(device_types_output_dir) - print('Generating device type library to get file include list - this may take a few minutes') + print('Generating device type library to get file include list - this make take a few minutes') device_type_output = make_asciidoc('pdf-devicelibrary-book', include_in_progress, spec_root, dry_run) def scrape_device_type(filename: str) -> None: base = Path(filename).stem if base not in device_type_output: - print(f'Skipping file: {filename} as it is not compiled into the asciidoc') + print(f'skipping file: {filename} as it is not compiled into the asciidoc') return xml_path = get_xml_path(filename, device_types_output_dir) cmd = [scraper, 'devicetype', '-c', '-cls', clusters_output_dir, diff --git a/scripts/spec_xml/paths.py b/scripts/spec_xml/paths.py deleted file mode 100644 index 3a5159cc51..0000000000 --- a/scripts/spec_xml/paths.py +++ /dev/null @@ -1,109 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright (c) 2024 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os -from enum import Enum - -# Define a branch enum for different versions or branches - - -class Branch(Enum): - MASTER = "master" - V1_3 = "v1_3" - V1_4 = "v1_4" - IN_PROGRESS = "in_progress" - - -def get_chip_root(): - """ - Returns the CHIP root directory, trying the environment variable first - and falling back if necessary. - """ - chip_root = os.getenv('PW_PROJECT_ROOT') - if chip_root: - return chip_root - else: - try: - return os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')) - except Exception as e: - raise EnvironmentError( - "Unable to determine CHIP root directory. Please ensure the environment is activated." - ) from e - - -def get_data_model_path(branch: Branch): - """ - Returns the path to the data model directory for a given branch. - """ - chip_root = get_chip_root() - data_model_path = os.path.join(chip_root, 'data_model', branch.value) - if not os.path.exists(data_model_path): - raise FileNotFoundError(f"Data model path for branch {branch} does not exist: {data_model_path}") - return data_model_path - - -def get_spec_xml_output_path(): - """ - Returns the path to the output directory for generated XML files. - """ - chip_root = get_chip_root() - output_dir = os.path.join(chip_root, 'out', 'spec_xml') - if not os.path.exists(output_dir): - os.makedirs(output_dir) # Automatically create the directory if it doesn't exist - return output_dir - - -def get_documentation_file_path(): - """ - Returns the path to the documentation file. - """ - chip_root = get_chip_root() - documentation_file = os.path.join(chip_root, 'docs', 'spec_clusters.md') - if not os.path.exists(documentation_file): - raise FileNotFoundError(f"Documentation file does not exist: {documentation_file}") - return documentation_file - - -def get_python_testing_path(): - """ - Returns the path to the python_testing directory. - """ - chip_root = get_chip_root() - python_testing_path = os.path.join(chip_root, 'src', 'python_testing') - if not os.path.exists(python_testing_path): - raise FileNotFoundError(f"Python testing directory does not exist: {python_testing_path}") - return python_testing_path - - -def get_in_progress_defines(): - """ - Returns a list of defines that are currently in progress. - This can be updated dynamically as needed. - """ - return [ - 'aliro', 'atomicwrites', 'battery-storage', 'device-location', 'e2e-jf', - 'energy-calendar', 'energy-drlc', 'energy-management', 'heat-pump', 'hrap-1', - 'hvac', 'matter-fabric-synchronization', 'metering', 'secondary-net', - 'service-area-cluster', 'solar-power', 'tcp', 'water-heater', 'wifiSetup' - ] - - -def get_available_branches(): - """ - Return a list of available branches for the data model. - This can be expanded or dynamically fetched if necessary. - """ - return [Branch.MASTER, Branch.V1_3, Branch.V1_4] diff --git a/src/python_testing/MinimalRepresentation.py b/src/python_testing/MinimalRepresentation.py index 93ce543e09..c99919a908 100644 --- a/src/python_testing/MinimalRepresentation.py +++ b/src/python_testing/MinimalRepresentation.py @@ -17,10 +17,10 @@ from dataclasses import dataclass, field -from chip.testing.conformance import ConformanceDecision -from chip.testing.global_attribute_ids import GlobalAttributeIds -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from chip.tlv import uint +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 TC_DeviceConformance import DeviceConformanceTests diff --git a/src/python_testing/TCP_Tests.py b/src/python_testing/TCP_Tests.py index 10209346a0..849b3a9c07 100644 --- a/src/python_testing/TCP_Tests.py +++ b/src/python_testing/TCP_Tests.py @@ -33,7 +33,7 @@ import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.interaction_model import InteractionModelError -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_ACE_1_2.py b/src/python_testing/TC_ACE_1_2.py index 5a38120561..4955cbd3ff 100644 --- a/src/python_testing/TC_ACE_1_2.py +++ b/src/python_testing/TC_ACE_1_2.py @@ -42,7 +42,7 @@ from chip.clusters.Attribute import EventReadResult, SubscriptionTransaction, TypedAttributePath from chip.exceptions import ChipStackError from chip.interaction_model import Status -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_ACE_1_3.py b/src/python_testing/TC_ACE_1_3.py index 2868d9548f..9e2108896d 100644 --- a/src/python_testing/TC_ACE_1_3.py +++ b/src/python_testing/TC_ACE_1_3.py @@ -38,7 +38,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_ACE_1_4.py b/src/python_testing/TC_ACE_1_4.py index 37577b6270..0afdf03ede 100644 --- a/src/python_testing/TC_ACE_1_4.py +++ b/src/python_testing/TC_ACE_1_4.py @@ -42,7 +42,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts # This test requires several additional command line arguments diff --git a/src/python_testing/TC_ACE_1_5.py b/src/python_testing/TC_ACE_1_5.py index 15c7380d23..9766e9a0c6 100644 --- a/src/python_testing/TC_ACE_1_5.py +++ b/src/python_testing/TC_ACE_1_5.py @@ -40,7 +40,7 @@ import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.interaction_model import Status -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_ACL_2_11.py b/src/python_testing/TC_ACL_2_11.py index e8aa253ae7..9f4aea3218 100644 --- a/src/python_testing/TC_ACL_2_11.py +++ b/src/python_testing/TC_ACL_2_11.py @@ -42,13 +42,13 @@ import queue import chip.clusters as Clusters +from basic_composition_support import arls_populated from chip.clusters.Attribute import EventReadResult, SubscriptionTransaction, ValueDecodeFailure from chip.clusters.ClusterObjects import ALL_ACCEPTED_COMMANDS, ALL_ATTRIBUTES, ALL_CLUSTERS, ClusterEvent from chip.clusters.Objects import AccessControl from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from chip.testing.basic_composition import arls_populated -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_ACL_2_2.py b/src/python_testing/TC_ACL_2_2.py index 6f5ed4760c..219be92b35 100644 --- a/src/python_testing/TC_ACL_2_2.py +++ b/src/python_testing/TC_ACL_2_2.py @@ -32,7 +32,7 @@ # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_AccessChecker.py b/src/python_testing/TC_AccessChecker.py index 5f3b3d69ec..23e8535f51 100644 --- a/src/python_testing/TC_AccessChecker.py +++ b/src/python_testing/TC_AccessChecker.py @@ -23,13 +23,13 @@ from typing import Optional import chip.clusters as Clusters +from basic_composition_support import BasicCompositionTests from chip.interaction_model import Status -from chip.testing.basic_composition import BasicCompositionTests -from chip.testing.global_attribute_ids import GlobalAttributeIds -from chip.testing.matter_testing import (AttributePathLocation, ClusterPathLocation, MatterBaseTest, TestStep, async_test_body, - default_matter_test_main) -from chip.testing.spec_parsing import XmlCluster, build_xml_clusters from chip.tlv import uint +from global_attribute_ids import GlobalAttributeIds +from matter_testing_support import (AttributePathLocation, ClusterPathLocation, MatterBaseTest, TestStep, async_test_body, + default_matter_test_main) +from spec_parsing_support import XmlCluster, build_xml_clusters class AccessTestType(Enum): diff --git a/src/python_testing/TC_BOOLCFG_2_1.py b/src/python_testing/TC_BOOLCFG_2_1.py index 2e90245f47..27e016da52 100644 --- a/src/python_testing/TC_BOOLCFG_2_1.py +++ b/src/python_testing/TC_BOOLCFG_2_1.py @@ -36,7 +36,7 @@ from operator import ior import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_BOOLCFG_3_1.py b/src/python_testing/TC_BOOLCFG_3_1.py index 8ed77f6ba8..4b3156bbe9 100644 --- a/src/python_testing/TC_BOOLCFG_3_1.py +++ b/src/python_testing/TC_BOOLCFG_3_1.py @@ -36,7 +36,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_BOOLCFG_4_1.py b/src/python_testing/TC_BOOLCFG_4_1.py index dfe6aac340..3cd7f3a9b2 100644 --- a/src/python_testing/TC_BOOLCFG_4_1.py +++ b/src/python_testing/TC_BOOLCFG_4_1.py @@ -34,7 +34,7 @@ import logging import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_BOOLCFG_4_2.py b/src/python_testing/TC_BOOLCFG_4_2.py index 093e389dcf..7897847acc 100644 --- a/src/python_testing/TC_BOOLCFG_4_2.py +++ b/src/python_testing/TC_BOOLCFG_4_2.py @@ -40,7 +40,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts sensorTrigger = 0x0080_0000_0000_0000 diff --git a/src/python_testing/TC_BOOLCFG_4_3.py b/src/python_testing/TC_BOOLCFG_4_3.py index 845d8e9d4a..aeb245a9be 100644 --- a/src/python_testing/TC_BOOLCFG_4_3.py +++ b/src/python_testing/TC_BOOLCFG_4_3.py @@ -40,7 +40,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts sensorTrigger = 0x0080_0000_0000_0000 diff --git a/src/python_testing/TC_BOOLCFG_4_4.py b/src/python_testing/TC_BOOLCFG_4_4.py index c585b14a84..66a1d06c05 100644 --- a/src/python_testing/TC_BOOLCFG_4_4.py +++ b/src/python_testing/TC_BOOLCFG_4_4.py @@ -40,7 +40,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts sensorTrigger = 0x0080_0000_0000_0000 diff --git a/src/python_testing/TC_BOOLCFG_5_1.py b/src/python_testing/TC_BOOLCFG_5_1.py index ec31d8341b..cef0eae01b 100644 --- a/src/python_testing/TC_BOOLCFG_5_1.py +++ b/src/python_testing/TC_BOOLCFG_5_1.py @@ -40,7 +40,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts sensorTrigger = 0x0080_0000_0000_0000 diff --git a/src/python_testing/TC_BOOLCFG_5_2.py b/src/python_testing/TC_BOOLCFG_5_2.py index fd6b88370d..6ab8c82be6 100644 --- a/src/python_testing/TC_BOOLCFG_5_2.py +++ b/src/python_testing/TC_BOOLCFG_5_2.py @@ -40,7 +40,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts sensorTrigger = 0x0080_0000_0000_0000 diff --git a/src/python_testing/TC_BRBINFO_4_1.py b/src/python_testing/TC_BRBINFO_4_1.py index f5eeec3344..07b6fc2745 100644 --- a/src/python_testing/TC_BRBINFO_4_1.py +++ b/src/python_testing/TC_BRBINFO_4_1.py @@ -53,7 +53,7 @@ from chip import ChipDeviceCtrl from chip.interaction_model import InteractionModelError, Status from chip.testing.apps import IcdAppServerSubprocess -from chip.testing.matter_testing import MatterBaseTest, SimpleEventCallback, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, SimpleEventCallback, TestStep, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_CADMIN_1_9.py b/src/python_testing/TC_CADMIN_1_9.py index b3b09afad3..060a540017 100644 --- a/src/python_testing/TC_CADMIN_1_9.py +++ b/src/python_testing/TC_CADMIN_1_9.py @@ -40,7 +40,7 @@ from chip.ChipDeviceCtrl import CommissioningParameters from chip.exceptions import ChipStackError from chip.native import PyChipError -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_CCTRL_2_1.py b/src/python_testing/TC_CCTRL_2_1.py index b656973f6a..c689dd649b 100644 --- a/src/python_testing/TC_CCTRL_2_1.py +++ b/src/python_testing/TC_CCTRL_2_1.py @@ -38,7 +38,7 @@ # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, default_matter_test_main, has_cluster, run_if_endpoint_matches +from matter_testing_support import MatterBaseTest, TestStep, default_matter_test_main, has_cluster, run_if_endpoint_matches from mobly import asserts diff --git a/src/python_testing/TC_CCTRL_2_2.py b/src/python_testing/TC_CCTRL_2_2.py index a2e7b15dc2..76e8e83c92 100644 --- a/src/python_testing/TC_CCTRL_2_2.py +++ b/src/python_testing/TC_CCTRL_2_2.py @@ -50,8 +50,8 @@ from chip import ChipDeviceCtrl from chip.interaction_model import InteractionModelError, Status from chip.testing.apps import AppServerSubprocess -from chip.testing.matter_testing import (MatterBaseTest, TestStep, async_test_body, default_matter_test_main, has_cluster, - run_if_endpoint_matches) +from matter_testing_support import (MatterBaseTest, TestStep, async_test_body, default_matter_test_main, has_cluster, + run_if_endpoint_matches) from mobly import asserts diff --git a/src/python_testing/TC_CCTRL_2_3.py b/src/python_testing/TC_CCTRL_2_3.py index fe7ed3de40..07d5706a22 100644 --- a/src/python_testing/TC_CCTRL_2_3.py +++ b/src/python_testing/TC_CCTRL_2_3.py @@ -50,8 +50,8 @@ from chip import ChipDeviceCtrl from chip.interaction_model import InteractionModelError, Status from chip.testing.apps import AppServerSubprocess -from chip.testing.matter_testing import (MatterBaseTest, TestStep, async_test_body, default_matter_test_main, has_cluster, - run_if_endpoint_matches) +from matter_testing_support import (MatterBaseTest, TestStep, async_test_body, default_matter_test_main, has_cluster, + run_if_endpoint_matches) from mobly import asserts diff --git a/src/python_testing/TC_CC_10_1.py b/src/python_testing/TC_CC_10_1.py index c2c76ecde0..2cbbf0fe9a 100644 --- a/src/python_testing/TC_CC_10_1.py +++ b/src/python_testing/TC_CC_10_1.py @@ -41,7 +41,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts kCCAttributeValueIDs = [0x0001, 0x0003, 0x0004, 0x0007, 0x4000, 0x4001, 0x4002, 0x4003, 0x4004] diff --git a/src/python_testing/TC_CC_2_2.py b/src/python_testing/TC_CC_2_2.py index f974364115..647bee1528 100644 --- a/src/python_testing/TC_CC_2_2.py +++ b/src/python_testing/TC_CC_2_2.py @@ -41,8 +41,8 @@ import chip.clusters as Clusters from chip.clusters import ClusterObjects as ClusterObjects -from chip.testing.matter_testing import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, default_matter_test_main, - has_cluster, run_if_endpoint_matches) +from matter_testing_support import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, default_matter_test_main, + has_cluster, run_if_endpoint_matches) from mobly import asserts from test_plan_support import commission_if_required, read_attribute, verify_success @@ -88,8 +88,7 @@ def entry_count_verification(reportList: str) -> str: 14, f'{THcommand} MoveHue with _MoveMode_ field set to Down, _Rate_ field set to 255 and remaining fields set to 0', verify_success()), TestStep( 15, f'{THcommand} MoveSaturation with _MoveMode_ field set to Down, _Rate_ field set to 255 and remaining fields set to 0', verify_success()), - TestStep(16, f'{ - THcommand} MoveToHue with _Hue_ field set to 254, _TransitionTime_ field set to 100, _Direction_ field set to Shortest and remaining fields set to 0', verify_success()), + TestStep(16, f'{THcommand} MoveToHue with _Hue_ field set to 254, _TransitionTime_ field set to 100, _Direction_ field set to Shortest and remaining fields set to 0', verify_success()), TestStep(17, store_values('reportedCurrentHueValuesList', 'CurrentHue')), TestStep(18, verify_entry_count('reportedCurrentHueValuesList', 'CurrentHue'), entry_count_verification('reportedCurrentHueValuesList')), diff --git a/src/python_testing/TC_CGEN_2_4.py b/src/python_testing/TC_CGEN_2_4.py index 7db0ddca28..1cf2f7e8a0 100644 --- a/src/python_testing/TC_CGEN_2_4.py +++ b/src/python_testing/TC_CGEN_2_4.py @@ -46,7 +46,7 @@ from chip.ChipDeviceCtrl import CommissioningParameters from chip.exceptions import ChipStackError from chip.native import PyChipError -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts # Commissioning stage numbers - we should find a better way to match these to the C++ code diff --git a/src/python_testing/TC_CNET_1_4.py b/src/python_testing/TC_CNET_1_4.py index 2c69456e86..7e19f8dee9 100644 --- a/src/python_testing/TC_CNET_1_4.py +++ b/src/python_testing/TC_CNET_1_4.py @@ -38,7 +38,7 @@ import logging import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts kRootEndpointId = 0 diff --git a/src/python_testing/TC_CNET_4_4.py b/src/python_testing/TC_CNET_4_4.py index 223cfdf588..12407e6c5f 100644 --- a/src/python_testing/TC_CNET_4_4.py +++ b/src/python_testing/TC_CNET_4_4.py @@ -22,7 +22,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts diff --git a/src/python_testing/TC_DA_1_2.py b/src/python_testing/TC_DA_1_2.py index 9bf08fe72a..9fa60cd8bf 100644 --- a/src/python_testing/TC_DA_1_2.py +++ b/src/python_testing/TC_DA_1_2.py @@ -40,10 +40,8 @@ import re import chip.clusters as Clusters +from basic_composition_support import BasicCompositionTests from chip.interaction_model import InteractionModelError, Status -from chip.testing.basic_composition import BasicCompositionTests -from chip.testing.matter_testing import (MatterBaseTest, TestStep, async_test_body, default_matter_test_main, hex_from_bytes, - type_matches) from chip.tlv import TLVReader from cryptography import x509 from cryptography.exceptions import InvalidSignature @@ -51,6 +49,7 @@ from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.asymmetric import ec, utils from ecdsa.curves import curve_by_name +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, hex_from_bytes, type_matches from mobly import asserts from pyasn1.codec.der.decoder import decode as der_decoder from pyasn1.error import PyAsn1Error diff --git a/src/python_testing/TC_DA_1_5.py b/src/python_testing/TC_DA_1_5.py index e8e6ce773c..c08f4eb4ef 100644 --- a/src/python_testing/TC_DA_1_5.py +++ b/src/python_testing/TC_DA_1_5.py @@ -40,12 +40,12 @@ import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, hex_from_bytes, type_matches from chip.tlv import TLVReader from cryptography import x509 from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.asymmetric import ec, utils from ecdsa.curves import curve_by_name +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, hex_from_bytes, type_matches from mobly import asserts from pyasn1.codec.der.decoder import decode as der_decoder from pyasn1.error import PyAsn1Error diff --git a/src/python_testing/TC_DA_1_7.py b/src/python_testing/TC_DA_1_7.py index 6678080a60..1130a7b423 100644 --- a/src/python_testing/TC_DA_1_7.py +++ b/src/python_testing/TC_DA_1_7.py @@ -41,13 +41,13 @@ from typing import List, Optional import chip.clusters as Clusters -from chip.testing.matter_testing import (MatterBaseTest, TestStep, async_test_body, bytes_from_hex, default_matter_test_main, - hex_from_bytes) from cryptography.exceptions import InvalidSignature from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.asymmetric import ec from cryptography.hazmat.primitives.serialization import Encoding, PublicFormat from cryptography.x509 import AuthorityKeyIdentifier, Certificate, SubjectKeyIdentifier, load_der_x509_certificate +from matter_testing_support import (MatterBaseTest, TestStep, async_test_body, bytes_from_hex, default_matter_test_main, + hex_from_bytes) from mobly import asserts # Those are SDK samples that are known to be non-production. diff --git a/src/python_testing/TC_DEMTestBase.py b/src/python_testing/TC_DEMTestBase.py index 49c8c6a637..da51ba2528 100644 --- a/src/python_testing/TC_DEMTestBase.py +++ b/src/python_testing/TC_DEMTestBase.py @@ -19,7 +19,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import utc_time_in_matter_epoch +from matter_testing_support import utc_time_in_matter_epoch from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_DEM_2_1.py b/src/python_testing/TC_DEM_2_1.py index 851099cb8e..4975d3ae29 100644 --- a/src/python_testing/TC_DEM_2_1.py +++ b/src/python_testing/TC_DEM_2_1.py @@ -49,7 +49,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_10.py b/src/python_testing/TC_DEM_2_10.py index 810efdbfa2..8f2e0baf35 100644 --- a/src/python_testing/TC_DEM_2_10.py +++ b/src/python_testing/TC_DEM_2_10.py @@ -50,8 +50,8 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from chip.testing.matter_testing import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, async_test_body, - default_matter_test_main) +from matter_testing_support import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, async_test_body, + default_matter_test_main) from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_2.py b/src/python_testing/TC_DEM_2_2.py index 168417dd98..b5e26e4336 100644 --- a/src/python_testing/TC_DEM_2_2.py +++ b/src/python_testing/TC_DEM_2_2.py @@ -52,7 +52,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_3.py b/src/python_testing/TC_DEM_2_3.py index c5699c0318..25398b41ea 100644 --- a/src/python_testing/TC_DEM_2_3.py +++ b/src/python_testing/TC_DEM_2_3.py @@ -46,7 +46,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_4.py b/src/python_testing/TC_DEM_2_4.py index 1b591cd438..6a396fc3a3 100644 --- a/src/python_testing/TC_DEM_2_4.py +++ b/src/python_testing/TC_DEM_2_4.py @@ -47,7 +47,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import Status -from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_5.py b/src/python_testing/TC_DEM_2_5.py index c845ec1997..f7f7d75d53 100644 --- a/src/python_testing/TC_DEM_2_5.py +++ b/src/python_testing/TC_DEM_2_5.py @@ -49,7 +49,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_6.py b/src/python_testing/TC_DEM_2_6.py index 32dea4af4f..2e2a96f92b 100644 --- a/src/python_testing/TC_DEM_2_6.py +++ b/src/python_testing/TC_DEM_2_6.py @@ -49,7 +49,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_7.py b/src/python_testing/TC_DEM_2_7.py index 44c65fbc58..36e7ab984a 100644 --- a/src/python_testing/TC_DEM_2_7.py +++ b/src/python_testing/TC_DEM_2_7.py @@ -49,7 +49,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_8.py b/src/python_testing/TC_DEM_2_8.py index 016778fdf1..1f3d240b22 100644 --- a/src/python_testing/TC_DEM_2_8.py +++ b/src/python_testing/TC_DEM_2_8.py @@ -49,7 +49,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_9.py b/src/python_testing/TC_DEM_2_9.py index 05111e3b8f..4541b9cc6e 100644 --- a/src/python_testing/TC_DEM_2_9.py +++ b/src/python_testing/TC_DEM_2_9.py @@ -48,7 +48,7 @@ import logging import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DGGEN_2_4.py b/src/python_testing/TC_DGGEN_2_4.py index 17b068452c..27542e651d 100644 --- a/src/python_testing/TC_DGGEN_2_4.py +++ b/src/python_testing/TC_DGGEN_2_4.py @@ -40,9 +40,8 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError -from chip.testing.matter_testing import (MatterBaseTest, async_test_body, default_matter_test_main, - matter_epoch_us_from_utc_datetime, utc_datetime_from_matter_epoch_us, - utc_datetime_from_posix_time_ms) +from matter_testing_support import (MatterBaseTest, async_test_body, default_matter_test_main, matter_epoch_us_from_utc_datetime, + utc_datetime_from_matter_epoch_us, utc_datetime_from_posix_time_ms) from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_DGGEN_3_2.py b/src/python_testing/TC_DGGEN_3_2.py index 58c333e8b4..7e5af6c7a5 100644 --- a/src/python_testing/TC_DGGEN_3_2.py +++ b/src/python_testing/TC_DGGEN_3_2.py @@ -16,7 +16,7 @@ # import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_DGSW_2_1.py b/src/python_testing/TC_DGSW_2_1.py index 6338932725..46ed696da9 100644 --- a/src/python_testing/TC_DGSW_2_1.py +++ b/src/python_testing/TC_DGSW_2_1.py @@ -36,7 +36,7 @@ # import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_DRLK_2_12.py b/src/python_testing/TC_DRLK_2_12.py index 342fbc64f6..cf63bd810a 100644 --- a/src/python_testing/TC_DRLK_2_12.py +++ b/src/python_testing/TC_DRLK_2_12.py @@ -35,8 +35,8 @@ # quiet: true # === END CI TEST ARGUMENTS === -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from drlk_2_x_common import DRLK_COMMON +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main # Configurable parameters: # - userIndex: userIndex to use when creating a user on the DUT for testing purposes diff --git a/src/python_testing/TC_DRLK_2_13.py b/src/python_testing/TC_DRLK_2_13.py index 809e278517..dc1b69da22 100644 --- a/src/python_testing/TC_DRLK_2_13.py +++ b/src/python_testing/TC_DRLK_2_13.py @@ -43,7 +43,7 @@ from chip.clusters.Attribute import EventPriority from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_DRLK_2_2.py b/src/python_testing/TC_DRLK_2_2.py index f9f192f18e..84a511b98d 100644 --- a/src/python_testing/TC_DRLK_2_2.py +++ b/src/python_testing/TC_DRLK_2_2.py @@ -35,8 +35,8 @@ # quiet: true # === END CI TEST ARGUMENTS === -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from drlk_2_x_common import DRLK_COMMON +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main # Configurable parameters: # - userIndex: userIndex to use when creating a user on the DUT for testing purposes diff --git a/src/python_testing/TC_DRLK_2_3.py b/src/python_testing/TC_DRLK_2_3.py index 114f41ab9c..75690865cf 100644 --- a/src/python_testing/TC_DRLK_2_3.py +++ b/src/python_testing/TC_DRLK_2_3.py @@ -35,8 +35,8 @@ # quiet: true # === END CI TEST ARGUMENTS === -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from drlk_2_x_common import DRLK_COMMON +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main # Configurable parameters: # - userIndex: userIndex to use when creating a user on the DUT for testing purposes diff --git a/src/python_testing/TC_DRLK_2_5.py b/src/python_testing/TC_DRLK_2_5.py index 84451d2600..defe78eafd 100644 --- a/src/python_testing/TC_DRLK_2_5.py +++ b/src/python_testing/TC_DRLK_2_5.py @@ -38,7 +38,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_DRLK_2_9.py b/src/python_testing/TC_DRLK_2_9.py index fb294b724f..b92eaf42b5 100644 --- a/src/python_testing/TC_DRLK_2_9.py +++ b/src/python_testing/TC_DRLK_2_9.py @@ -41,8 +41,8 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from drlk_2_x_common import DRLK_COMMON +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_DeviceBasicComposition.py b/src/python_testing/TC_DeviceBasicComposition.py index e0e9d86320..9ff05d4ab0 100644 --- a/src/python_testing/TC_DeviceBasicComposition.py +++ b/src/python_testing/TC_DeviceBasicComposition.py @@ -103,19 +103,19 @@ import chip.clusters as Clusters import chip.clusters.ClusterObjects import chip.tlv +from basic_composition_support import BasicCompositionTests from chip import ChipUtility from chip.clusters.Attribute import ValueDecodeFailure from chip.clusters.ClusterObjects import ClusterAttributeDescriptor, ClusterObjectFieldDescriptor from chip.interaction_model import InteractionModelError, Status -from chip.testing.basic_composition import BasicCompositionTests -from chip.testing.global_attribute_ids import GlobalAttributeIds -from chip.testing.matter_testing import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, MatterBaseTest, TestStep, - async_test_body, default_matter_test_main) -from chip.testing.taglist_and_topology_test import (create_device_type_list_for_root, create_device_type_lists, - find_tag_list_problems, find_tree_roots, flat_list_ok, - get_direct_children_of_root, parts_list_cycles, separate_endpoint_types) from chip.tlv import uint +from global_attribute_ids import GlobalAttributeIds +from matter_testing_support import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, MatterBaseTest, TestStep, + async_test_body, default_matter_test_main) from mobly import asserts +from taglist_and_topology_test_support import (create_device_type_list_for_root, create_device_type_lists, find_tag_list_problems, + find_tree_roots, flat_list_ok, get_direct_children_of_root, parts_list_cycles, + separate_endpoint_types) def check_int_in_range(min_value: int, max_value: int, allow_null: bool = False) -> Callable: @@ -511,14 +511,12 @@ class RequiredMandatoryAttribute: attribute_id=manufacturer_value) if suffix > attribute_standard_range_max and suffix < global_range_min: self.record_error(self.get_test_name(), location=location, - problem=f"Manufacturer attribute in undefined range { - manufacturer_value} in cluster {cluster_id}", + problem=f"Manufacturer attribute in undefined range {manufacturer_value} in cluster {cluster_id}", spec_location=f"Cluster {cluster_id}") success = False elif suffix >= global_range_min: self.record_error(self.get_test_name(), location=location, - problem=f"Manufacturer attribute in global range { - manufacturer_value} in cluster {cluster_id}", + problem=f"Manufacturer attribute in global range {manufacturer_value} in cluster {cluster_id}", spec_location=f"Cluster {cluster_id}") success = False @@ -815,8 +813,7 @@ def test_TC_DESC_2_2(self): for ep, problem in problems.items(): location = AttributePathLocation(endpoint_id=ep, cluster_id=Clusters.Descriptor.id, attribute_id=Clusters.Descriptor.Attributes.TagList.attribute_id) - msg = f'problem on ep {ep}: missing feature = {problem.missing_feature}, missing attribute = { - problem.missing_attribute}, duplicates = {problem.duplicates}, same_tags = {problem.same_tag}' + msg = f'problem on ep {ep}: missing feature = {problem.missing_feature}, missing attribute = {problem.missing_attribute}, duplicates = {problem.duplicates}, same_tags = {problem.same_tag}' self.record_error(self.get_test_name(), location=location, problem=msg, spec_location="Descriptor TagList") self.print_step(2, "Identify all the direct children of the root node endpoint") diff --git a/src/python_testing/TC_DeviceConformance.py b/src/python_testing/TC_DeviceConformance.py index a3e350bdfb..8e700b49ab 100644 --- a/src/python_testing/TC_DeviceConformance.py +++ b/src/python_testing/TC_DeviceConformance.py @@ -39,16 +39,16 @@ from typing import Callable import chip.clusters as Clusters -from chip.testing.basic_composition import BasicCompositionTests -from chip.testing.choice_conformance import (evaluate_attribute_choice_conformance, evaluate_command_choice_conformance, - evaluate_feature_choice_conformance) -from chip.testing.conformance import ConformanceDecision, conformance_allowed -from chip.testing.global_attribute_ids import (ClusterIdType, DeviceTypeIdType, GlobalAttributeIds, cluster_id_type, - device_type_id_type, is_valid_device_type_id) -from chip.testing.matter_testing import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, DeviceTypePathLocation, - MatterBaseTest, ProblemNotice, ProblemSeverity, async_test_body, default_matter_test_main) -from chip.testing.spec_parsing import CommandType, build_xml_clusters, build_xml_device_types +from basic_composition_support import BasicCompositionTests from chip.tlv import uint +from choice_conformance_support import (evaluate_attribute_choice_conformance, evaluate_command_choice_conformance, + evaluate_feature_choice_conformance) +from conformance_support import ConformanceDecision, conformance_allowed +from global_attribute_ids import (ClusterIdType, DeviceTypeIdType, GlobalAttributeIds, cluster_id_type, device_type_id_type, + is_valid_device_type_id) +from matter_testing_support import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, DeviceTypePathLocation, + MatterBaseTest, ProblemNotice, ProblemSeverity, async_test_body, default_matter_test_main) +from spec_parsing_support import CommandType, build_xml_clusters, build_xml_device_types class DeviceConformanceTests(BasicCompositionTests): diff --git a/src/python_testing/TC_ECOINFO_2_1.py b/src/python_testing/TC_ECOINFO_2_1.py index a0adf75ac4..1cb6ec203a 100644 --- a/src/python_testing/TC_ECOINFO_2_1.py +++ b/src/python_testing/TC_ECOINFO_2_1.py @@ -47,8 +47,8 @@ from chip.clusters.Types import NullValue from chip.interaction_model import Status from chip.testing.apps import AppServerSubprocess -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from chip.tlv import uint +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts diff --git a/src/python_testing/TC_ECOINFO_2_2.py b/src/python_testing/TC_ECOINFO_2_2.py index 403544bf4f..85868a9468 100644 --- a/src/python_testing/TC_ECOINFO_2_2.py +++ b/src/python_testing/TC_ECOINFO_2_2.py @@ -46,7 +46,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status from chip.testing.apps import AppServerSubprocess -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts _DEVICE_TYPE_AGGREGGATOR = 0x000E diff --git a/src/python_testing/TC_EEM_2_1.py b/src/python_testing/TC_EEM_2_1.py index 653bd942a9..0b6b4809a4 100644 --- a/src/python_testing/TC_EEM_2_1.py +++ b/src/python_testing/TC_EEM_2_1.py @@ -43,7 +43,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EnergyReporting_Utils import EnergyReportingBaseTestHelper diff --git a/src/python_testing/TC_EEM_2_2.py b/src/python_testing/TC_EEM_2_2.py index 408cd85adb..6058aa34c5 100644 --- a/src/python_testing/TC_EEM_2_2.py +++ b/src/python_testing/TC_EEM_2_2.py @@ -41,7 +41,7 @@ import time -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EnergyReporting_Utils import EnergyReportingBaseTestHelper diff --git a/src/python_testing/TC_EEM_2_3.py b/src/python_testing/TC_EEM_2_3.py index 69a41b08e0..6e8bd7d9f5 100644 --- a/src/python_testing/TC_EEM_2_3.py +++ b/src/python_testing/TC_EEM_2_3.py @@ -41,7 +41,7 @@ import time -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EnergyReporting_Utils import EnergyReportingBaseTestHelper diff --git a/src/python_testing/TC_EEM_2_4.py b/src/python_testing/TC_EEM_2_4.py index 0f67fb0405..fb5d5f6b36 100644 --- a/src/python_testing/TC_EEM_2_4.py +++ b/src/python_testing/TC_EEM_2_4.py @@ -41,7 +41,7 @@ import time -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EnergyReporting_Utils import EnergyReportingBaseTestHelper diff --git a/src/python_testing/TC_EEM_2_5.py b/src/python_testing/TC_EEM_2_5.py index 43cb2cddf8..1408e2b9f6 100644 --- a/src/python_testing/TC_EEM_2_5.py +++ b/src/python_testing/TC_EEM_2_5.py @@ -41,7 +41,7 @@ import time -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EnergyReporting_Utils import EnergyReportingBaseTestHelper diff --git a/src/python_testing/TC_EEVSE_2_2.py b/src/python_testing/TC_EEVSE_2_2.py index 144bfd82d3..61e52ed0be 100644 --- a/src/python_testing/TC_EEVSE_2_2.py +++ b/src/python_testing/TC_EEVSE_2_2.py @@ -46,7 +46,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EEVSE_Utils import EEVSEBaseTestHelper diff --git a/src/python_testing/TC_EEVSE_2_3.py b/src/python_testing/TC_EEVSE_2_3.py index 6494f4a7f1..92005f345b 100644 --- a/src/python_testing/TC_EEVSE_2_3.py +++ b/src/python_testing/TC_EEVSE_2_3.py @@ -46,7 +46,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import Status -from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EEVSE_Utils import EEVSEBaseTestHelper @@ -191,7 +191,7 @@ def compute_expected_target_time_as_epoch_s(self, minutes_past_midnight): logger.info( f"minutesPastMidnight = {minutes_past_midnight} => " - f"{int(minutes_past_midnight/60)}:{int(minutes_past_midnight % 60)}" + f"{int(minutes_past_midnight/60)}:{int(minutes_past_midnight%60)}" f" Expected target_time = {target_time}") target_time_delta = target_time - \ diff --git a/src/python_testing/TC_EEVSE_2_4.py b/src/python_testing/TC_EEVSE_2_4.py index 10355debd0..aaebf642b1 100644 --- a/src/python_testing/TC_EEVSE_2_4.py +++ b/src/python_testing/TC_EEVSE_2_4.py @@ -45,7 +45,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_EEVSE_Utils import EEVSEBaseTestHelper logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_EEVSE_2_5.py b/src/python_testing/TC_EEVSE_2_5.py index 4571cfb363..b25cfe16ce 100644 --- a/src/python_testing/TC_EEVSE_2_5.py +++ b/src/python_testing/TC_EEVSE_2_5.py @@ -45,7 +45,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import Status -from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_EEVSE_Utils import EEVSEBaseTestHelper logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_EEVSE_2_6.py b/src/python_testing/TC_EEVSE_2_6.py index d66ff60bf6..8f809b4ada 100644 --- a/src/python_testing/TC_EEVSE_2_6.py +++ b/src/python_testing/TC_EEVSE_2_6.py @@ -45,8 +45,8 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from chip.testing.matter_testing import (ClusterAttributeChangeAccumulator, EventChangeCallback, MatterBaseTest, TestStep, - async_test_body, default_matter_test_main) +from matter_testing_support import (ClusterAttributeChangeAccumulator, EventChangeCallback, MatterBaseTest, TestStep, + async_test_body, default_matter_test_main) from mobly import asserts from TC_EEVSE_Utils import EEVSEBaseTestHelper diff --git a/src/python_testing/TC_EPM_2_1.py b/src/python_testing/TC_EPM_2_1.py index 0f3c74e662..f12cafea66 100644 --- a/src/python_testing/TC_EPM_2_1.py +++ b/src/python_testing/TC_EPM_2_1.py @@ -42,7 +42,7 @@ import logging import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EnergyReporting_Utils import EnergyReportingBaseTestHelper @@ -148,8 +148,7 @@ async def test_TC_EPM_2_1(self): "minMeasuredValue must be the same as 1st accuracyRange rangeMin") for index, range_entry in enumerate(measurement.accuracyRanges): - logging.info(f" [{index}] rangeMin: {range_entry.rangeMin} rangeMax: {range_entry.rangeMax} percentMax: {range_entry.percentMax} percentMin: { - range_entry.percentMin} percentTypical: {range_entry.percentTypical} fixedMax: {range_entry.fixedMax} fixedMin: {range_entry.fixedMin} fixedTypical: {range_entry.fixedTypical}") + logging.info(f" [{index}] rangeMin:{range_entry.rangeMin} rangeMax:{range_entry.rangeMax} percentMax:{range_entry.percentMax} percentMin:{range_entry.percentMin} percentTypical:{range_entry.percentTypical} fixedMax:{range_entry.fixedMax} fixedMin:{range_entry.fixedMin} fixedTypical:{range_entry.fixedTypical}") asserts.assert_greater( range_entry.rangeMax, range_entry.rangeMin, "rangeMax should be > rangeMin") if index == 0: diff --git a/src/python_testing/TC_EPM_2_2.py b/src/python_testing/TC_EPM_2_2.py index d817042753..97e9e047d2 100644 --- a/src/python_testing/TC_EPM_2_2.py +++ b/src/python_testing/TC_EPM_2_2.py @@ -42,7 +42,7 @@ import logging import time -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EnergyReporting_Utils import EnergyReportingBaseTestHelper diff --git a/src/python_testing/TC_EWATERHTR_2_1.py b/src/python_testing/TC_EWATERHTR_2_1.py index 82c9e93dad..ced3b16b3d 100644 --- a/src/python_testing/TC_EWATERHTR_2_1.py +++ b/src/python_testing/TC_EWATERHTR_2_1.py @@ -45,7 +45,7 @@ import logging import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EWATERHTRBase import EWATERHTRBase diff --git a/src/python_testing/TC_EWATERHTR_2_2.py b/src/python_testing/TC_EWATERHTR_2_2.py index 1bd7185b1f..11e8d545b5 100644 --- a/src/python_testing/TC_EWATERHTR_2_2.py +++ b/src/python_testing/TC_EWATERHTR_2_2.py @@ -47,7 +47,7 @@ import time import chip.clusters as Clusters -from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EWATERHTRBase import EWATERHTRBase diff --git a/src/python_testing/TC_EWATERHTR_2_3.py b/src/python_testing/TC_EWATERHTR_2_3.py index 0f1c3deae6..5f7df8c160 100644 --- a/src/python_testing/TC_EWATERHTR_2_3.py +++ b/src/python_testing/TC_EWATERHTR_2_3.py @@ -45,7 +45,7 @@ import logging import chip.clusters as Clusters -from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EWATERHTRBase import EWATERHTRBase diff --git a/src/python_testing/TC_FAN_3_1.py b/src/python_testing/TC_FAN_3_1.py index 483be894ba..f8322506e6 100644 --- a/src/python_testing/TC_FAN_3_1.py +++ b/src/python_testing/TC_FAN_3_1.py @@ -39,7 +39,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_FAN_3_2.py b/src/python_testing/TC_FAN_3_2.py index 799510eeea..736c97096e 100644 --- a/src/python_testing/TC_FAN_3_2.py +++ b/src/python_testing/TC_FAN_3_2.py @@ -39,7 +39,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_FAN_3_3.py b/src/python_testing/TC_FAN_3_3.py index 7a4dde3f6c..935811de21 100644 --- a/src/python_testing/TC_FAN_3_3.py +++ b/src/python_testing/TC_FAN_3_3.py @@ -38,7 +38,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_FAN_3_4.py b/src/python_testing/TC_FAN_3_4.py index 989680ed6b..722339357b 100644 --- a/src/python_testing/TC_FAN_3_4.py +++ b/src/python_testing/TC_FAN_3_4.py @@ -38,7 +38,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts # import time diff --git a/src/python_testing/TC_FAN_3_5.py b/src/python_testing/TC_FAN_3_5.py index 26dfc3e52f..d03f99e55f 100644 --- a/src/python_testing/TC_FAN_3_5.py +++ b/src/python_testing/TC_FAN_3_5.py @@ -39,7 +39,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_ICDM_2_1.py b/src/python_testing/TC_ICDM_2_1.py index 8d7f6d5ed8..35d1cb62c0 100644 --- a/src/python_testing/TC_ICDM_2_1.py +++ b/src/python_testing/TC_ICDM_2_1.py @@ -39,7 +39,7 @@ import re import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_ICDM_3_1.py b/src/python_testing/TC_ICDM_3_1.py index 58181a6588..d46d72553d 100644 --- a/src/python_testing/TC_ICDM_3_1.py +++ b/src/python_testing/TC_ICDM_3_1.py @@ -41,7 +41,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_ICDM_3_2.py b/src/python_testing/TC_ICDM_3_2.py index d9800d65b7..924c6f4a01 100644 --- a/src/python_testing/TC_ICDM_3_2.py +++ b/src/python_testing/TC_ICDM_3_2.py @@ -42,7 +42,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_ICDM_3_3.py b/src/python_testing/TC_ICDM_3_3.py index d261e53904..bc1d698071 100644 --- a/src/python_testing/TC_ICDM_3_3.py +++ b/src/python_testing/TC_ICDM_3_3.py @@ -41,7 +41,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_ICDM_3_4.py b/src/python_testing/TC_ICDM_3_4.py index 8ff2a57037..4ebb32525c 100644 --- a/src/python_testing/TC_ICDM_3_4.py +++ b/src/python_testing/TC_ICDM_3_4.py @@ -40,8 +40,8 @@ import time import chip.clusters as Clusters -from chip.testing.matter_testing import (MatterBaseTest, MatterStackState, MatterTestConfig, 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__) diff --git a/src/python_testing/TC_ICDM_5_1.py b/src/python_testing/TC_ICDM_5_1.py index dacfe58c8b..4b7222b690 100644 --- a/src/python_testing/TC_ICDM_5_1.py +++ b/src/python_testing/TC_ICDM_5_1.py @@ -40,7 +40,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mdns_discovery import mdns_discovery from mobly import asserts diff --git a/src/python_testing/TC_ICDManagementCluster.py b/src/python_testing/TC_ICDManagementCluster.py index c0437cb809..07c889a6ea 100644 --- a/src/python_testing/TC_ICDManagementCluster.py +++ b/src/python_testing/TC_ICDManagementCluster.py @@ -42,7 +42,7 @@ from enum import IntEnum import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts # Assumes `--enable-key 000102030405060708090a0b0c0d0e0f` on Linux app command line, or a DUT diff --git a/src/python_testing/TC_IDM_1_2.py b/src/python_testing/TC_IDM_1_2.py index a1db9bac83..7bfb97c22e 100644 --- a/src/python_testing/TC_IDM_1_2.py +++ b/src/python_testing/TC_IDM_1_2.py @@ -44,7 +44,7 @@ from chip import ChipUtility from chip.exceptions import ChipStackError from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, type_matches +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, type_matches from mobly import asserts diff --git a/src/python_testing/TC_IDM_1_4.py b/src/python_testing/TC_IDM_1_4.py index 74194135de..b00de41f37 100644 --- a/src/python_testing/TC_IDM_1_4.py +++ b/src/python_testing/TC_IDM_1_4.py @@ -44,7 +44,7 @@ import chip.clusters as Clusters from chip.exceptions import ChipStackError from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts # If DUT supports `MaxPathsPerInvoke > 1`, additional command line argument diff --git a/src/python_testing/TC_IDM_4_2.py b/src/python_testing/TC_IDM_4_2.py index 0f4cd513e3..d9e876bcd0 100644 --- a/src/python_testing/TC_IDM_4_2.py +++ b/src/python_testing/TC_IDM_4_2.py @@ -44,7 +44,7 @@ from chip.clusters.Attribute import AttributePath, TypedAttributePath from chip.exceptions import ChipStackError from chip.interaction_model import Status -from chip.testing.matter_testing import AttributeChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import AttributeChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts ''' diff --git a/src/python_testing/TC_LVL_2_3.py b/src/python_testing/TC_LVL_2_3.py index d120bb7169..94c33d58c0 100644 --- a/src/python_testing/TC_LVL_2_3.py +++ b/src/python_testing/TC_LVL_2_3.py @@ -41,8 +41,8 @@ import chip.clusters as Clusters import test_plan_support -from chip.testing.matter_testing import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, default_matter_test_main, - has_cluster, run_if_endpoint_matches) +from matter_testing_support import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, default_matter_test_main, + has_cluster, run_if_endpoint_matches) from mobly import asserts diff --git a/src/python_testing/TC_MCORE_FS_1_1.py b/src/python_testing/TC_MCORE_FS_1_1.py index 995a80cd94..a04cbf0cde 100755 --- a/src/python_testing/TC_MCORE_FS_1_1.py +++ b/src/python_testing/TC_MCORE_FS_1_1.py @@ -48,7 +48,7 @@ import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.testing.apps import AppServerSubprocess -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts _DEVICE_TYPE_AGGREGATOR = 0x000E diff --git a/src/python_testing/TC_MCORE_FS_1_2.py b/src/python_testing/TC_MCORE_FS_1_2.py index f806db4d09..a7d318ca65 100644 --- a/src/python_testing/TC_MCORE_FS_1_2.py +++ b/src/python_testing/TC_MCORE_FS_1_2.py @@ -51,8 +51,8 @@ import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.testing.apps import AppServerSubprocess -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches 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 diff --git a/src/python_testing/TC_MCORE_FS_1_3.py b/src/python_testing/TC_MCORE_FS_1_3.py index 2ac1556199..c0b3e83fe3 100644 --- a/src/python_testing/TC_MCORE_FS_1_3.py +++ b/src/python_testing/TC_MCORE_FS_1_3.py @@ -51,7 +51,7 @@ from chip import ChipDeviceCtrl from chip.interaction_model import Status from chip.testing.apps import AppServerSubprocess -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts _DEVICE_TYPE_AGGREGATOR = 0x000E diff --git a/src/python_testing/TC_MCORE_FS_1_4.py b/src/python_testing/TC_MCORE_FS_1_4.py index 795e81cf2f..74a8becdf7 100644 --- a/src/python_testing/TC_MCORE_FS_1_4.py +++ b/src/python_testing/TC_MCORE_FS_1_4.py @@ -50,8 +50,8 @@ from chip import ChipDeviceCtrl from chip.interaction_model import Status from chip.testing.apps import AppServerSubprocess -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from chip.testing.tasks import Subprocess +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts diff --git a/src/python_testing/TC_MCORE_FS_1_5.py b/src/python_testing/TC_MCORE_FS_1_5.py index 59549fd0bc..57ae214a5d 100755 --- a/src/python_testing/TC_MCORE_FS_1_5.py +++ b/src/python_testing/TC_MCORE_FS_1_5.py @@ -51,8 +51,8 @@ import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.testing.apps import AppServerSubprocess -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches 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 diff --git a/src/python_testing/TC_MWOCTRL_2_1.py b/src/python_testing/TC_MWOCTRL_2_1.py index 6f913578cb..57c51fa98d 100644 --- a/src/python_testing/TC_MWOCTRL_2_1.py +++ b/src/python_testing/TC_MWOCTRL_2_1.py @@ -37,7 +37,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts # This test requires several additional command line arguments diff --git a/src/python_testing/TC_MWOCTRL_2_2.py b/src/python_testing/TC_MWOCTRL_2_2.py index 4559689640..35eef081a9 100644 --- a/src/python_testing/TC_MWOCTRL_2_2.py +++ b/src/python_testing/TC_MWOCTRL_2_2.py @@ -39,7 +39,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts # This test requires several additional command line arguments diff --git a/src/python_testing/TC_MWOCTRL_2_4.py b/src/python_testing/TC_MWOCTRL_2_4.py index e05c4a5bd5..9e11724975 100644 --- a/src/python_testing/TC_MWOCTRL_2_4.py +++ b/src/python_testing/TC_MWOCTRL_2_4.py @@ -39,7 +39,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts # This test requires several additional command line arguments diff --git a/src/python_testing/TC_MWOM_1_2.py b/src/python_testing/TC_MWOM_1_2.py index 5cad6ce013..8a7762337e 100644 --- a/src/python_testing/TC_MWOM_1_2.py +++ b/src/python_testing/TC_MWOM_1_2.py @@ -37,7 +37,7 @@ import logging import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_OCC_2_1.py b/src/python_testing/TC_OCC_2_1.py index d831d486d2..885ec6b16c 100644 --- a/src/python_testing/TC_OCC_2_1.py +++ b/src/python_testing/TC_OCC_2_1.py @@ -43,7 +43,7 @@ import logging import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_OCC_2_2.py b/src/python_testing/TC_OCC_2_2.py index bf5e97ea5e..463b8136d5 100644 --- a/src/python_testing/TC_OCC_2_2.py +++ b/src/python_testing/TC_OCC_2_2.py @@ -37,7 +37,7 @@ # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts @@ -133,8 +133,7 @@ async def test_TC_OCC_2_2(self): asserts.assert_equal( (occupancy_sensor_type_bitmap_dut & sensor_bit) != 0, (feature_map & feature_bit) != 0, - f"Feature bit and sensor bitmap must be equal for { - name}(BITMAP: 0x{occupancy_sensor_type_bitmap_dut: 02X}, FEATUREMAP: 0x{feature_map: 02X})" + f"Feature bit and sensor bitmap must be equal for {name} (BITMAP: 0x{occupancy_sensor_type_bitmap_dut:02X}, FEATUREMAP: 0x{feature_map:02X})" ) diff --git a/src/python_testing/TC_OCC_2_3.py b/src/python_testing/TC_OCC_2_3.py index 8d4b53f429..9c6cb80d9a 100644 --- a/src/python_testing/TC_OCC_2_3.py +++ b/src/python_testing/TC_OCC_2_3.py @@ -39,7 +39,7 @@ import logging import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_OCC_3_1.py b/src/python_testing/TC_OCC_3_1.py index cce0a2f697..b6ba0ead01 100644 --- a/src/python_testing/TC_OCC_3_1.py +++ b/src/python_testing/TC_OCC_3_1.py @@ -43,8 +43,8 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from chip.testing.matter_testing import (ClusterAttributeChangeAccumulator, EventChangeCallback, MatterBaseTest, TestStep, - async_test_body, await_sequence_of_reports, default_matter_test_main) +from matter_testing_support import (ClusterAttributeChangeAccumulator, EventChangeCallback, MatterBaseTest, TestStep, + async_test_body, await_sequence_of_reports, default_matter_test_main) from mobly import asserts diff --git a/src/python_testing/TC_OCC_3_2.py b/src/python_testing/TC_OCC_3_2.py index 3a5ca17069..d4e5f18662 100644 --- a/src/python_testing/TC_OCC_3_2.py +++ b/src/python_testing/TC_OCC_3_2.py @@ -44,8 +44,8 @@ import time import chip.clusters as Clusters -from chip.testing.matter_testing import (AttributeValue, ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, - async_test_body, await_sequence_of_reports, default_matter_test_main) +from matter_testing_support import (AttributeValue, ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, async_test_body, + await_sequence_of_reports, default_matter_test_main) from mobly import asserts diff --git a/src/python_testing/TC_OPCREDS_3_1.py b/src/python_testing/TC_OPCREDS_3_1.py index 1506d2a712..be21c6d7d4 100644 --- a/src/python_testing/TC_OPCREDS_3_1.py +++ b/src/python_testing/TC_OPCREDS_3_1.py @@ -42,8 +42,8 @@ from chip import ChipDeviceCtrl from chip.exceptions import ChipStackError from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from chip.tlv import TLVReader, TLVWriter +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_OPCREDS_3_2.py b/src/python_testing/TC_OPCREDS_3_2.py index 2bfc214665..91e2958fb0 100644 --- a/src/python_testing/TC_OPCREDS_3_2.py +++ b/src/python_testing/TC_OPCREDS_3_2.py @@ -36,9 +36,9 @@ # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from chip.tlv import TLVReader from chip.utils import CommissioningBuildingBlocks +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from test_plan_support import (commission_from_existing, commission_if_required, read_attribute, remove_fabric, verify_commissioning_successful, verify_success) diff --git a/src/python_testing/TC_OPSTATE_2_1.py b/src/python_testing/TC_OPSTATE_2_1.py index 060b71d85e..1b6966a09a 100644 --- a/src/python_testing/TC_OPSTATE_2_1.py +++ b/src/python_testing/TC_OPSTATE_2_1.py @@ -37,7 +37,7 @@ # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OPSTATE_2_2.py b/src/python_testing/TC_OPSTATE_2_2.py index f0ed8f214d..8617d3ddd6 100644 --- a/src/python_testing/TC_OPSTATE_2_2.py +++ b/src/python_testing/TC_OPSTATE_2_2.py @@ -38,7 +38,7 @@ # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OPSTATE_2_3.py b/src/python_testing/TC_OPSTATE_2_3.py index d35aa6e61e..3671747dee 100644 --- a/src/python_testing/TC_OPSTATE_2_3.py +++ b/src/python_testing/TC_OPSTATE_2_3.py @@ -39,7 +39,7 @@ import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OPSTATE_2_4.py b/src/python_testing/TC_OPSTATE_2_4.py index ec2c7c17da..d468227781 100644 --- a/src/python_testing/TC_OPSTATE_2_4.py +++ b/src/python_testing/TC_OPSTATE_2_4.py @@ -39,7 +39,7 @@ import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OPSTATE_2_5.py b/src/python_testing/TC_OPSTATE_2_5.py index 89a2462a2b..687f4d21b0 100644 --- a/src/python_testing/TC_OPSTATE_2_5.py +++ b/src/python_testing/TC_OPSTATE_2_5.py @@ -39,7 +39,7 @@ import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OPSTATE_2_6.py b/src/python_testing/TC_OPSTATE_2_6.py index 0b9e1ec3bb..9441569c87 100644 --- a/src/python_testing/TC_OPSTATE_2_6.py +++ b/src/python_testing/TC_OPSTATE_2_6.py @@ -39,7 +39,7 @@ import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OVENOPSTATE_2_1.py b/src/python_testing/TC_OVENOPSTATE_2_1.py index d830a416c0..6bf7226986 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_1.py +++ b/src/python_testing/TC_OVENOPSTATE_2_1.py @@ -38,7 +38,7 @@ import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OVENOPSTATE_2_2.py b/src/python_testing/TC_OVENOPSTATE_2_2.py index 55afad11be..2fa1215bd1 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_2.py +++ b/src/python_testing/TC_OVENOPSTATE_2_2.py @@ -38,7 +38,7 @@ # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OVENOPSTATE_2_3.py b/src/python_testing/TC_OVENOPSTATE_2_3.py index 329bceb1fb..815fcef97b 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_3.py +++ b/src/python_testing/TC_OVENOPSTATE_2_3.py @@ -38,7 +38,7 @@ # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OVENOPSTATE_2_4.py b/src/python_testing/TC_OVENOPSTATE_2_4.py index ffc639390e..892bf28f0d 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_4.py +++ b/src/python_testing/TC_OVENOPSTATE_2_4.py @@ -38,7 +38,7 @@ # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OVENOPSTATE_2_5.py b/src/python_testing/TC_OVENOPSTATE_2_5.py index 42edca72f3..4fd9ef9271 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_5.py +++ b/src/python_testing/TC_OVENOPSTATE_2_5.py @@ -39,7 +39,7 @@ import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OVENOPSTATE_2_6.py b/src/python_testing/TC_OVENOPSTATE_2_6.py index 2770625bb7..db4b390027 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_6.py +++ b/src/python_testing/TC_OVENOPSTATE_2_6.py @@ -39,7 +39,7 @@ import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OpstateCommon.py b/src/python_testing/TC_OpstateCommon.py index 557b7606cc..c697c7ab5f 100644 --- a/src/python_testing/TC_OpstateCommon.py +++ b/src/python_testing/TC_OpstateCommon.py @@ -27,7 +27,7 @@ from chip.clusters.Attribute import EventReadResult, SubscriptionTransaction from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import ClusterAttributeChangeAccumulator, EventChangeCallback, TestStep +from matter_testing_support import ClusterAttributeChangeAccumulator, EventChangeCallback, TestStep from mobly import asserts diff --git a/src/python_testing/TC_PS_2_3.py b/src/python_testing/TC_PS_2_3.py index 13f4420b0a..dbff20e6f4 100644 --- a/src/python_testing/TC_PS_2_3.py +++ b/src/python_testing/TC_PS_2_3.py @@ -38,8 +38,8 @@ import time import chip.clusters as Clusters -from chip.testing.matter_testing import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, async_test_body, - default_matter_test_main) +from matter_testing_support import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, async_test_body, + default_matter_test_main) from mobly import asserts diff --git a/src/python_testing/TC_PWRTL_2_1.py b/src/python_testing/TC_PWRTL_2_1.py index 3de09c6e93..639bd3dd9a 100644 --- a/src/python_testing/TC_PWRTL_2_1.py +++ b/src/python_testing/TC_PWRTL_2_1.py @@ -37,7 +37,7 @@ import logging import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_RR_1_1.py b/src/python_testing/TC_RR_1_1.py index 0cbf0274c5..2785171f94 100644 --- a/src/python_testing/TC_RR_1_1.py +++ b/src/python_testing/TC_RR_1_1.py @@ -45,8 +45,8 @@ import chip.clusters as Clusters from chip.interaction_model import Status as StatusEnum -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from chip.utils import CommissioningBuildingBlocks +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts from TC_SC_3_6 import AttributeChangeAccumulator, ResubscriptionCatcher diff --git a/src/python_testing/TC_RVCCLEANM_1_2.py b/src/python_testing/TC_RVCCLEANM_1_2.py index 3dfd75f4f4..9e4bca4762 100644 --- a/src/python_testing/TC_RVCCLEANM_1_2.py +++ b/src/python_testing/TC_RVCCLEANM_1_2.py @@ -39,7 +39,7 @@ import logging import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_RVCCLEANM_2_1.py b/src/python_testing/TC_RVCCLEANM_2_1.py index 5234a74685..2c4ddd1dc7 100644 --- a/src/python_testing/TC_RVCCLEANM_2_1.py +++ b/src/python_testing/TC_RVCCLEANM_2_1.py @@ -41,7 +41,7 @@ import logging import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, type_matches +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, type_matches from mobly import asserts # This test requires several additional command line arguments diff --git a/src/python_testing/TC_RVCCLEANM_2_2.py b/src/python_testing/TC_RVCCLEANM_2_2.py index 7352d03e24..5262465555 100644 --- a/src/python_testing/TC_RVCCLEANM_2_2.py +++ b/src/python_testing/TC_RVCCLEANM_2_2.py @@ -39,7 +39,7 @@ import enum import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, type_matches +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, type_matches from mobly import asserts diff --git a/src/python_testing/TC_RVCOPSTATE_2_1.py b/src/python_testing/TC_RVCOPSTATE_2_1.py index 48715c3b7a..ae3e6c3930 100644 --- a/src/python_testing/TC_RVCOPSTATE_2_1.py +++ b/src/python_testing/TC_RVCOPSTATE_2_1.py @@ -40,7 +40,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_RVCOPSTATE_2_3.py b/src/python_testing/TC_RVCOPSTATE_2_3.py index 1b522117b9..60bbed18bd 100644 --- a/src/python_testing/TC_RVCOPSTATE_2_3.py +++ b/src/python_testing/TC_RVCOPSTATE_2_3.py @@ -41,7 +41,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, type_matches +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, type_matches from mobly import asserts diff --git a/src/python_testing/TC_RVCOPSTATE_2_4.py b/src/python_testing/TC_RVCOPSTATE_2_4.py index ad515dbff1..458b3cf740 100644 --- a/src/python_testing/TC_RVCOPSTATE_2_4.py +++ b/src/python_testing/TC_RVCOPSTATE_2_4.py @@ -39,7 +39,7 @@ import logging import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, type_matches +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, type_matches from mobly import asserts diff --git a/src/python_testing/TC_RVCRUNM_1_2.py b/src/python_testing/TC_RVCRUNM_1_2.py index 90db1601b1..d3040fdb6b 100644 --- a/src/python_testing/TC_RVCRUNM_1_2.py +++ b/src/python_testing/TC_RVCRUNM_1_2.py @@ -39,7 +39,7 @@ import logging import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_RVCRUNM_2_1.py b/src/python_testing/TC_RVCRUNM_2_1.py index 55c37c7094..850faf052a 100644 --- a/src/python_testing/TC_RVCRUNM_2_1.py +++ b/src/python_testing/TC_RVCRUNM_2_1.py @@ -41,7 +41,7 @@ import logging import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, type_matches +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, type_matches from mobly import asserts # This test requires several additional command line arguments diff --git a/src/python_testing/TC_RVCRUNM_2_2.py b/src/python_testing/TC_RVCRUNM_2_2.py index e78d6d7f42..f53a75503b 100644 --- a/src/python_testing/TC_RVCRUNM_2_2.py +++ b/src/python_testing/TC_RVCRUNM_2_2.py @@ -41,7 +41,7 @@ import enum import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts # This test requires several additional command line arguments. diff --git a/src/python_testing/TC_SC_3_6.py b/src/python_testing/TC_SC_3_6.py index 8cfbee8e46..74c09e2b72 100644 --- a/src/python_testing/TC_SC_3_6.py +++ b/src/python_testing/TC_SC_3_6.py @@ -45,8 +45,8 @@ import chip.clusters as Clusters from chip.clusters import ClusterObjects as ClustersObjects from chip.clusters.Attribute import SubscriptionTransaction, TypedAttributePath -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from chip.utils import CommissioningBuildingBlocks +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts # TODO: Overall, we need to add validation that session IDs have not changed throughout to be agnostic diff --git a/src/python_testing/TC_SC_7_1.py b/src/python_testing/TC_SC_7_1.py index 315790e980..19229b38ec 100644 --- a/src/python_testing/TC_SC_7_1.py +++ b/src/python_testing/TC_SC_7_1.py @@ -38,13 +38,12 @@ import logging import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts def _trusted_root_test_step(dut_num: int) -> TestStep: - read_trusted_roots_over_pase = f'TH establishes a PASE session to DUT{ - dut_num} using the provided setup code and reads the TrustedRootCertificates attribute from the operational credentials cluster over PASE' + read_trusted_roots_over_pase = f'TH establishes a PASE session to DUT{dut_num} using the provided setup code and reads the TrustedRootCertificates attribute from the operational credentials cluster over PASE' return TestStep(dut_num, read_trusted_roots_over_pase, "List should be empty as the DUT should be in factory reset ") diff --git a/src/python_testing/TC_SEAR_1_2.py b/src/python_testing/TC_SEAR_1_2.py index 41773804e4..41482be51c 100644 --- a/src/python_testing/TC_SEAR_1_2.py +++ b/src/python_testing/TC_SEAR_1_2.py @@ -41,7 +41,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_SEAR_1_3.py b/src/python_testing/TC_SEAR_1_3.py index b55e21d884..9592bce3fe 100644 --- a/src/python_testing/TC_SEAR_1_3.py +++ b/src/python_testing/TC_SEAR_1_3.py @@ -41,7 +41,7 @@ import logging import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts @@ -139,8 +139,7 @@ async def test_TC_SEAR_1_3(self): await self.send_cmd_select_areas_expect_response(step=9, new_areas=valid_areas, expected_response=Clusters.ServiceArea.Enums.SelectAreasStatus.kInvalidInMode) if self.check_pics("SEAR.S.M.VALID_STATE_FOR_SELECT_AREAS") and self.check_pics("SEAR.S.M.HAS_MANUAL_SELAREA_STATE_CONTROL"): - test_step = f"Manually intervene to put the device in a state that allows it to execute the SelectAreas({ - valid_areas}) command" + test_step = f"Manually intervene to put the device in a state that allows it to execute the SelectAreas({valid_areas}) command" self.print_step("10", test_step) if self.is_ci: self.write_to_app_pipe({"Name": "Reset"}) @@ -156,8 +155,7 @@ async def test_TC_SEAR_1_3(self): await self.send_cmd_select_areas_expect_response(step=13, new_areas=valid_areas, expected_response=Clusters.ServiceArea.Enums.SelectAreasStatus.kSuccess) if self.check_pics("SEAR.S.M.VALID_STATE_FOR_SELECT_AREAS") and self.check_pics("SEAR.S.M.HAS_MANUAL_SELAREA_STATE_CONTROL") and self.check_pics("SEAR.S.M.SELECT_AREAS_WHILE_NON_IDLE"): - test_step = f"Manually intervene to put the device in a state that allows it to execute the SelectAreas({ - valid_areas}) command, and put the device in a non-idle state" + test_step = f"Manually intervene to put the device in a state that allows it to execute the SelectAreas({valid_areas}) command, and put the device in a non-idle state" self.print_step("14", test_step) if self.is_ci: self.write_to_app_pipe({"Name": "Reset"}) diff --git a/src/python_testing/TC_SEAR_1_4.py b/src/python_testing/TC_SEAR_1_4.py index cf53f446f9..3f3a84bdf2 100644 --- a/src/python_testing/TC_SEAR_1_4.py +++ b/src/python_testing/TC_SEAR_1_4.py @@ -40,7 +40,7 @@ import logging import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_SEAR_1_5.py b/src/python_testing/TC_SEAR_1_5.py index 130ccb8d59..99da6da78b 100644 --- a/src/python_testing/TC_SEAR_1_5.py +++ b/src/python_testing/TC_SEAR_1_5.py @@ -41,7 +41,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_SEAR_1_6.py b/src/python_testing/TC_SEAR_1_6.py index dc6188a14e..434da00258 100644 --- a/src/python_testing/TC_SEAR_1_6.py +++ b/src/python_testing/TC_SEAR_1_6.py @@ -41,7 +41,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_SWTCH.py b/src/python_testing/TC_SWTCH.py index 3c764c6fe8..7cafaa7b55 100644 --- a/src/python_testing/TC_SWTCH.py +++ b/src/python_testing/TC_SWTCH.py @@ -90,10 +90,10 @@ import test_plan_support from chip.clusters import ClusterObjects as ClusterObjects from chip.clusters.Attribute import EventReadResult -from chip.testing.matter_testing import (AttributeValue, ClusterAttributeChangeAccumulator, EventChangeCallback, MatterBaseTest, - TestStep, await_sequence_of_reports, default_matter_test_main, has_feature, - run_if_endpoint_matches) from chip.tlv import uint +from matter_testing_support import (AttributeValue, ClusterAttributeChangeAccumulator, EventChangeCallback, MatterBaseTest, + TestStep, await_sequence_of_reports, default_matter_test_main, has_feature, + run_if_endpoint_matches) from mobly import asserts logger = logging.getLogger(__name__) @@ -281,8 +281,7 @@ def _expect_no_events_for_cluster(self, event_queue: queue.Queue, endpoint_id: i elapsed = 0.0 time_remaining = timeout_sec - logging.info(f"Waiting {timeout_sec: .1f} seconds for no more events for cluster { - expected_cluster} on endpoint {endpoint_id}") + logging.info(f"Waiting {timeout_sec:.1f} seconds for no more events for cluster {expected_cluster} on endpoint {endpoint_id}") while time_remaining > 0: try: item: EventReadResult = event_queue.get(block=True, timeout=time_remaining) diff --git a/src/python_testing/TC_TIMESYNC_2_1.py b/src/python_testing/TC_TIMESYNC_2_1.py index cb2df9d66a..9858976520 100644 --- a/src/python_testing/TC_TIMESYNC_2_1.py +++ b/src/python_testing/TC_TIMESYNC_2_1.py @@ -41,8 +41,8 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from chip.testing.matter_testing import (MatterBaseTest, default_matter_test_main, has_attribute, has_cluster, - run_if_endpoint_matches, utc_time_in_matter_epoch) +from matter_testing_support import (MatterBaseTest, default_matter_test_main, has_attribute, has_cluster, run_if_endpoint_matches, + utc_time_in_matter_epoch) from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_10.py b/src/python_testing/TC_TIMESYNC_2_10.py index 99ca9f3ac0..b9aa7dabb7 100644 --- a/src/python_testing/TC_TIMESYNC_2_10.py +++ b/src/python_testing/TC_TIMESYNC_2_10.py @@ -43,9 +43,9 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError -from chip.testing.matter_testing import (MatterBaseTest, SimpleEventCallback, async_test_body, default_matter_test_main, - utc_time_in_matter_epoch) from chip.tlv import uint +from matter_testing_support import (MatterBaseTest, SimpleEventCallback, async_test_body, default_matter_test_main, + utc_time_in_matter_epoch) from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_11.py b/src/python_testing/TC_TIMESYNC_2_11.py index 0865bc87f4..1aaed7a14e 100644 --- a/src/python_testing/TC_TIMESYNC_2_11.py +++ b/src/python_testing/TC_TIMESYNC_2_11.py @@ -43,9 +43,9 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError -from chip.testing.matter_testing import (MatterBaseTest, SimpleEventCallback, async_test_body, default_matter_test_main, - get_wait_seconds_from_set_time, type_matches, utc_time_in_matter_epoch) from chip.tlv import uint +from matter_testing_support import (MatterBaseTest, SimpleEventCallback, async_test_body, default_matter_test_main, + get_wait_seconds_from_set_time, type_matches, utc_time_in_matter_epoch) from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_12.py b/src/python_testing/TC_TIMESYNC_2_12.py index 7677dcf184..cd4378fcdc 100644 --- a/src/python_testing/TC_TIMESYNC_2_12.py +++ b/src/python_testing/TC_TIMESYNC_2_12.py @@ -43,9 +43,9 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError -from chip.testing.matter_testing import (MatterBaseTest, SimpleEventCallback, async_test_body, default_matter_test_main, - get_wait_seconds_from_set_time, type_matches, utc_time_in_matter_epoch) from chip.tlv import uint +from matter_testing_support import (MatterBaseTest, SimpleEventCallback, async_test_body, default_matter_test_main, + get_wait_seconds_from_set_time, type_matches, utc_time_in_matter_epoch) from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_13.py b/src/python_testing/TC_TIMESYNC_2_13.py index 8138983030..91c679e14b 100644 --- a/src/python_testing/TC_TIMESYNC_2_13.py +++ b/src/python_testing/TC_TIMESYNC_2_13.py @@ -41,7 +41,7 @@ import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.clusters.Types import NullValue -from chip.testing.matter_testing import MatterBaseTest, SimpleEventCallback, async_test_body, default_matter_test_main, type_matches +from matter_testing_support import MatterBaseTest, SimpleEventCallback, async_test_body, default_matter_test_main, type_matches from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_2.py b/src/python_testing/TC_TIMESYNC_2_2.py index 74f935aac9..dff4bd5f82 100644 --- a/src/python_testing/TC_TIMESYNC_2_2.py +++ b/src/python_testing/TC_TIMESYNC_2_2.py @@ -40,8 +40,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError -from chip.testing.matter_testing import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, - utc_time_in_matter_epoch) +from matter_testing_support import MatterBaseTest, async_test_body, compare_time, default_matter_test_main, utc_time_in_matter_epoch from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_4.py b/src/python_testing/TC_TIMESYNC_2_4.py index 76fe9074be..a367dcad3d 100644 --- a/src/python_testing/TC_TIMESYNC_2_4.py +++ b/src/python_testing/TC_TIMESYNC_2_4.py @@ -40,8 +40,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import (MatterBaseTest, async_test_body, default_matter_test_main, type_matches, - utc_time_in_matter_epoch) +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, type_matches, utc_time_in_matter_epoch from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_5.py b/src/python_testing/TC_TIMESYNC_2_5.py index f363f03ba6..d62797e91e 100644 --- a/src/python_testing/TC_TIMESYNC_2_5.py +++ b/src/python_testing/TC_TIMESYNC_2_5.py @@ -40,7 +40,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, utc_time_in_matter_epoch +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, utc_time_in_matter_epoch from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_6.py b/src/python_testing/TC_TIMESYNC_2_6.py index 0e9ec9f795..f6fe8738f4 100644 --- a/src/python_testing/TC_TIMESYNC_2_6.py +++ b/src/python_testing/TC_TIMESYNC_2_6.py @@ -40,7 +40,7 @@ import chip.clusters as Clusters from chip.clusters.Types import Nullable, NullValue from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_7.py b/src/python_testing/TC_TIMESYNC_2_7.py index 1c6cea2023..edc71545cf 100644 --- a/src/python_testing/TC_TIMESYNC_2_7.py +++ b/src/python_testing/TC_TIMESYNC_2_7.py @@ -42,9 +42,9 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError -from chip.testing.matter_testing import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, type_matches, - utc_time_in_matter_epoch) from chip.tlv import uint +from matter_testing_support import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, type_matches, + utc_time_in_matter_epoch) from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_8.py b/src/python_testing/TC_TIMESYNC_2_8.py index 82a77c4c88..07785346c7 100644 --- a/src/python_testing/TC_TIMESYNC_2_8.py +++ b/src/python_testing/TC_TIMESYNC_2_8.py @@ -42,9 +42,9 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError -from chip.testing.matter_testing import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, type_matches, - utc_time_in_matter_epoch) from chip.tlv import uint +from matter_testing_support import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, type_matches, + utc_time_in_matter_epoch) from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_9.py b/src/python_testing/TC_TIMESYNC_2_9.py index 4ce83f81dd..1f439b84e6 100644 --- a/src/python_testing/TC_TIMESYNC_2_9.py +++ b/src/python_testing/TC_TIMESYNC_2_9.py @@ -41,9 +41,9 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError -from chip.testing.matter_testing import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, type_matches, - utc_time_in_matter_epoch) from chip.tlv import uint +from matter_testing_support import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, type_matches, + utc_time_in_matter_epoch) from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_3_1.py b/src/python_testing/TC_TIMESYNC_3_1.py index 4c7c9d9420..3f292d0e85 100644 --- a/src/python_testing/TC_TIMESYNC_3_1.py +++ b/src/python_testing/TC_TIMESYNC_3_1.py @@ -35,7 +35,7 @@ # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_TMP_2_1.py b/src/python_testing/TC_TMP_2_1.py index d0ae9cf86a..f48b96991e 100644 --- a/src/python_testing/TC_TMP_2_1.py +++ b/src/python_testing/TC_TMP_2_1.py @@ -16,7 +16,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_TSTAT_4_2.py b/src/python_testing/TC_TSTAT_4_2.py index 6dad144f30..fa77f94ae7 100644 --- a/src/python_testing/TC_TSTAT_4_2.py +++ b/src/python_testing/TC_TSTAT_4_2.py @@ -43,7 +43,7 @@ from chip.clusters import Globals from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_TestEventTrigger.py b/src/python_testing/TC_TestEventTrigger.py index ae4f64a805..38053540c6 100644 --- a/src/python_testing/TC_TestEventTrigger.py +++ b/src/python_testing/TC_TestEventTrigger.py @@ -43,7 +43,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts # Assumes `--enable-key 000102030405060708090a0b0c0d0e0f` on Linux app command line, or a DUT diff --git a/src/python_testing/TC_VALCC_2_1.py b/src/python_testing/TC_VALCC_2_1.py index d6f00b00a6..a079c88c8b 100644 --- a/src/python_testing/TC_VALCC_2_1.py +++ b/src/python_testing/TC_VALCC_2_1.py @@ -35,7 +35,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_VALCC_3_1.py b/src/python_testing/TC_VALCC_3_1.py index 4b53ab032c..f4c6ebfa14 100644 --- a/src/python_testing/TC_VALCC_3_1.py +++ b/src/python_testing/TC_VALCC_3_1.py @@ -36,7 +36,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_VALCC_3_2.py b/src/python_testing/TC_VALCC_3_2.py index 6905e3bde8..0609051f4e 100644 --- a/src/python_testing/TC_VALCC_3_2.py +++ b/src/python_testing/TC_VALCC_3_2.py @@ -37,7 +37,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_VALCC_3_3.py b/src/python_testing/TC_VALCC_3_3.py index a63053cf34..d90065d5bb 100644 --- a/src/python_testing/TC_VALCC_3_3.py +++ b/src/python_testing/TC_VALCC_3_3.py @@ -37,7 +37,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_VALCC_3_4.py b/src/python_testing/TC_VALCC_3_4.py index 30c57dcb3f..f1363a51f3 100644 --- a/src/python_testing/TC_VALCC_3_4.py +++ b/src/python_testing/TC_VALCC_3_4.py @@ -35,7 +35,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_VALCC_4_1.py b/src/python_testing/TC_VALCC_4_1.py index 9af428d103..a103898567 100644 --- a/src/python_testing/TC_VALCC_4_1.py +++ b/src/python_testing/TC_VALCC_4_1.py @@ -36,7 +36,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_VALCC_4_2.py b/src/python_testing/TC_VALCC_4_2.py index 9365e5bc78..f2f0dd6631 100644 --- a/src/python_testing/TC_VALCC_4_2.py +++ b/src/python_testing/TC_VALCC_4_2.py @@ -36,7 +36,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_VALCC_4_3.py b/src/python_testing/TC_VALCC_4_3.py index b0762d0d88..a66d4eafd4 100644 --- a/src/python_testing/TC_VALCC_4_3.py +++ b/src/python_testing/TC_VALCC_4_3.py @@ -36,7 +36,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_VALCC_4_4.py b/src/python_testing/TC_VALCC_4_4.py index b85ff9a9f0..f6ad63d368 100644 --- a/src/python_testing/TC_VALCC_4_4.py +++ b/src/python_testing/TC_VALCC_4_4.py @@ -36,8 +36,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import (MatterBaseTest, TestStep, async_test_body, default_matter_test_main, - utc_time_in_matter_epoch) +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, utc_time_in_matter_epoch from mobly import asserts diff --git a/src/python_testing/TC_VALCC_4_5.py b/src/python_testing/TC_VALCC_4_5.py index c6b7674c6c..3b850c0804 100644 --- a/src/python_testing/TC_VALCC_4_5.py +++ b/src/python_testing/TC_VALCC_4_5.py @@ -36,7 +36,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_WHM_1_2.py b/src/python_testing/TC_WHM_1_2.py index 2bbcdd5108..9d7d9b2879 100644 --- a/src/python_testing/TC_WHM_1_2.py +++ b/src/python_testing/TC_WHM_1_2.py @@ -41,7 +41,7 @@ import logging import chip.clusters as Clusters -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_WHM_2_1.py b/src/python_testing/TC_WHM_2_1.py index b9dcb0257d..6172ee013f 100644 --- a/src/python_testing/TC_WHM_2_1.py +++ b/src/python_testing/TC_WHM_2_1.py @@ -43,7 +43,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts diff --git a/src/python_testing/TC_pics_checker.py b/src/python_testing/TC_pics_checker.py index 07e8613cc1..91e2102b5e 100644 --- a/src/python_testing/TC_pics_checker.py +++ b/src/python_testing/TC_pics_checker.py @@ -17,13 +17,13 @@ import math import chip.clusters as Clusters -from chip.testing.basic_composition import BasicCompositionTests -from chip.testing.global_attribute_ids import GlobalAttributeIds -from chip.testing.matter_testing import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, FeaturePathLocation, - MatterBaseTest, ProblemLocation, TestStep, async_test_body, default_matter_test_main) -from chip.testing.pics import accepted_cmd_pics_str, attribute_pics_str, feature_pics_str, generated_cmd_pics_str -from chip.testing.spec_parsing import build_xml_clusters +from basic_composition_support import BasicCompositionTests +from global_attribute_ids import GlobalAttributeIds +from matter_testing_support import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, FeaturePathLocation, + MatterBaseTest, ProblemLocation, TestStep, async_test_body, default_matter_test_main) from mobly import asserts +from pics_support import accepted_cmd_pics_str, attribute_pics_str, feature_pics_str, generated_cmd_pics_str +from spec_parsing_support import build_xml_clusters class TC_PICS_Checker(MatterBaseTest, BasicCompositionTests): diff --git a/src/python_testing/TestBatchInvoke.py b/src/python_testing/TestBatchInvoke.py index 6465692c95..a17f7b8be4 100644 --- a/src/python_testing/TestBatchInvoke.py +++ b/src/python_testing/TestBatchInvoke.py @@ -38,7 +38,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, type_matches +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, type_matches from mobly import asserts ''' Integration test of batch commands using UnitTesting Cluster diff --git a/src/python_testing/TestChoiceConformanceSupport.py b/src/python_testing/TestChoiceConformanceSupport.py index 77eca93761..8436bc8418 100644 --- a/src/python_testing/TestChoiceConformanceSupport.py +++ b/src/python_testing/TestChoiceConformanceSupport.py @@ -19,11 +19,11 @@ import xml.etree.ElementTree as ElementTree import jinja2 -from chip.testing.choice_conformance import (evaluate_attribute_choice_conformance, evaluate_command_choice_conformance, - evaluate_feature_choice_conformance) -from chip.testing.matter_testing import MatterBaseTest, ProblemNotice, default_matter_test_main -from chip.testing.spec_parsing import XmlCluster, add_cluster_data_from_xml +from choice_conformance_support import (evaluate_attribute_choice_conformance, evaluate_command_choice_conformance, + evaluate_feature_choice_conformance) +from matter_testing_support import MatterBaseTest, ProblemNotice, default_matter_test_main from mobly import asserts +from spec_parsing_support import XmlCluster, add_cluster_data_from_xml FEATURE_TEMPLATE = '''\ diff --git a/src/python_testing/TestCommissioningTimeSync.py b/src/python_testing/TestCommissioningTimeSync.py index d4033ea58b..dfd03d957d 100644 --- a/src/python_testing/TestCommissioningTimeSync.py +++ b/src/python_testing/TestCommissioningTimeSync.py @@ -20,7 +20,7 @@ from chip import ChipDeviceCtrl from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, utc_time_in_matter_epoch +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, utc_time_in_matter_epoch from mobly import asserts # We don't have a good pipe between the c++ enums in CommissioningDelegate and python diff --git a/src/python_testing/TestConformanceSupport.py b/src/python_testing/TestConformanceSupport.py index ca41bf088e..3744b6fe5e 100644 --- a/src/python_testing/TestConformanceSupport.py +++ b/src/python_testing/TestConformanceSupport.py @@ -18,11 +18,11 @@ import xml.etree.ElementTree as ElementTree from typing import Callable -from chip.testing.conformance import (Choice, Conformance, ConformanceDecision, ConformanceException, ConformanceParseParameters, - deprecated, disallowed, mandatory, optional, parse_basic_callable_from_xml, - parse_callable_from_xml, parse_device_type_callable_from_xml, provisional, zigbee) -from chip.testing.matter_testing import MatterBaseTest, default_matter_test_main from chip.tlv import uint +from conformance_support import (Choice, Conformance, ConformanceDecision, ConformanceException, ConformanceParseParameters, + deprecated, disallowed, mandatory, optional, parse_basic_callable_from_xml, + parse_callable_from_xml, parse_device_type_callable_from_xml, provisional, zigbee) +from matter_testing_support import MatterBaseTest, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TestConformanceTest.py b/src/python_testing/TestConformanceTest.py index ddf3e421a7..f0ff8032ea 100644 --- a/src/python_testing/TestConformanceTest.py +++ b/src/python_testing/TestConformanceTest.py @@ -18,12 +18,12 @@ from typing import Any import chip.clusters as Clusters -from chip.testing.basic_composition import arls_populated -from chip.testing.conformance import ConformanceDecision -from chip.testing.global_attribute_ids import GlobalAttributeIds -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main -from chip.testing.spec_parsing import build_xml_clusters, build_xml_device_types +from basic_composition_support import arls_populated +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 diff --git a/src/python_testing/TestGroupTableReports.py b/src/python_testing/TestGroupTableReports.py index 9d98a050c7..6e3980bcae 100644 --- a/src/python_testing/TestGroupTableReports.py +++ b/src/python_testing/TestGroupTableReports.py @@ -42,7 +42,7 @@ from chip.clusters import ClusterObjects as ClusterObjects from chip.clusters.Attribute import SubscriptionTransaction, TypedAttributePath from chip.interaction_model import Status -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TestIdChecks.py b/src/python_testing/TestIdChecks.py index eda01ef955..8969807d58 100644 --- a/src/python_testing/TestIdChecks.py +++ b/src/python_testing/TestIdChecks.py @@ -15,10 +15,9 @@ # limitations under the License. # -from chip.testing.global_attribute_ids import (AttributeIdType, ClusterIdType, DeviceTypeIdType, attribute_id_type, cluster_id_type, - device_type_id_type, is_valid_attribute_id, is_valid_cluster_id, - is_valid_device_type_id) -from chip.testing.matter_testing import MatterBaseTest, default_matter_test_main +from global_attribute_ids import (AttributeIdType, ClusterIdType, DeviceTypeIdType, attribute_id_type, cluster_id_type, + device_type_id_type, is_valid_attribute_id, is_valid_cluster_id, is_valid_device_type_id) +from matter_testing_support import MatterBaseTest, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TestMatterTestingSupport.py b/src/python_testing/TestMatterTestingSupport.py index 811349b3a9..08c3e830d2 100644 --- a/src/python_testing/TestMatterTestingSupport.py +++ b/src/python_testing/TestMatterTestingSupport.py @@ -22,15 +22,14 @@ import chip.clusters as Clusters from chip.clusters.Types import Nullable, NullValue -from chip.testing.matter_testing import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, - get_wait_seconds_from_set_time, parse_matter_test_args, type_matches, - utc_time_in_matter_epoch) -from chip.testing.pics import parse_pics, parse_pics_xml -from chip.testing.taglist_and_topology_test import (TagProblem, create_device_type_list_for_root, create_device_type_lists, - find_tag_list_problems, find_tree_roots, flat_list_ok, get_all_children, - get_direct_children_of_root, parts_list_cycles, separate_endpoint_types) from chip.tlv import uint +from matter_testing_support import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, + get_wait_seconds_from_set_time, parse_matter_test_args, type_matches, utc_time_in_matter_epoch) from mobly import asserts, signals +from pics_support import parse_pics, parse_pics_xml +from taglist_and_topology_test_support import (TagProblem, create_device_type_list_for_root, create_device_type_lists, + find_tag_list_problems, find_tree_roots, flat_list_ok, get_all_children, + get_direct_children_of_root, parts_list_cycles, separate_endpoint_types) def get_raw_type_list(): diff --git a/src/python_testing/TestSpecParsingDeviceType.py b/src/python_testing/TestSpecParsingDeviceType.py index a9ee14f12b..7729ccee8a 100644 --- a/src/python_testing/TestSpecParsingDeviceType.py +++ b/src/python_testing/TestSpecParsingDeviceType.py @@ -18,12 +18,12 @@ import chip.clusters as Clusters from chip.clusters import Attribute -from chip.testing.conformance import conformance_allowed -from chip.testing.matter_testing import MatterBaseTest, default_matter_test_main -from chip.testing.spec_parsing import build_xml_clusters, build_xml_device_types, parse_single_device_type from chip.tlv import uint +from conformance_support import conformance_allowed from jinja2 import Template +from matter_testing_support import MatterBaseTest, default_matter_test_main from mobly import asserts +from spec_parsing_support import build_xml_clusters, build_xml_device_types, parse_single_device_type from TC_DeviceConformance import DeviceConformanceTests diff --git a/src/python_testing/TestSpecParsingSupport.py b/src/python_testing/TestSpecParsingSupport.py index b4c908c232..4e0171b077 100644 --- a/src/python_testing/TestSpecParsingSupport.py +++ b/src/python_testing/TestSpecParsingSupport.py @@ -15,16 +15,17 @@ # limitations under the License. # +import os import xml.etree.ElementTree as ElementTree import chip.clusters as Clusters import jinja2 -from chip.testing.global_attribute_ids import GlobalAttributeIds -from chip.testing.matter_testing import MatterBaseTest, ProblemNotice, default_matter_test_main -from chip.testing.spec_parsing import (ClusterParser, DataModelLevel, PrebuiltDataModelDirectory, SpecParsingException, XmlCluster, - add_cluster_data_from_xml, build_xml_clusters, check_clusters_for_unknown_commands, - combine_derived_clusters_with_base, get_data_model_directory) +from global_attribute_ids import GlobalAttributeIds +from matter_testing_support import MatterBaseTest, ProblemNotice, default_matter_test_main from mobly import asserts +from spec_parsing_support import (ClusterParser, PrebuiltDataModelDirectory, SpecParsingException, XmlCluster, + add_cluster_data_from_xml, build_xml_clusters, check_clusters_for_unknown_commands, + combine_derived_clusters_with_base) # TODO: improve the test coverage here # https://github.com/project-chip/connectedhomeip/issues/30958 @@ -271,10 +272,10 @@ def test_build_xml_override(self): asserts.assert_equal(set(one_four_clusters.keys())-set(tot_xml_clusters.keys()), set(), "There are some 1.4 clusters that are not included in the TOT spec") - str_path = get_data_model_directory(PrebuiltDataModelDirectory.k1_4, DataModelLevel.kCluster) + str_path = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), + '..', '..', 'data_model', '1.4', 'clusters')) string_override_check, problems = build_xml_clusters(str_path) - - asserts.assert_count_equal(string_override_check.keys(), self.spec_xml_clusters.keys(), "Mismatched cluster generation") + asserts.assert_equal(string_override_check.keys(), self.spec_xml_clusters.keys(), "Mismatched cluster generation") with asserts.assert_raises(SpecParsingException): build_xml_clusters("baddir") diff --git a/src/python_testing/TestTimeSyncTrustedTimeSource.py b/src/python_testing/TestTimeSyncTrustedTimeSource.py index 50bca6f3da..2f4c9a1f55 100644 --- a/src/python_testing/TestTimeSyncTrustedTimeSource.py +++ b/src/python_testing/TestTimeSyncTrustedTimeSource.py @@ -18,7 +18,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts # We don't have a good pipe between the c++ enums in CommissioningDelegate and python diff --git a/src/python_testing/TestUnitTestingErrorPath.py b/src/python_testing/TestUnitTestingErrorPath.py index 872f1fa930..70d7b966ac 100644 --- a/src/python_testing/TestUnitTestingErrorPath.py +++ b/src/python_testing/TestUnitTestingErrorPath.py @@ -38,7 +38,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts """ Integration test for error path returns via the UnitTesting cluster. diff --git a/src/python_testing/matter_testing_infrastructure/chip/testing/basic_composition.py b/src/python_testing/basic_composition_support.py similarity index 100% rename from src/python_testing/matter_testing_infrastructure/chip/testing/basic_composition.py rename to src/python_testing/basic_composition_support.py diff --git a/src/python_testing/matter_testing_infrastructure/chip/testing/choice_conformance.py b/src/python_testing/choice_conformance_support.py similarity index 93% rename from src/python_testing/matter_testing_infrastructure/chip/testing/choice_conformance.py rename to src/python_testing/choice_conformance_support.py index 7e7775d555..58d37bf101 100644 --- a/src/python_testing/matter_testing_infrastructure/chip/testing/choice_conformance.py +++ b/src/python_testing/choice_conformance_support.py @@ -1,8 +1,8 @@ -from chip.testing.conformance import Choice, ConformanceDecisionWithChoice -from chip.testing.global_attribute_ids import GlobalAttributeIds -from chip.testing.matter_testing import AttributePathLocation, ProblemNotice, ProblemSeverity -from chip.testing.spec_parsing import XmlCluster from chip.tlv import uint +from conformance_support import Choice, ConformanceDecisionWithChoice +from global_attribute_ids import GlobalAttributeIds +from matter_testing_support import AttributePathLocation, ProblemNotice, ProblemSeverity +from spec_parsing_support import XmlCluster class ChoiceConformanceProblemNotice(ProblemNotice): diff --git a/src/python_testing/matter_testing_infrastructure/chip/testing/conformance.py b/src/python_testing/conformance_support.py similarity index 100% rename from src/python_testing/matter_testing_infrastructure/chip/testing/conformance.py rename to src/python_testing/conformance_support.py diff --git a/src/python_testing/drlk_2_x_common.py b/src/python_testing/drlk_2_x_common.py index cdd1382292..92c0ab23ce 100644 --- a/src/python_testing/drlk_2_x_common.py +++ b/src/python_testing/drlk_2_x_common.py @@ -23,7 +23,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from chip.testing.matter_testing import type_matches +from matter_testing_support import type_matches from mobly import asserts diff --git a/src/python_testing/execute_python_tests.py b/src/python_testing/execute_python_tests.py index 34a391873b..4e678211c5 100644 --- a/src/python_testing/execute_python_tests.py +++ b/src/python_testing/execute_python_tests.py @@ -53,7 +53,7 @@ def main(search_directory, env_file): # Define the base command to run tests base_command = os.path.join(chip_root, "scripts/tests/run_python_test.py") - # Define the test python script files and patterns to exclude + # Define the files and patterns to exclude excluded_patterns = { "MinimalRepresentation.py", # Code/Test not being used or not shared code for any other tests "TC_CNET_4_4.py", # It has no CI execution block, is not executed in CI @@ -84,6 +84,14 @@ def main(search_directory, env_file): "hello_test.py", # Is a template for tests "test_plan_support.py", # Shared code for TC_*, not a standalone test "test_plan_table_generator.py", # Code/Test not being used or not shared code for any other tests + "basic_composition_support.py", # Test support/shared code script, not a standalone test + "choice_conformance_support.py", # Test support/shared code script, not a standalone test + "conformance_support.py", # Test support/shared code script, not a standalone test + "global_attribute_ids.py", # Test support/shared code script, not a standalone test + "matter_testing_support.py", # Test support/shared code script, not a standalone test + "pics_support.py", # Test support/shared code script, not a standalone test + "spec_parsing_support.py", # Test support/shared code script, not a standalone test + "taglist_and_topology_test_support.py" # Test support/shared code script, not a standalone test } # Get all .py files in the directory diff --git a/src/python_testing/matter_testing_infrastructure/chip/testing/global_attribute_ids.py b/src/python_testing/global_attribute_ids.py similarity index 100% rename from src/python_testing/matter_testing_infrastructure/chip/testing/global_attribute_ids.py rename to src/python_testing/global_attribute_ids.py diff --git a/src/python_testing/hello_external_runner.py b/src/python_testing/hello_external_runner.py index 64af55ce07..5f00eeb287 100755 --- a/src/python_testing/hello_external_runner.py +++ b/src/python_testing/hello_external_runner.py @@ -23,8 +23,8 @@ from multiprocessing import Process from multiprocessing.managers import BaseManager -from chip.testing.matter_testing import MatterTestConfig, get_test_info, run_tests from hello_test import HelloTest +from matter_testing_support import MatterTestConfig, get_test_info, run_tests try: from matter_yamltests.hooks import TestRunnerHooks diff --git a/src/python_testing/hello_test.py b/src/python_testing/hello_test.py index 2d910b1e52..0793ee3b10 100644 --- a/src/python_testing/hello_test.py +++ b/src/python_testing/hello_test.py @@ -38,7 +38,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/matter_testing_infrastructure/BUILD.gn b/src/python_testing/matter_testing_infrastructure/BUILD.gn index 19c7aee68d..41bbcef22b 100644 --- a/src/python_testing/matter_testing_infrastructure/BUILD.gn +++ b/src/python_testing/matter_testing_infrastructure/BUILD.gn @@ -18,6 +18,7 @@ import("//build_overrides/chip.gni") import("//build_overrides/pigweed.gni") import("$dir_pw_build/python.gni") +# Python package for CHIP testing support. pw_python_package("chip-testing") { setup = [ "setup.py", @@ -30,15 +31,7 @@ pw_python_package("chip-testing") { sources = [ "chip/testing/__init__.py", "chip/testing/apps.py", - "chip/testing/basic_composition.py", - "chip/testing/choice_conformance.py", - "chip/testing/conformance.py", - "chip/testing/global_attribute_ids.py", - "chip/testing/matter_testing.py", "chip/testing/metadata.py", - "chip/testing/pics.py", - "chip/testing/spec_parsing.py", - "chip/testing/taglist_and_topology_test.py", "chip/testing/tasks.py", ] diff --git a/src/python_testing/matter_testing_infrastructure/chip/testing/apps.py b/src/python_testing/matter_testing_infrastructure/chip/testing/apps.py index 3b21a1c050..af56efc3d5 100644 --- a/src/python_testing/matter_testing_infrastructure/chip/testing/apps.py +++ b/src/python_testing/matter_testing_infrastructure/chip/testing/apps.py @@ -16,7 +16,7 @@ import signal import tempfile -from chip.testing.tasks import Subprocess +from .tasks import Subprocess class AppServerSubprocess(Subprocess): diff --git a/src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py b/src/python_testing/matter_testing_support.py similarity index 99% rename from src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py rename to src/python_testing/matter_testing_support.py index 2d23a9f84b..2e153a37de 100644 --- a/src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py +++ b/src/python_testing/matter_testing_support.py @@ -65,12 +65,12 @@ from chip.interaction_model import InteractionModelError, Status from chip.setup_payload import SetupPayload from chip.storage import PersistentStorage -from chip.testing.global_attribute_ids import GlobalAttributeIds -from chip.testing.pics import read_pics_from_file from chip.tracing import TracingContext +from global_attribute_ids import GlobalAttributeIds from mobly import asserts, base_test, signals, utils from mobly.config_parser import ENV_MOBLY_LOGPATH, TestRunConfig from mobly.test_runner import TestRunner +from pics_support import read_pics_from_file try: from matter_yamltests.hooks import TestRunnerHooks @@ -2278,7 +2278,7 @@ def default_matter_test_main(): In this case, only one test class in a test script is allowed. To make your test script executable, add the following to your file: .. code-block:: python - from chip.testing.matter_testing.py import default_matter_test_main + from matter_testing_support.py import default_matter_test_main ... if __name__ == '__main__': default_matter_test_main.main() diff --git a/src/python_testing/matter_testing_infrastructure/chip/testing/pics.py b/src/python_testing/pics_support.py similarity index 100% rename from src/python_testing/matter_testing_infrastructure/chip/testing/pics.py rename to src/python_testing/pics_support.py diff --git a/src/python_testing/post_certification_tests/production_device_checks.py b/src/python_testing/post_certification_tests/production_device_checks.py index b8e567f76a..e4262a09e7 100644 --- a/src/python_testing/post_certification_tests/production_device_checks.py +++ b/src/python_testing/post_certification_tests/production_device_checks.py @@ -59,15 +59,15 @@ os.path.join(os.path.dirname(__file__), '..', '..', '..')) try: - from chip.testing.basic_composition import BasicCompositionTests - from chip.testing.matter_testing import (MatterBaseTest, MatterStackState, MatterTestConfig, TestStep, async_test_body, - run_tests_no_exit) + from basic_composition_support import BasicCompositionTests + from matter_testing_support import (MatterBaseTest, MatterStackState, MatterTestConfig, TestStep, async_test_body, + run_tests_no_exit) except ImportError: sys.path.append(os.path.abspath( os.path.join(os.path.dirname(__file__), '..'))) - from chip.testing.basic_composition import BasicCompositionTests - from chip.testing.matter_testing import (MatterBaseTest, MatterStackState, MatterTestConfig, TestStep, async_test_body, - run_tests_no_exit) + from basic_composition_support import BasicCompositionTests + from matter_testing_support import (MatterBaseTest, MatterStackState, MatterTestConfig, TestStep, async_test_body, + run_tests_no_exit) try: import fetch_paa_certs_from_dcl diff --git a/src/python_testing/matter_testing_infrastructure/chip/testing/spec_parsing.py b/src/python_testing/spec_parsing_support.py similarity index 95% rename from src/python_testing/matter_testing_infrastructure/chip/testing/spec_parsing.py rename to src/python_testing/spec_parsing_support.py index 97a13606ea..75ffea120f 100644 --- a/src/python_testing/matter_testing_infrastructure/chip/testing/spec_parsing.py +++ b/src/python_testing/spec_parsing_support.py @@ -26,14 +26,14 @@ from typing import Callable, Optional import chip.clusters as Clusters -import chip.testing.conformance as conformance_support -from chip.testing.conformance import (OPTIONAL_CONFORM, TOP_LEVEL_CONFORMANCE_TAGS, ConformanceDecision, ConformanceException, - ConformanceParseParameters, feature, is_disallowed, mandatory, optional, or_operation, - parse_callable_from_xml, parse_device_type_callable_from_xml) -from chip.testing.global_attribute_ids import GlobalAttributeIds -from chip.testing.matter_testing import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, DeviceTypePathLocation, - EventPathLocation, FeaturePathLocation, ProblemNotice, ProblemSeverity) +import conformance_support from chip.tlv import uint +from conformance_support import (OPTIONAL_CONFORM, TOP_LEVEL_CONFORMANCE_TAGS, ConformanceDecision, ConformanceException, + ConformanceParseParameters, feature, is_disallowed, mandatory, optional, or_operation, + parse_callable_from_xml, parse_device_type_callable_from_xml) +from global_attribute_ids import GlobalAttributeIds +from matter_testing_support import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, DeviceTypePathLocation, + EventPathLocation, FeaturePathLocation, ProblemNotice, ProblemSeverity) _PRIVILEGE_STR = { None: "N/A", @@ -518,36 +518,19 @@ class DataModelLevel(str, Enum): kDeviceType = 'device_types' -def _get_data_model_root() -> str: - """Attempts to find ${CHIP_ROOT}/data_model or equivalent.""" - - # Since this class is generally in a module, we have to rely on being bootstrapped or - # we use CWD if we cannot - choices = [os.getcwd()] - - if 'PW_PROJECT_ROOT' in os.environ: - choices.insert(0, os.environ['PW_PROJECT_ROOT']) - - for c in choices: - data_model_path = os.path.join(c, 'data_model') - if os.path.exists(os.path.join(data_model_path, 'master', 'scraper_version')): - return data_model_path - raise FileNotFoundError('Cannot find a CHIP_ROOT/data_model path. Tried %r as prefixes.' % choices) - - -def get_data_model_directory(data_model_directory: typing.Union[PrebuiltDataModelDirectory, str], data_model_level: DataModelLevel) -> str: +def _get_data_model_directory(data_model_directory: typing.Union[PrebuiltDataModelDirectory, str], data_model_level: DataModelLevel) -> str: if data_model_directory == PrebuiltDataModelDirectory.k1_3: - return os.path.join(_get_data_model_root(), '1.3', data_model_level) + return os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'data_model', '1.3', data_model_level) elif data_model_directory == PrebuiltDataModelDirectory.k1_4: - return os.path.join(_get_data_model_root(), '1.4', data_model_level) + return os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'data_model', '1.4', data_model_level) elif data_model_directory == PrebuiltDataModelDirectory.kMaster: - return os.path.join(_get_data_model_root(), 'master', data_model_level) + return os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'data_model', 'master', data_model_level) else: return data_model_directory def build_xml_clusters(data_model_directory: typing.Union[PrebuiltDataModelDirectory, str] = PrebuiltDataModelDirectory.k1_4) -> tuple[dict[uint, XmlCluster], list[ProblemNotice]]: - dir = get_data_model_directory(data_model_directory, DataModelLevel.kCluster) + dir = _get_data_model_directory(data_model_directory, DataModelLevel.kCluster) clusters: dict[int, XmlCluster] = {} pure_base_clusters: dict[str, XmlCluster] = {} @@ -794,7 +777,7 @@ def parse_single_device_type(root: ElementTree.Element) -> tuple[list[ProblemNot def build_xml_device_types(data_model_directory: typing.Union[PrebuiltDataModelDirectory, str] = PrebuiltDataModelDirectory.k1_4) -> tuple[dict[int, XmlDeviceType], list[ProblemNotice]]: - dir = get_data_model_directory(data_model_directory, DataModelLevel.kDeviceType) + dir = _get_data_model_directory(data_model_directory, DataModelLevel.kDeviceType) device_types: dict[int, XmlDeviceType] = {} problems = [] for xml in glob.glob(f"{dir}/*.xml"): diff --git a/src/python_testing/matter_testing_infrastructure/chip/testing/taglist_and_topology_test.py b/src/python_testing/taglist_and_topology_test_support.py similarity index 100% rename from src/python_testing/matter_testing_infrastructure/chip/testing/taglist_and_topology_test.py rename to src/python_testing/taglist_and_topology_test_support.py diff --git a/src/python_testing/test_plan_table_generator.py b/src/python_testing/test_plan_table_generator.py index b38f6f94df..c972116f34 100755 --- a/src/python_testing/test_plan_table_generator.py +++ b/src/python_testing/test_plan_table_generator.py @@ -22,7 +22,7 @@ from pathlib import Path import click -from chip.testing.matter_testing import MatterTestConfig, generate_mobly_test_config +from matter_testing_support import MatterTestConfig, generate_mobly_test_config def indent_multiline(multiline: str, num_spaces: int) -> str: diff --git a/src/python_testing/test_testing/MockTestRunner.py b/src/python_testing/test_testing/MockTestRunner.py index 6c9bc1c088..2d0afb8a5c 100644 --- a/src/python_testing/test_testing/MockTestRunner.py +++ b/src/python_testing/test_testing/MockTestRunner.py @@ -22,7 +22,13 @@ from unittest.mock import MagicMock from chip.clusters import Attribute -from chip.testing.matter_testing import MatterStackState, MatterTestConfig, run_tests_no_exit + +try: + from matter_testing_support import MatterStackState, MatterTestConfig, run_tests_no_exit +except ImportError: + sys.path.append(os.path.abspath( + os.path.join(os.path.dirname(__file__), '..'))) + from matter_testing_support import MatterStackState, MatterTestConfig, run_tests_no_exit class AsyncMock(MagicMock): @@ -50,15 +56,7 @@ def __init__(self, filename: str, classname: str, test: str, endpoint: int = Non def set_test(self, filename: str, classname: str, test: str): self.test = test self.config.tests = [self.test] - - module_name = Path(os.path.basename(filename)).stem - - try: - module = importlib.import_module(module_name) - except ModuleNotFoundError: - sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) - module = importlib.import_module(module_name) - + module = importlib.import_module(Path(os.path.basename(filename)).stem) self.test_class = getattr(module, classname) def set_test_config(self, test_config: MatterTestConfig = MatterTestConfig()): diff --git a/src/python_testing/test_testing/TestDecorators.py b/src/python_testing/test_testing/TestDecorators.py index ce32518b71..82b49eddd8 100644 --- a/src/python_testing/test_testing/TestDecorators.py +++ b/src/python_testing/test_testing/TestDecorators.py @@ -25,13 +25,23 @@ # # You will get step_* calls as appropriate in between the test_start and test_stop calls if the test is not skipped. +import os import sys -from typing import Optional import chip.clusters as Clusters from chip.clusters import Attribute -from chip.testing.matter_testing import (MatterBaseTest, MatterTestConfig, async_test_body, has_attribute, has_cluster, has_feature, - run_if_endpoint_matches, run_on_singleton_matching_endpoint, should_run_test_on_endpoint) + +try: + from matter_testing_support import (MatterBaseTest, MatterTestConfig, async_test_body, has_attribute, has_cluster, has_feature, + run_if_endpoint_matches, run_on_singleton_matching_endpoint, should_run_test_on_endpoint) +except ImportError: + sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) + from matter_testing_support import (MatterBaseTest, MatterTestConfig, async_test_body, has_attribute, + has_cluster, has_feature, run_if_endpoint_matches, run_on_singleton_matching_endpoint, + should_run_test_on_endpoint) + +from typing import Optional + from mobly import asserts from MockTestRunner import MockTestRunner diff --git a/src/python_testing/test_testing/test_IDM_10_4.py b/src/python_testing/test_testing/test_IDM_10_4.py index 8a30609e94..8634e94129 100644 --- a/src/python_testing/test_testing/test_IDM_10_4.py +++ b/src/python_testing/test_testing/test_IDM_10_4.py @@ -21,7 +21,13 @@ import chip.clusters as Clusters from chip.clusters import Attribute -from chip.testing.pics import parse_pics_xml + +try: + from pics_support import parse_pics_xml +except ImportError: + sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) + from pics_support import parse_pics_xml + from MockTestRunner import MockTestRunner # Reachable attribute is off in the pics file diff --git a/src/python_testing/test_testing/test_TC_CCNTL_2_2.py b/src/python_testing/test_testing/test_TC_CCNTL_2_2.py index 6a2dc48ba4..bd28023b8e 100644 --- a/src/python_testing/test_testing/test_TC_CCNTL_2_2.py +++ b/src/python_testing/test_testing/test_TC_CCNTL_2_2.py @@ -30,11 +30,11 @@ from MockTestRunner import AsyncMock, MockTestRunner try: - from chip.testing.matter_testing import MatterTestConfig, get_default_paa_trust_store, run_tests_no_exit + from matter_testing_support import MatterTestConfig, get_default_paa_trust_store, run_tests_no_exit except ImportError: sys.path.append(os.path.abspath( os.path.join(os.path.dirname(__file__), '..'))) - from chip.testing.matter_testing import MatterTestConfig, get_default_paa_trust_store, run_tests_no_exit + from matter_testing_support import MatterTestConfig, get_default_paa_trust_store, run_tests_no_exit invoke_call_count = 0 event_call_count = 0 diff --git a/src/python_testing/test_testing/test_TC_MCORE_FS_1_1.py b/src/python_testing/test_testing/test_TC_MCORE_FS_1_1.py index ed9f1b3531..d79b412530 100644 --- a/src/python_testing/test_testing/test_TC_MCORE_FS_1_1.py +++ b/src/python_testing/test_testing/test_TC_MCORE_FS_1_1.py @@ -30,11 +30,11 @@ from MockTestRunner import AsyncMock, MockTestRunner try: - from chip.testing.matter_testing import MatterTestConfig, get_default_paa_trust_store, run_tests_no_exit + from matter_testing_support import MatterTestConfig, get_default_paa_trust_store, run_tests_no_exit except ImportError: sys.path.append(os.path.abspath( os.path.join(os.path.dirname(__file__), '..'))) - from chip.testing.matter_testing import MatterTestConfig, get_default_paa_trust_store, run_tests_no_exit + from matter_testing_support import MatterTestConfig, get_default_paa_trust_store, run_tests_no_exit invoke_call_count = 0 event_call_count = 0 diff --git a/src/python_testing/test_testing/test_TC_SC_7_1.py b/src/python_testing/test_testing/test_TC_SC_7_1.py index 96dced72f9..3b1b6a5b1c 100644 --- a/src/python_testing/test_testing/test_TC_SC_7_1.py +++ b/src/python_testing/test_testing/test_TC_SC_7_1.py @@ -16,14 +16,21 @@ # limitations under the License. # +import os import sys from random import randbytes import chip.clusters as Clusters from chip.clusters import Attribute -from chip.testing.matter_testing import MatterTestConfig from MockTestRunner import MockTestRunner +try: + from matter_testing_support import MatterTestConfig +except ImportError: + sys.path.append(os.path.abspath( + os.path.join(os.path.dirname(__file__), '..'))) + from matter_testing_support import MatterTestConfig + def read_trusted_root(filled: bool) -> Attribute.AsyncReadTransaction.ReadResponse: opcreds = Clusters.OperationalCredentials diff --git a/src/tools/PICS-generator/PICSGenerator.py b/src/tools/PICS-generator/PICSGenerator.py index 6cfb95803a..acdeb676ed 100644 --- a/src/tools/PICS-generator/PICSGenerator.py +++ b/src/tools/PICS-generator/PICSGenerator.py @@ -25,10 +25,10 @@ from pics_generator_support import map_cluster_name_to_pics_xml, pics_xml_file_list_loader from rich.console import Console -# Add the path to python_testing folder, in order to be able to import from chip.testing.matter_testing +# Add the path to python_testing folder, in order to be able to import from matter_testing_support sys.path.append(os.path.abspath(sys.path[0] + "/../../python_testing")) -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main # noqa: E402 -from chip.testing.spec_parsing import build_xml_clusters # noqa: E402 +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main # noqa: E402 +from spec_parsing_support import build_xml_clusters # noqa: E402 console = None xml_clusters = None diff --git a/src/tools/PICS-generator/XMLPICSValidator.py b/src/tools/PICS-generator/XMLPICSValidator.py index 5fd170463d..d728a61991 100644 --- a/src/tools/PICS-generator/XMLPICSValidator.py +++ b/src/tools/PICS-generator/XMLPICSValidator.py @@ -23,7 +23,7 @@ # Add the path to python_testing folder, in order to be able to import from matter_testing_support sys.path.append(os.path.abspath(sys.path[0] + "/../../python_testing")) -from chip.testing.spec_parsing import build_xml_clusters # noqa: E402 +from spec_parsing_support import build_xml_clusters # noqa: E402 parser = argparse.ArgumentParser() parser.add_argument('--pics-template', required=True) diff --git a/src/tools/device-graph/matter-device-graph.py b/src/tools/device-graph/matter-device-graph.py index 597468624d..16a2e6dbb0 100644 --- a/src/tools/device-graph/matter-device-graph.py +++ b/src/tools/device-graph/matter-device-graph.py @@ -23,9 +23,9 @@ import graphviz from rich.console import Console -# Add the path to python_testing folder, in order to be able to import from chip.testing.matter_testing +# Add the path to python_testing folder, in order to be able to import from matter_testing_support sys.path.append(os.path.abspath(sys.path[0] + "/../../python_testing")) -from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main # noqa: E402 +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main # noqa: E402 console = None maxClusterNameLength = 30 From 86c1c71236cd97f1c3d871c27cd7cc3670638ac8 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Thu, 10 Oct 2024 08:32:43 -0700 Subject: [PATCH 079/127] Fix small typo (#36005) --- src/python_testing/TC_ECOINFO_2_2.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/python_testing/TC_ECOINFO_2_2.py b/src/python_testing/TC_ECOINFO_2_2.py index 85868a9468..6e0e588d2f 100644 --- a/src/python_testing/TC_ECOINFO_2_2.py +++ b/src/python_testing/TC_ECOINFO_2_2.py @@ -49,7 +49,7 @@ from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts -_DEVICE_TYPE_AGGREGGATOR = 0x000E +_DEVICE_TYPE_AGGREGATOR = 0x000E class TC_ECOINFO_2_2(MatterBaseTest): @@ -149,7 +149,7 @@ async def test_TC_ECOINFO_2_2(self): device_type_list_read = await dev_ctrl.ReadAttribute(dut_node_id, [(endpoint, Clusters.Descriptor.Attributes.DeviceTypeList)]) device_type_list = device_type_list_read[endpoint][Clusters.Descriptor][Clusters.Descriptor.Attributes.DeviceTypeList] for device_type in device_type_list: - if device_type.deviceType == _DEVICE_TYPE_AGGREGGATOR: + if device_type.deviceType == _DEVICE_TYPE_AGGREGATOR: list_of_aggregator_endpoints.append(endpoint) asserts.assert_greater_equal(len(list_of_aggregator_endpoints), 1, "Did not find any Aggregator device types") From 80a76369649007b5e1fd9adef5f2a923f2e1e3dc Mon Sep 17 00:00:00 2001 From: Philip Gregor <147669098+pgregorr-amazon@users.noreply.github.com> Date: Thu, 10 Oct 2024 10:10:09 -0700 Subject: [PATCH 080/127] =?UTF-8?q?tv-casting-app=20fix=20CloseCommissioni?= =?UTF-8?q?ngWindow=20upon=20unexpected=20CDC=20Commi=E2=80=A6=20(#35984)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../casting/ConnectionExampleFragment.java | 56 ++++++++++--------- .../linux/simple-app-helper.cpp | 2 +- .../core/CommissionerDeclarationHandler.cpp | 39 ++++++++----- 3 files changed, 56 insertions(+), 41 deletions(-) diff --git a/examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/ConnectionExampleFragment.java b/examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/ConnectionExampleFragment.java index fc3ba6cd1d..f711096a22 100644 --- a/examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/ConnectionExampleFragment.java +++ b/examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/ConnectionExampleFragment.java @@ -29,6 +29,7 @@ import android.widget.TextView; import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentActivity; import com.R; import com.matter.casting.core.CastingPlayer; import com.matter.casting.support.CommissionerDeclaration; @@ -208,36 +209,41 @@ public void handle(CommissionerDeclaration cd) { Log.i(TAG, "CastingPlayer CommissionerDeclaration message received: "); cd.logDetail(); - getActivity() - .runOnUiThread( - () -> { - connectionFragmentStatusTextView.setText( - "CommissionerDeclaration message received from Casting Player: \n\n"); - if (cd.getCommissionerPasscode()) { + FragmentActivity activity = getActivity(); + // Prevent possible NullPointerException. This callback could be called when + // this Fragment is not attached to its host activity or when the fragment's + // lifecycle is not in a valid state for interacting with the activity. + if (activity != null && !activity.isFinishing()) { + activity.runOnUiThread( + () -> { + connectionFragmentStatusTextView.setText( + "CommissionerDeclaration message received from Casting Player: \n\n"); + if (cd.getCommissionerPasscode()) { - displayPasscodeInputDialog(getActivity()); + displayPasscodeInputDialog(activity); + connectionFragmentStatusTextView.setText( + "CommissionerDeclaration message received from Casting Player: A passcode is now displayed for the user by the Casting Player. \n\n"); + } + if (cd.getCancelPasscode()) { + if (useCommissionerGeneratedPasscode) { connectionFragmentStatusTextView.setText( - "CommissionerDeclaration message received from Casting Player: A passcode is now displayed for the user by the Casting Player. \n\n"); - } - if (cd.getCancelPasscode()) { - if (useCommissionerGeneratedPasscode) { - connectionFragmentStatusTextView.setText( - "CastingPlayer/Commissioner-Generated passcode connection attempt cancelled by the CastingPlayer/Commissioner user. \n\nRoute back to exit. \n\n"); - } else { - connectionFragmentStatusTextView.setText( - "Connection attempt cancelled by the CastingPlayer/Commissioner user. \n\nRoute back to exit. \n\n"); - } - if (passcodeDialog != null && passcodeDialog.isShowing()) { - passcodeDialog.dismiss(); - } + "CastingPlayer/Commissioner-Generated passcode connection attempt cancelled by the CastingPlayer/Commissioner user. \n\nRoute back to exit. \n\n"); + } else { + connectionFragmentStatusTextView.setText( + "Connection attempt cancelled by the CastingPlayer/Commissioner user. \n\nRoute back to exit. \n\n"); } - if (cd.getErrorCode() != CommissionerDeclaration.CdError.noError) { - commissionerDeclarationErrorTextView.setText( - "CommissionerDeclaration error from CastingPlayer: " - + cd.getErrorCode().getDescription()); + if (passcodeDialog != null && passcodeDialog.isShowing()) { + passcodeDialog.dismiss(); } - }); + } + if (cd.getErrorCode() != CommissionerDeclaration.CdError.noError) { + commissionerDeclarationErrorTextView.setText( + "CommissionerDeclaration error from CastingPlayer: " + + cd.getErrorCode().getDescription()); + } + }); + } } }; diff --git a/examples/tv-casting-app/linux/simple-app-helper.cpp b/examples/tv-casting-app/linux/simple-app-helper.cpp index 4bdf660bd5..f354aa094f 100644 --- a/examples/tv-casting-app/linux/simple-app-helper.cpp +++ b/examples/tv-casting-app/linux/simple-app-helper.cpp @@ -289,7 +289,7 @@ void ConnectionHandler(CHIP_ERROR err, matter::casting::core::CastingPlayer * ca kDesiredEndpointVendorId); } - ChipLogProgress(AppServer, "simple-app-helper.cpp::ConnectionHandler(): Getting endpoints avaiable for demo interactions"); + ChipLogProgress(AppServer, "simple-app-helper.cpp::ConnectionHandler(): Getting endpoints available for demo interactions"); std::vector> endpoints = castingPlayer->GetEndpoints(); LogEndpointsDetails(endpoints); diff --git a/examples/tv-casting-app/tv-casting-common/core/CommissionerDeclarationHandler.cpp b/examples/tv-casting-app/tv-casting-common/core/CommissionerDeclarationHandler.cpp index c89b899bf5..a54d1013d3 100644 --- a/examples/tv-casting-app/tv-casting-common/core/CommissionerDeclarationHandler.cpp +++ b/examples/tv-casting-app/tv-casting-common/core/CommissionerDeclarationHandler.cpp @@ -38,18 +38,24 @@ CommissionerDeclarationHandler * CommissionerDeclarationHandler::GetInstance() return sCommissionerDeclarationHandler_; } -// TODO: In the following PRs. Implement setHandler() for CommissionerDeclaration messages and expose messages to higher layers for -// Linux, Android and iOS. void CommissionerDeclarationHandler::OnCommissionerDeclarationMessage( const chip::Transport::PeerAddress & source, chip::Protocols::UserDirectedCommissioning::CommissionerDeclaration cd) { - ChipLogProgress(AppServer, - "CommissionerDeclarationHandler::OnCommissionerDeclarationMessage(), calling CloseCommissioningWindow()"); - // Close the commissioning window. Since we recived a CommissionerDeclaration message from the Commissioner, we know that - // commissioning via AccountLogin cluster failed. We will open a new commissioningWindow prior to sending the next - // IdentificationDeclaration Message to the Commissioner. - chip::Server::GetInstance().GetCommissioningWindowManager().CloseCommissioningWindow(); - support::ChipDeviceEventHandler::SetUdcStatus(false); + ChipLogProgress(AppServer, "CommissionerDeclarationHandler::OnCommissionerDeclarationMessage()"); + + // During UDC with CastingPlayer/Commissioner-Generated Passcode, the Commissioner responds with a CommissionerDeclaration + // message with CommissionerPasscode set to true. The CommissionerPasscode flag indicates that a Passcode is now displayed for + // the user by the CastingPlayer /Commissioner. With this CommissionerDeclaration message, we also know that commissioning via + // AccountLogin cluster has failed. Therefore, we close the commissioning window. We will open a new commissioning window prior + // to sending the next/2nd IdentificationDeclaration message to the Commissioner. + if (cd.GetCommissionerPasscode()) + { + ChipLogProgress(AppServer, + "CommissionerDeclarationHandler::OnCommissionerDeclarationMessage(), calling CloseCommissioningWindow()"); + // Close the commissioning window. + chip::Server::GetInstance().GetCommissioningWindowManager().CloseCommissioningWindow(); + support::ChipDeviceEventHandler::SetUdcStatus(false); + } // Flag to indicate when the CastingPlayer/Commissioner user has decided to exit the commissioning process. if (cd.GetCancelPasscode()) @@ -57,6 +63,9 @@ void CommissionerDeclarationHandler::OnCommissionerDeclarationMessage( ChipLogProgress(AppServer, "CommissionerDeclarationHandler::OnCommissionerDeclarationMessage(), Got CancelPasscode parameter, " "CastingPlayer/Commissioner user has decided to exit the commissioning attempt. Connection aborted."); + // Close the commissioning window. + chip::Server::GetInstance().GetCommissioningWindowManager().CloseCommissioningWindow(); + support::ChipDeviceEventHandler::SetUdcStatus(false); // Since the CastingPlayer/Commissioner user has decided to exit the commissioning process, we cancel the ongoing // connection attempt without notifying the CastingPlayer/Commissioner. Therefore the // shouldSendIdentificationDeclarationMessage flag in the internal StopConnecting() API call is set to false. The @@ -65,12 +74,7 @@ void CommissionerDeclarationHandler::OnCommissionerDeclarationMessage( // and user 2 might be controlling the CastingPlayer/Commissioner TV. CastingPlayer * targetCastingPlayer = CastingPlayer::GetTargetCastingPlayer(); // Avoid crashing if we recieve this CommissionerDeclaration message when targetCastingPlayer is nullptr. - if (targetCastingPlayer == nullptr) - { - ChipLogError(AppServer, - "CommissionerDeclarationHandler::OnCommissionerDeclarationMessage() targetCastingPlayer is nullptr"); - } - else + if (targetCastingPlayer != nullptr) { CHIP_ERROR err = targetCastingPlayer->StopConnecting(false); if (err != CHIP_NO_ERROR) @@ -82,6 +86,11 @@ void CommissionerDeclarationHandler::OnCommissionerDeclarationMessage( err.Format()); } } + else + { + ChipLogError(AppServer, + "CommissionerDeclarationHandler::OnCommissionerDeclarationMessage() targetCastingPlayer is nullptr"); + } } if (mCmmissionerDeclarationCallback_) From 7a9bd66d587f54fb4a53249730f0fed457dad460 Mon Sep 17 00:00:00 2001 From: Anush Nadathur Date: Thu, 10 Oct 2024 10:50:48 -0700 Subject: [PATCH 081/127] [Darwin] Implemented download diagnostics log for MTRDevice_XPC (#35998) * [Darwin] Implemented download diagnostics log for MTRDevice_XPC - Implemented the downloadLogOfType API on MTRDevice_XPC to call into XPC server to forward the request - Fixed the protocol to take controllerID which is missing from existing protocol * Restyler fixes * Added documentation * Restyle fixes --- src/darwin/Framework/CHIP/MTRDevice_XPC.mm | 33 +++++++++++++++++++ .../CHIP/XPC Protocol/MTRXPCServerProtocol.h | 7 ++++ 2 files changed, 40 insertions(+) diff --git a/src/darwin/Framework/CHIP/MTRDevice_XPC.mm b/src/darwin/Framework/CHIP/MTRDevice_XPC.mm index 61aad70035..aefa2fffc1 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_XPC.mm +++ b/src/darwin/Framework/CHIP/MTRDevice_XPC.mm @@ -269,6 +269,39 @@ - (void)_invokeCommandWithEndpointID:(NSNumber *)endpointID } } +- (void)downloadLogOfType:(MTRDiagnosticLogType)type + timeout:(NSTimeInterval)timeout + queue:(dispatch_queue_t)queue + completion:(void (^)(NSURL * _Nullable url, NSError * _Nullable error))completion +{ + NSXPCConnection * xpcConnection = [(MTRDeviceController_XPC *) [self deviceController] xpcConnection]; + + @try { + [[xpcConnection remoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) { + MTR_LOG_ERROR("Error: %@", error); + dispatch_async(queue, ^{ + completion(nil, [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeGeneralError userInfo:nil]); + }); + }] deviceController:[[self deviceController] uniqueIdentifier] + nodeID:[self nodeID] + downloadLogOfType:type + timeout:timeout + completion:^(NSURL * _Nullable url, NSError * _Nullable error) { + dispatch_async(queue, ^{ + completion(url, error); + if (url) { + [[NSFileManager defaultManager] removeItemAtPath:url.path error:nil]; + } + }); + }]; + } @catch (NSException * exception) { + MTR_LOG_ERROR("Exception sending XPC messsage: %@", exception); + dispatch_async(queue, ^{ + completion(nil, [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeGeneralError userInfo:nil]); + }); + } +} + // Not Supported via XPC //- (oneway void)deviceController:(NSUUID *)controller nodeID:(NSNumber *)nodeID openCommissioningWindowWithSetupPasscode:(NSNumber *)setupPasscode discriminator:(NSNumber *)discriminator duration:(NSNumber *)duration completion:(MTRDeviceOpenCommissioningWindowHandler)completion; //- (oneway void)deviceController:(NSUUID *)controller nodeID:(NSNumber *)nodeID openCommissioningWindowWithDiscriminator:(NSNumber *)discriminator duration:(NSNumber *)duration completion:(MTRDeviceOpenCommissioningWindowHandler)completion; diff --git a/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCServerProtocol.h b/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCServerProtocol.h index 36e2be5d42..9ecec60ae5 100644 --- a/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCServerProtocol.h +++ b/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCServerProtocol.h @@ -41,6 +41,13 @@ MTR_NEWLY_AVAILABLE - (oneway void)deviceController:(NSUUID *)controller nodeID:(NSNumber *)nodeID openCommissioningWindowWithSetupPasscode:(NSNumber *)setupPasscode discriminator:(NSNumber *)discriminator duration:(NSNumber *)duration completion:(MTRDeviceOpenCommissioningWindowHandler)completion; - (oneway void)downloadLogOfType:(MTRDiagnosticLogType)type nodeID:(NSNumber *)nodeID timeout:(NSTimeInterval)timeout completion:(void (^)(NSURL * _Nullable url, NSError * _Nullable error))completion; + +@optional +/* Note: The consumer of the completion block should move the file that the url points to or open it for reading before the + * completion handler returns. Otherwise, the file will be deleted, and the data will be lost. + */ +- (oneway void)deviceController:(NSUUID *)controller nodeID:(NSNumber *)nodeID downloadLogOfType:(MTRDiagnosticLogType)type timeout:(NSTimeInterval)timeout completion:(void (^)(NSURL * _Nullable url, NSError * _Nullable error))completion; + @end MTR_NEWLY_AVAILABLE From cc049c35192db9380fd2a68dd46daafaea00ce5f Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 10 Oct 2024 15:15:44 -0400 Subject: [PATCH 082/127] Add back typo removed by line merge in previous PR (#36010) Co-authored-by: Andrei Litvin --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index e2763ec410..af102bf96e 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -436,7 +436,7 @@ jobs: env: BUILD_TYPE: default run: | - # We want to build various standalone example apps similar to what examples-linux-standalone.yaml + # We want to build various standalone example apps (similar to what examples-linux-standalone.yaml # does), so use target_os="all" to get those picked up as part of the "unified" build. But then # to save CI resources we want to exclude the "host clang" build, which uses the pigweed clang. scripts/build/gn_gen.sh --args='target_os="all" is_asan=true enable_host_clang_build=false chip_data_model_check_die_on_failure=true' --export-compile-commands From 6a29ee52cb7a43d4a6f3b20290d22ef564889895 Mon Sep 17 00:00:00 2001 From: Amine Alami <43780877+Alami-Amine@users.noreply.github.com> Date: Thu, 10 Oct 2024 21:59:20 +0200 Subject: [PATCH 083/127] Refactoring random SetupPinCode generation into a method. (#36009) * Creating a Function to generate random Setup Pin codes and making sure that the generated pin code is valid * Using generateRandomSetupPin function to generate random setup pin codes * Integrating comments * Handling return value of generateRandomSetupPin invocation Co-authored-by: Andrei Litvin * Integrating comments --------- Co-authored-by: Andrei Litvin --- src/protocols/secure_channel/PASESession.cpp | 5 +--- src/setup_payload/SetupPayload.cpp | 29 ++++++++++++++++++++ src/setup_payload/SetupPayload.h | 11 ++++++++ 3 files changed, 41 insertions(+), 4 deletions(-) diff --git a/src/protocols/secure_channel/PASESession.cpp b/src/protocols/secure_channel/PASESession.cpp index 6178348ad5..345b307f26 100644 --- a/src/protocols/secure_channel/PASESession.cpp +++ b/src/protocols/secure_channel/PASESession.cpp @@ -139,10 +139,7 @@ CHIP_ERROR PASESession::GeneratePASEVerifier(Spake2pVerifier & verifier, uint32_ if (useRandomPIN) { - ReturnErrorOnFailure(DRBG_get_bytes(reinterpret_cast(&setupPINCode), sizeof(setupPINCode))); - - // Passcodes shall be restricted to the values 00000001 to 99999998 in decimal, see 5.1.1.6 - setupPINCode = (setupPINCode % kSetupPINCodeMaximumValue) + 1; + ReturnErrorOnFailure(SetupPayload::generateRandomSetupPin(setupPINCode)); } return verifier.Generate(pbkdf2IterCount, salt, setupPINCode); diff --git a/src/setup_payload/SetupPayload.cpp b/src/setup_payload/SetupPayload.cpp index 9683da21f8..915f20c4a2 100644 --- a/src/setup_payload/SetupPayload.cpp +++ b/src/setup_payload/SetupPayload.cpp @@ -23,6 +23,7 @@ #include "SetupPayload.h" +#include #include #include #include @@ -207,6 +208,34 @@ CHIP_ERROR SetupPayload::removeSerialNumber() return CHIP_NO_ERROR; } +CHIP_ERROR SetupPayload::generateRandomSetupPin(uint32_t & setupPINCode) +{ + uint8_t retries = 0; + const uint8_t maxRetries = 10; + + do + { + ReturnErrorOnFailure(Crypto::DRBG_get_bytes(reinterpret_cast(&setupPINCode), sizeof(setupPINCode))); + + // Passcodes shall be restricted to the values 00000001 to 99999998 in decimal, see 5.1.1.6 + // TODO: Consider revising this method to ensure uniform distribution of setup PIN codes + setupPINCode = (setupPINCode % kSetupPINCodeMaximumValue) + 1; + + // Make sure that the Generated Setup Pin code is not one of the invalid passcodes/pin codes defined in the + // specification. + if (IsValidSetupPIN(setupPINCode)) + { + return CHIP_NO_ERROR; + } + + retries++; + // We got pretty unlucky with the random number generator, Just try again. + // This shouldn't take many retries assuming DRBG_get_bytes is not broken. + } while (retries < maxRetries); + + return CHIP_ERROR_INTERNAL; +} + CHIP_ERROR SetupPayload::addOptionalVendorData(const OptionalQRCodeInfo & info) { VerifyOrReturnError(IsVendorTag(info.tag), CHIP_ERROR_INVALID_ARGUMENT); diff --git a/src/setup_payload/SetupPayload.h b/src/setup_payload/SetupPayload.h index 3d5d101fbf..829af128bf 100644 --- a/src/setup_payload/SetupPayload.h +++ b/src/setup_payload/SetupPayload.h @@ -259,6 +259,17 @@ class SetupPayload : public PayloadContents **/ static bool IsVendorTag(uint8_t tag) { return !IsCommonTag(tag); } + /** @brief Generate a Random Setup Pin Code (Passcode) + * + * This function generates a random passcode within the defined limits (00000001 to 99999998) + * It also checks that the generated passcode is not equal to any invalid passcode values as defined in 5.1.7.1. + * + * @param[out] setupPINCode The generated random setup PIN code. + * @return Returns a CHIP_ERROR_INTERNAL if unable to generate a valid passcode within a reasonable number of attempts, + * CHIP_NO_ERROR otherwise + **/ + static CHIP_ERROR generateRandomSetupPin(uint32_t & setupPINCode); + private: std::map optionalVendorData; std::map optionalExtensionData; From 043ff6733baff7f1015b8ae04720158459484779 Mon Sep 17 00:00:00 2001 From: Arkadiusz Bokowy Date: Thu, 10 Oct 2024 22:24:06 +0200 Subject: [PATCH 084/127] Remove all-clusters-minimal-app for Tizen platform (#36014) * Remove all-clusters-minimal-app for Tizen platform * Remove all-clusters-minimal from all_targets_linux --- examples/all-clusters-minimal-app/tizen/.gn | 27 ------ .../all-clusters-minimal-app/tizen/BUILD.gn | 82 ------------------- .../all-clusters-minimal-app/tizen/args.gni | 25 ------ .../tizen/build_overrides | 1 - .../tizen/include/CHIPProjectAppConfig.h | 31 ------- .../tizen/src/main.cpp | 63 -------------- .../tizen/third_party/connectedhomeip | 1 - .../tizen/tizen-manifest.xml | 19 ----- scripts/build/build/targets.py | 1 - scripts/build/builders/tizen.py | 5 -- .../build/testdata/all_targets_linux_x64.txt | 2 +- 11 files changed, 1 insertion(+), 256 deletions(-) delete mode 100644 examples/all-clusters-minimal-app/tizen/.gn delete mode 100644 examples/all-clusters-minimal-app/tizen/BUILD.gn delete mode 100644 examples/all-clusters-minimal-app/tizen/args.gni delete mode 120000 examples/all-clusters-minimal-app/tizen/build_overrides delete mode 100644 examples/all-clusters-minimal-app/tizen/include/CHIPProjectAppConfig.h delete mode 100644 examples/all-clusters-minimal-app/tizen/src/main.cpp delete mode 120000 examples/all-clusters-minimal-app/tizen/third_party/connectedhomeip delete mode 100644 examples/all-clusters-minimal-app/tizen/tizen-manifest.xml diff --git a/examples/all-clusters-minimal-app/tizen/.gn b/examples/all-clusters-minimal-app/tizen/.gn deleted file mode 100644 index edd34d34bd..0000000000 --- a/examples/all-clusters-minimal-app/tizen/.gn +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) 2020 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -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_os = "tizen" - - import("//args.gni") -} diff --git a/examples/all-clusters-minimal-app/tizen/BUILD.gn b/examples/all-clusters-minimal-app/tizen/BUILD.gn deleted file mode 100644 index 99f857e863..0000000000 --- a/examples/all-clusters-minimal-app/tizen/BUILD.gn +++ /dev/null @@ -1,82 +0,0 @@ -# Copyright (c) 2020 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//build_overrides/chip.gni") -import("//build_overrides/tizen.gni") - -import("${chip_root}/build/chip/tools.gni") -import("${chip_root}/src/app/common_flags.gni") - -import("${tizen_sdk_build_root}/tizen_sdk.gni") -assert(chip_build_tools) - -source_set("chip-all-clusters-common") { - sources = [ - "${chip_root}/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp", - "${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp", - "${chip_root}/examples/all-clusters-app/all-clusters-common/src/smco-stub.cpp", - "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp", - ] - - deps = [ - "${chip_root}/examples/all-clusters-minimal-app/all-clusters-common", - "${chip_root}/examples/platform/tizen:app-main", - "${chip_root}/src/lib/shell:shell_core", - ] - - include_dirs = - [ "${chip_root}/examples/all-clusters-app/all-clusters-common/include" ] -} - -executable("chip-all-clusters-minimal-app") { - sources = [ - "include/CHIPProjectAppConfig.h", - "src/main.cpp", - ] - - deps = [ - ":chip-all-clusters-common", - "${chip_root}/examples/all-clusters-minimal-app/all-clusters-common", - "${chip_root}/examples/platform/tizen:app-main", - "${chip_root}/src/lib", - ] - - include_dirs = [ - "${chip_root}/examples/all-clusters-app/all-clusters-common/include", - "include", - ] - - output_dir = root_out_dir -} - -tizen_sdk_package("chip-all-clusters-minimal-app:tpk") { - deps = [ - ":chip-all-clusters-minimal-app", - "${chip_root}/examples/platform/tizen:author-certificate-CHIP", - ] - manifest = "tizen-manifest.xml" - sign_security_profile = "CHIP" -} - -group("tizen") { - deps = [ ":chip-all-clusters-minimal-app" ] -} - -group("tizen:tpk") { - deps = [ ":chip-all-clusters-minimal-app:tpk" ] -} - -group("default") { - deps = [ ":tizen" ] -} diff --git a/examples/all-clusters-minimal-app/tizen/args.gni b/examples/all-clusters-minimal-app/tizen/args.gni deleted file mode 100644 index bf1ef5219e..0000000000 --- a/examples/all-clusters-minimal-app/tizen/args.gni +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (c) 2020 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//build_overrides/chip.gni") - -import("${chip_root}/config/standalone/args.gni") - -chip_device_project_config_include = "" -chip_project_config_include = "" -chip_system_project_config_include = "" - -chip_project_config_include_dirs = - [ "${chip_root}/examples/all-clusters-minimal-app/tizen/include" ] -chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ] diff --git a/examples/all-clusters-minimal-app/tizen/build_overrides b/examples/all-clusters-minimal-app/tizen/build_overrides deleted file mode 120000 index e578e73312..0000000000 --- a/examples/all-clusters-minimal-app/tizen/build_overrides +++ /dev/null @@ -1 +0,0 @@ -../../build_overrides \ No newline at end of file diff --git a/examples/all-clusters-minimal-app/tizen/include/CHIPProjectAppConfig.h b/examples/all-clusters-minimal-app/tizen/include/CHIPProjectAppConfig.h deleted file mode 100644 index cecc041dc2..0000000000 --- a/examples/all-clusters-minimal-app/tizen/include/CHIPProjectAppConfig.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * Example project configuration file for CHIP. - * - * This is a place to put application or project-specific overrides - * to the default configuration values for general CHIP features. - * - */ - -#pragma once - -// include the CHIPProjectConfig from config/standalone -#include diff --git a/examples/all-clusters-minimal-app/tizen/src/main.cpp b/examples/all-clusters-minimal-app/tizen/src/main.cpp deleted file mode 100644 index 2d37747fe8..0000000000 --- a/examples/all-clusters-minimal-app/tizen/src/main.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -using namespace chip; -using namespace chip::app; -using namespace chip::DeviceLayer; - -// Network commissioning -namespace { -constexpr EndpointId kNetworkCommissioningEndpointMain = 0; -constexpr EndpointId kNetworkCommissioningEndpointSecondary = 0xFFFE; - -NetworkCommissioning::TizenEthernetDriver sEthernetDriver; -Clusters::ModeSelect::StaticSupportedModesManager sStaticSupportedModesManager; -Clusters::NetworkCommissioning::Instance sEthernetNetworkCommissioningInstance(kNetworkCommissioningEndpointMain, &sEthernetDriver); -} // namespace - -void ApplicationInit() -{ - // Enable secondary endpoint only when we need it. - emberAfEndpointEnableDisable(kNetworkCommissioningEndpointSecondary, false); - - sEthernetNetworkCommissioningInstance.Init(); - Clusters::ModeSelect::setSupportedModesManager(&sStaticSupportedModesManager); -} - -void ApplicationShutdown(){}; - -int main(int argc, char * argv[]) -{ - TizenServiceAppMain app; - VerifyOrDie(app.Init(argc, argv) == 0); - - VerifyOrDie(InitBindingHandlers() == CHIP_NO_ERROR); - - return app.RunMainLoop(); -} diff --git a/examples/all-clusters-minimal-app/tizen/third_party/connectedhomeip b/examples/all-clusters-minimal-app/tizen/third_party/connectedhomeip deleted file mode 120000 index 11a54ed360..0000000000 --- a/examples/all-clusters-minimal-app/tizen/third_party/connectedhomeip +++ /dev/null @@ -1 +0,0 @@ -../../../../ \ No newline at end of file diff --git a/examples/all-clusters-minimal-app/tizen/tizen-manifest.xml b/examples/all-clusters-minimal-app/tizen/tizen-manifest.xml deleted file mode 100644 index cbd365aec7..0000000000 --- a/examples/all-clusters-minimal-app/tizen/tizen-manifest.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - http://tizen.org/privilege/bluetooth - http://tizen.org/privilege/internet - http://tizen.org/privilege/network.get - http://tizen.org/privilege/network.set - http://tizen.org/privilege/network.profile - - true - true - true - true - true - diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index 0539af8bf6..42738adce7 100755 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -669,7 +669,6 @@ def BuildTizenTarget(): # apps target.AppendFixedTargets([ TargetPart('all-clusters', app=TizenApp.ALL_CLUSTERS), - TargetPart('all-clusters-minimal', app=TizenApp.ALL_CLUSTERS_MINIMAL), TargetPart('chip-tool', app=TizenApp.CHIP_TOOL), TargetPart('light', app=TizenApp.LIGHT), TargetPart('tests', app=TizenApp.TESTS), diff --git a/scripts/build/builders/tizen.py b/scripts/build/builders/tizen.py index b9b9c59661..8c7968888e 100644 --- a/scripts/build/builders/tizen.py +++ b/scripts/build/builders/tizen.py @@ -39,11 +39,6 @@ class TizenApp(Enum): 'examples/all-clusters-app/tizen', ('chip-all-clusters-app', 'chip-all-clusters-app.map')) - ALL_CLUSTERS_MINIMAL = App( - 'chip-all-clusters-minimal-app', - 'examples/all-clusters-minimal-app/tizen', - ('chip-all-clusters-minimal-app', - 'chip-all-clusters-minimal-app.map')) LIGHT = App( 'chip-lighting-app', 'examples/lighting-app/tizen', diff --git a/scripts/build/testdata/all_targets_linux_x64.txt b/scripts/build/testdata/all_targets_linux_x64.txt index 51d507072b..c9a9a40eed 100644 --- a/scripts/build/testdata/all_targets_linux_x64.txt +++ b/scripts/build/testdata/all_targets_linux_x64.txt @@ -21,6 +21,6 @@ nrf-native-posix-64-tests nuttx-x64-light qpg-qpg6105-{lock,light,shell,persistent-storage,light-switch,thermostat}[-updateimage][-data-model-disabled][-data-model-enabled] stm32-stm32wb5mm-dk-light -tizen-arm-{all-clusters,all-clusters-minimal,chip-tool,light,tests}[-no-ble][-no-thread][-no-wifi][-asan][-ubsan][-with-ui] +tizen-arm-{all-clusters,chip-tool,light,tests}[-no-ble][-no-thread][-no-wifi][-asan][-ubsan][-with-ui] telink-{tlsr9118bdk40d,tlsr9518adk80d,tlsr9528a,tlsr9528a_retention,tlsr9258a,tlsr9258a_retention}-{air-quality-sensor,all-clusters,all-clusters-minimal,bridge,contact-sensor,light,light-switch,lock,ota-requestor,pump,pump-controller,shell,smoke-co-alarm,temperature-measurement,thermostat,window-covering}[-ota][-dfu][-shell][-rpc][-factory-data][-4mb][-mars][-usb][-data-model-disabled][-data-model-enabled] openiotsdk-{shell,lock}[-mbedtls][-psa] From 6880437cffc874c2564d82fe0efb3a5a74cb93a5 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 10 Oct 2024 17:09:46 -0400 Subject: [PATCH 085/127] Attempt to fix ESP32 builds by adding an extra dependency (#36025) * Attempt to fix ESP32 builds by not compiling insights at all. This breaks insights, but should make CI pass * Fix typo * Another better fix: pull in the other dependency too --------- Co-authored-by: Andrei Litvin --- config/esp32/components/chip/idf_component.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/config/esp32/components/chip/idf_component.yml b/config/esp32/components/chip/idf_component.yml index aeffec708d..1917fcf4de 100644 --- a/config/esp32/components/chip/idf_component.yml +++ b/config/esp32/components/chip/idf_component.yml @@ -26,6 +26,14 @@ dependencies: - if: "idf_version >=5.0" - if: "target != esp32h2" + # This matches the dependency of esp_insights + espressif/esp_diag_data_store: + version: "1.0.1" + require: public + rules: + - if: "idf_version >=5.0" + - if: "target != esp32h2" + espressif/esp_rcp_update: version: "1.2.0" rules: From 14e75a47997c758e40af7b44ffc73f218a0e10fc Mon Sep 17 00:00:00 2001 From: yunhanw-google Date: Thu, 10 Oct 2024 15:48:38 -0700 Subject: [PATCH 086/127] Store icdClientInfo after completing check-in message validation (#36026) --- src/app/icd/client/CheckInHandler.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/icd/client/CheckInHandler.cpp b/src/app/icd/client/CheckInHandler.cpp index 8f0a4de9c1..e0edc649cc 100644 --- a/src/app/icd/client/CheckInHandler.cpp +++ b/src/app/icd/client/CheckInHandler.cpp @@ -130,6 +130,7 @@ CHIP_ERROR CheckInHandler::OnMessageReceived(Messaging::ExchangeContext * ec, co } else { + mpICDClientStorage->StoreEntry(clientInfo); mpCheckInDelegate->OnCheckInComplete(clientInfo); #if CHIP_CONFIG_ENABLE_READ_CLIENT mpImEngine->OnActiveModeNotification(clientInfo.peer_node); From a76cc9bcb73425c325295456e5f1a5023bfa2f47 Mon Sep 17 00:00:00 2001 From: Sergio Soares Date: Thu, 10 Oct 2024 19:32:03 -0400 Subject: [PATCH 087/127] python_testing: Improve TC_IDM_10_1 error msgs (#35999) * python_testing: Improve TC_IDM_10_1 error msgs * Fix the prefix ID displayed in TC_IDM_10_1 error messages * Add "(Test Vendor)" to the error message when the ID is in the test vendor range * Apply suggestions from code review Co-authored-by: Tennessee Carmel-Veilleux * Apply Cecille's suggestion to use GlobalAttributeIds checks * Add space before (MEI) Co-authored-by: Arkadiusz Bokowy * Apply Tennessee's review suggestions * Restyled by isort --------- Co-authored-by: Tennessee Carmel-Veilleux Co-authored-by: Arkadiusz Bokowy Co-authored-by: Andrei Litvin Co-authored-by: Restyled.io --- .../TC_DeviceBasicComposition.py | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/src/python_testing/TC_DeviceBasicComposition.py b/src/python_testing/TC_DeviceBasicComposition.py index 9ff05d4ab0..ba10ba9767 100644 --- a/src/python_testing/TC_DeviceBasicComposition.py +++ b/src/python_testing/TC_DeviceBasicComposition.py @@ -109,7 +109,7 @@ from chip.clusters.ClusterObjects import ClusterAttributeDescriptor, ClusterObjectFieldDescriptor from chip.interaction_model import InteractionModelError, Status from chip.tlv import uint -from global_attribute_ids import GlobalAttributeIds +from global_attribute_ids import AttributeIdType, ClusterIdType, GlobalAttributeIds, attribute_id_type, cluster_id_type from matter_testing_support import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, MatterBaseTest, TestStep, async_test_body, default_matter_test_main) from mobly import asserts @@ -118,6 +118,11 @@ separate_endpoint_types) +def get_vendor_id(mei: int) -> int: + """Get the vendor ID portion (MEI prefix) of an overall MEI.""" + return (mei >> 16) & 0xffff + + def check_int_in_range(min_value: int, max_value: int, allow_null: bool = False) -> Callable: """Returns a checker for whether `obj` is an int that fits in a range.""" def int_in_range_checker(obj: Any): @@ -488,15 +493,17 @@ class RequiredMandatoryAttribute: cmd_prefixes = [a & 0xFFFF_0000 for a in cmd_values] bad_attrs = [a for a in attr_prefixes if a >= bad_prefix_min] bad_cmds = [a for a in cmd_prefixes if a >= bad_prefix_min] - for bad in bad_attrs: - location = AttributePathLocation(endpoint_id=endpoint_id, cluster_id=cluster_id, attribute_id=bad) + for bad_attrib_id in bad_attrs: + location = AttributePathLocation(endpoint_id=endpoint_id, cluster_id=cluster_id, attribute_id=bad_attrib_id) + vendor_id = get_vendor_id(bad_attrib_id) self.record_error(self.get_test_name( - ), location=location, problem=f'Attribute with bad prefix {attribute_id} in cluster {cluster_id}', spec_location='Manufacturer Extensible Identifier (MEI)') + ), location=location, problem=f'Attribute 0x{bad_attrib_id:08x} with bad prefix 0x{vendor_id:04x} in cluster 0x{cluster_id:08x}' + (' (Test Vendor)' if attribute_id_type(bad_attrib_id) == AttributeIdType.kTest else ''), spec_location='Manufacturer Extensible Identifier (MEI)') success = False - for bad in bad_cmds: - location = CommandPathLocation(endpoint_id=endpoint_id, cluster_id=cluster_id, command_id=bad) + for bad_cmd_id in bad_cmds: + location = CommandPathLocation(endpoint_id=endpoint_id, cluster_id=cluster_id, command_id=bad_cmd_id) + vendor_id = get_vendor_id(bad_cmd_id) self.record_error(self.get_test_name( - ), location=location, problem=f'Command with bad prefix {attribute_id} in cluster {cluster_id}', spec_location='Manufacturer Extensible Identifier (MEI)') + ), location=location, problem=f'Command 0x{bad_cmd_id:08x} with bad prefix 0x{vendor_id:04x} in cluster 0x{cluster_id:08x}', spec_location='Manufacturer Extensible Identifier (MEI)') success = False self.print_step(7, "Validate that none of the MEI global attribute IDs contain values outside of the allowed suffix range") @@ -539,10 +546,11 @@ class RequiredMandatoryAttribute: for endpoint_id, endpoint in self.endpoints_tlv.items(): cluster_prefixes = [a & 0xFFFF_0000 for a in endpoint.keys()] bad_clusters_ids = [a for a in cluster_prefixes if a >= bad_prefix_min] - for bad in bad_clusters_ids: - location = ClusterPathLocation(endpoint_id=endpoint_id, cluster_id=bad) + for bad_cluster_id in bad_clusters_ids: + location = ClusterPathLocation(endpoint_id=endpoint_id, cluster_id=bad_cluster_id) + vendor_id = get_vendor_id(bad_cluster_id) self.record_error(self.get_test_name(), location=location, - problem=f'Bad cluster id prefix {bad}', spec_location='Manufacturer Extensible Identifier (MEI)') + problem=f'Cluster 0x{bad_cluster_id:08x} with bad prefix 0x{vendor_id:04x}' + (' (Test Vendor)' if cluster_id_type(bad_cluster_id) == ClusterIdType.kTest else ''), spec_location='Manufacturer Extensible Identifier (MEI)') success = False self.print_step(9, "Validate that all clusters in the standard range have a known cluster ID") From 18bcd0cfa984106bd438fa2b5ceb93e44e340982 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 11 Oct 2024 02:53:21 -0400 Subject: [PATCH 088/127] Fix device type metadata for bridge device types. (#36034) * Bridged Node was named wrong. * Aggregator had a class listed that did not match the spec. --- .../zap-templates/zcl/data-model/chip/matter-devices.xml | 6 +++--- .../Framework/CHIP/templates/MTRDeviceTypeMetadata-src.zapt | 4 +--- .../Framework/CHIP/zap-generated/MTRDeviceTypeMetadata.mm | 4 ++-- .../chip-tool/zap-generated/cluster/logging/EntryToText.cpp | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) 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 29aaae7280..79ba80159f 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 @@ -177,7 +177,7 @@ limitations under the License. Matter Aggregator 0x0103 0x000e - Dynamic Utility + Simple Endpoint @@ -190,9 +190,9 @@ limitations under the License. - MA-bridgeddevice + MA-bridgednode CHIP - Matter Bridged Device + Matter Bridged Node 0x0103 0x0013 Utility diff --git a/src/darwin/Framework/CHIP/templates/MTRDeviceTypeMetadata-src.zapt b/src/darwin/Framework/CHIP/templates/MTRDeviceTypeMetadata-src.zapt index c3e594930d..7047fb21ac 100644 --- a/src/darwin/Framework/CHIP/templates/MTRDeviceTypeMetadata-src.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRDeviceTypeMetadata-src.zapt @@ -21,9 +21,7 @@ struct DeviceTypeData { constexpr DeviceTypeData knownDeviceTypes[] = { {{#zcl_device_types}} {{#if class}} - {{! For now work around the "Dynamic Utility" thing on Aggregator by just - taking the last word. }} - { {{asHex code 8}}, DeviceTypeClass::{{asLastWord class}}, "{{caption}}" }, + { {{asHex code 8}}, DeviceTypeClass::{{class}}, "{{caption}}" }, {{/if}} {{/zcl_device_types}} }; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRDeviceTypeMetadata.mm b/src/darwin/Framework/CHIP/zap-generated/MTRDeviceTypeMetadata.mm index d743598efe..bd32866dc4 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRDeviceTypeMetadata.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRDeviceTypeMetadata.mm @@ -36,11 +36,11 @@ constexpr DeviceTypeData knownDeviceTypes[] = { { 0x0000000A, DeviceTypeClass::Simple, "Matter Door Lock" }, { 0x0000000B, DeviceTypeClass::Simple, "Matter Door Lock Controller" }, - { 0x0000000E, DeviceTypeClass::Utility, "Matter Aggregator" }, + { 0x0000000E, DeviceTypeClass::Simple, "Matter Aggregator" }, { 0x0000000F, DeviceTypeClass::Simple, "Matter Generic Switch" }, { 0x00000011, DeviceTypeClass::Utility, "Matter Power Source" }, { 0x00000012, DeviceTypeClass::Utility, "Matter OTA Requestor" }, - { 0x00000013, DeviceTypeClass::Utility, "Matter Bridged Device" }, + { 0x00000013, DeviceTypeClass::Utility, "Matter Bridged Node" }, { 0x00000014, DeviceTypeClass::Utility, "Matter OTA Provider" }, { 0x00000015, DeviceTypeClass::Simple, "Matter Contact Sensor" }, { 0x00000016, DeviceTypeClass::Node, "Matter Root Node" }, diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp index f42faea3c0..a06e87e063 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp @@ -6485,7 +6485,7 @@ char const * DeviceTypeIdToText(chip::DeviceTypeId id) case 0x00000012: return "Matter OTA Requestor"; case 0x00000013: - return "Matter Bridged Device"; + return "Matter Bridged Node"; case 0x00000014: return "Matter OTA Provider"; case 0x00000015: From 49db4159d8926f4704c8ff8271cfa42633751d5b Mon Sep 17 00:00:00 2001 From: Dieter Van der Meulen <87530904+dvdm-qorvo@users.noreply.github.com> Date: Fri, 11 Oct 2024 14:41:39 +0200 Subject: [PATCH 089/127] [QPG] Fix for OpenThread Stack bump compile issue (#36039) --- examples/platform/qpg/project_include/OpenThreadConfig.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/platform/qpg/project_include/OpenThreadConfig.h b/examples/platform/qpg/project_include/OpenThreadConfig.h index d6955a90a5..a5dd275eb1 100644 --- a/examples/platform/qpg/project_include/OpenThreadConfig.h +++ b/examples/platform/qpg/project_include/OpenThreadConfig.h @@ -80,6 +80,8 @@ #define OPENTHREAD_EXAMPLES_SIMULATION 0 #define OPENTHREAD_CONFIG_PLATFORM_BOOTLOADER_MODE_ENABLE 0 +#define OPENTHREAD_PLATFORM_NEXUS 0 + // Use the Qorvo-supplied default platform configuration for remainder // of OpenThread config options. // From f5bf220f4b2a9d6c636ebddf19f26274971953ec Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 11 Oct 2024 09:02:00 -0400 Subject: [PATCH 090/127] Fix name of the Secondary Network Interface device type in the XML. (#36032) The name does not include "Device Type" in it. --- src/app/zap-templates/zcl/data-model/chip/matter-devices.xml | 2 +- .../Framework/CHIP/zap-generated/MTRDeviceTypeMetadata.mm | 2 +- .../chip-tool/zap-generated/cluster/logging/EntryToText.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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 79ba80159f..37af769393 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 @@ -2612,7 +2612,7 @@ limitations under the License. MA-secondary-network-interface CHIP - Matter Secondary Network Interface Device Type + Matter Secondary Network Interface 0x0103 0x0019 Utility diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRDeviceTypeMetadata.mm b/src/darwin/Framework/CHIP/zap-generated/MTRDeviceTypeMetadata.mm index bd32866dc4..5658861414 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRDeviceTypeMetadata.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRDeviceTypeMetadata.mm @@ -44,7 +44,7 @@ { 0x00000014, DeviceTypeClass::Utility, "Matter OTA Provider" }, { 0x00000015, DeviceTypeClass::Simple, "Matter Contact Sensor" }, { 0x00000016, DeviceTypeClass::Node, "Matter Root Node" }, - { 0x00000019, DeviceTypeClass::Utility, "Matter Secondary Network Interface Device Type" }, + { 0x00000019, DeviceTypeClass::Utility, "Matter Secondary Network Interface" }, { 0x00000022, DeviceTypeClass::Simple, "Matter Speaker" }, { 0x00000023, DeviceTypeClass::Simple, "Matter Casting Video Player" }, { 0x00000024, DeviceTypeClass::Simple, "Matter Content App" }, diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp index a06e87e063..b33467eeba 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp @@ -6493,7 +6493,7 @@ char const * DeviceTypeIdToText(chip::DeviceTypeId id) case 0x00000016: return "Matter Root Node"; case 0x00000019: - return "Matter Secondary Network Interface Device Type"; + return "Matter Secondary Network Interface"; case 0x00000022: return "Matter Speaker"; case 0x00000023: From cc50e9e2e16c121a46c5fe908489d404e386a20c Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 11 Oct 2024 09:14:11 -0400 Subject: [PATCH 091/127] Add logic to stop full CI if some fast and required checks fail (#36000) * Add job cancel logic and intentional failure. * Give github token permissions on actions * Update logic to have a scheduled job * Restyle * Undo manual change * Remove unnedded files * Undo extra changes * Update date-time sorting * Fix up none possibility on updated at * Be more strict on max age now that we use udpate time * Add support for minute age PRs since we run this so frequently * Make cutoff to not be a rolling target * Use created time if updated time is not available * Make date-time display be reasonable * Null handle fix * Restyle --------- Co-authored-by: Andrei Litvin --- .../workflows/cancel_workflows_for_pr.yaml | 24 ++-- scripts/tools/cancel_workflows_for_pr.py | 136 +++++++++++++++--- 2 files changed, 126 insertions(+), 34 deletions(-) diff --git a/.github/workflows/cancel_workflows_for_pr.yaml b/.github/workflows/cancel_workflows_for_pr.yaml index c8b23b6de7..45b762488a 100644 --- a/.github/workflows/cancel_workflows_for_pr.yaml +++ b/.github/workflows/cancel_workflows_for_pr.yaml @@ -12,22 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -name: Cancel workflow on PR +name: Cancel workflows on failing CI on: workflow_dispatch: - inputs: - pull_request_id: - description: 'PR number to consider' - required: true - type: number - commit_sha: - description: 'Cancel runs for this specific SHA' - required: true - type: string + schedule: + - cron: "*/10 * * * *" jobs: cancel_workflow: - name: Report on pull requests + name: Cancel CI on failing pull requests runs-on: ubuntu-latest @@ -50,6 +43,9 @@ jobs: - name: Cancel runs run: | scripts/tools/cancel_workflows_for_pr.py \ - --pull-request ${{ inputs.pull_request_id }} \ - --commit-sha "${{ inputs.commit_sha }}" \ - --gh-api-token "${{ secrets.GITHUB_TOKEN }}" + --gh-api-token "${{ secrets.GITHUB_TOKEN }}" \ + --require "Restyled" \ + --require "Lint Code Base" \ + --require "ZAP" \ + --require "Run misspell" \ + --max-pr-age-minutes 20 diff --git a/scripts/tools/cancel_workflows_for_pr.py b/scripts/tools/cancel_workflows_for_pr.py index bd4b85374c..fe5f028bc3 100755 --- a/scripts/tools/cancel_workflows_for_pr.py +++ b/scripts/tools/cancel_workflows_for_pr.py @@ -15,11 +15,17 @@ # limitations under the License. # +import datetime import logging +import re +from typing import Optional, Set import click import coloredlogs +from dateutil.tz import tzlocal from github import Github +from github.Commit import Commit +from github.PullRequest import PullRequest __LOG_LEVELS__ = { "debug": logging.DEBUG, @@ -32,28 +38,99 @@ class Canceller: - def __init__(self, token): + def __init__(self, token: str, dry_run: bool): self.api = Github(token) self.repo = self.api.get_repo(REPOSITORY) + self.dry_run = dry_run + + def check_all_pending_prs(self, max_age, required_runs): + cutoff = datetime.datetime.now(tzlocal()) - max_age + logging.info("Searching PRs updated after %s", cutoff) + for pr in self.repo.get_pulls(state="open", sort="updated", direction="desc"): + pr_update = pr.updated_at if pr.updated_at else pr.created_at + pr_update = pr_update.astimezone(tzlocal()) + + if pr_update < cutoff: + logging.warning( + "PR is too old (since %s, cutoff at %s). Skipping the rest...", + pr_update, + cutoff, + ) + break + logging.info( + "Examining PR %d updated at %s: %s", pr.number, pr_update, pr.title + ) + self.check_pr(pr, required_runs) + + def check_pr(self, pr: PullRequest, required_runs): + + last_commit: Optional[Commit] = None - def cancel_all_runs(self, pr_number, commit_sha, dry_run): - pr = self.repo.get_pull(pr_number) - logging.info("Examining PR '%s'", pr.title) for commit in pr.get_commits(): - if commit.sha != commit_sha: - logging.info("Skipping SHA '%s' as it was not selected", commit.sha) + logging.debug(" Found commit %s", commit.sha) + if pr.head.sha == commit.sha: + last_commit = commit + break + + if last_commit is None: + logging.error("Could not find any commit in the pull request.") + return + + logging.info("Last commit is: %s", last_commit.sha) + + in_progress_workflows: Set[int] = set() + failed_check_names: Set[str] = set() + + # Gather all workflows along with failed workflow names + for check_suite in last_commit.get_check_suites(): + if check_suite.conclusion == "success": + # Finished without errors. Nothing to do here continue + for run in check_suite.get_check_runs(): + if run.conclusion is not None and run.conclusion != "failure": + logging.debug( + " Run %s is not interesting: (state %s, conclusion %s)", + run.name, + run.status, + run.conclusion, + ) + continue - for check_suite in commit.get_check_suites(): - for run in check_suite.get_check_runs(): - if run.status in {"in_progress", "queued"}: - if dry_run: - logging.warning("DRY RUN: Will not stop run %s", run.name) - else: - logging.warning("Stopping run %s", run.name) - self.repo.get_workflow_run(run.id).cancel() - else: - logging.info("Skip over run %s (%s)", run.name, run.status) + # TODO: I am unclear how to really find the workflow id, however the + # HTML URL is like https://github.com/project-chip/connectedhomeip/actions/runs/11261874698/job/31316278705 + # so need whatever is after run. + m = re.match(r".*/actions/runs/([\d]+)/job/.*", run.html_url) + if not m: + logging.error( + "Failed to extract workflow number from %s", run.html_url + ) + continue + + workflow_id = int(m.group(1)) + if run.conclusion is None: + logging.info( + " Workflow %d (i.e. %s) still pending: %s", + workflow_id, + run.name, + run.status, + ) + in_progress_workflows.add(workflow_id) + elif run.conclusion == "failure": + workflow = self.repo.get_workflow_run(workflow_id) + logging.warning(" Workflow %s Failed", workflow.name) + failed_check_names.add(workflow.name) + + if not any([name in failed_check_names for name in required_runs]): + logging.info("No critical failures found") + return + + for id in in_progress_workflows: + workflow = self.repo.get_workflow_run(id) + if self.dry_run: + logging.warning("DRY RUN: Will not stop %s", workflow.name) + else: + workflow.cancel() + logging.warning("Stopping workflow %s", workflow.name) @click.command() @@ -63,12 +140,25 @@ def cancel_all_runs(self, pr_number, commit_sha, dry_run): type=click.Choice(list(__LOG_LEVELS__.keys()), case_sensitive=False), help="Determines the verbosity of script output.", ) -@click.option("--pull-request", type=int, help="Pull request number to consider") -@click.option("--commit-sha", help="Commit to look at when cancelling pull requests") @click.option("--gh-api-token", help="Github token to use") @click.option("--token-file", help="Read github token from the given file") @click.option("--dry-run", default=False, is_flag=True, help="Actually cancel or not") -def main(log_level, pull_request, commit_sha, gh_api_token, token_file, dry_run): +@click.option( + "--max-pr-age-days", default=0, type=int, help="How many days to look at PRs" +) +@click.option( + "--max-pr-age-minutes", default=0, type=int, help="How many minutes to look at PRs" +) +@click.option("--require", multiple=True, default=[], help="Name of required runs") +def main( + log_level, + gh_api_token, + token_file, + dry_run, + max_pr_age_days, + max_pr_age_minutes, + require, +): coloredlogs.install( level=__LOG_LEVELS__[log_level], fmt="%(asctime)s %(levelname)-7s %(message)s" ) @@ -80,7 +170,13 @@ def main(log_level, pull_request, commit_sha, gh_api_token, token_file, dry_run) else: raise Exception("Require a --gh-api-token or --token-file to access github") - Canceller(gh_token).cancel_all_runs(pull_request, commit_sha, dry_run) + max_age = datetime.timedelta(days=max_pr_age_days, minutes=max_pr_age_minutes) + if max_age == datetime.timedelta(): + raise Exception( + "Please specifiy a max age of minutes or days (--max-pr-age-days or --max-pr-age-minutes)" + ) + + Canceller(gh_token, dry_run).check_all_pending_prs(max_age, require) if __name__ == "__main__": From fa570cc3a2763e78ffb151c5502b5b35bcd1bcda Mon Sep 17 00:00:00 2001 From: Shubham Patil Date: Fri, 11 Oct 2024 18:50:49 +0530 Subject: [PATCH 092/127] Revert "esp32-fix-empty-logs(#35939)" (#36035) * Revert "esp32-fix-empty-logs(#35939) (#35965)" This reverts commit 2a19f577b15c9cf1c1433bba14e6fff0d141ed41. * Add comment explaining why printf is used --- src/platform/ESP32/Logging.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/platform/ESP32/Logging.cpp b/src/platform/ESP32/Logging.cpp index 9dfa1d87a1..9ad98db789 100644 --- a/src/platform/ESP32/Logging.cpp +++ b/src/platform/ESP32/Logging.cpp @@ -25,13 +25,16 @@ void LogV(const char * module, uint8_t category, const char * msg, va_list v) snprintf(tag, sizeof(tag), "chip[%s]", module); tag[sizeof(tag) - 1] = 0; + // We intentionally added the printf statements to ensure we could apply colors to logs redirected to the console. + // The printf statements are not bypassing the log level, rather, they are intentionally designed to print the + // initial and later parts of the log. switch (category) { case kLogCategory_Error: { { - esp_log_write(ESP_LOG_ERROR, tag, LOG_COLOR_E "E (%" PRIu32 ") %s: ", esp_log_timestamp(), tag); + printf(LOG_COLOR_E "E (%" PRIu32 ") %s: ", esp_log_timestamp(), tag); esp_log_writev(ESP_LOG_ERROR, tag, msg, v); - esp_log_write(ESP_LOG_ERROR, tag, LOG_RESET_COLOR "\n"); + printf(LOG_RESET_COLOR "\n"); } } break; @@ -39,18 +42,18 @@ void LogV(const char * module, uint8_t category, const char * msg, va_list v) case kLogCategory_Progress: default: { { - esp_log_write(ESP_LOG_INFO, tag, LOG_COLOR_I "I (%" PRIu32 ") %s: ", esp_log_timestamp(), tag); + printf(LOG_COLOR_I "I (%" PRIu32 ") %s: ", esp_log_timestamp(), tag); esp_log_writev(ESP_LOG_INFO, tag, msg, v); - esp_log_write(ESP_LOG_INFO, tag, LOG_RESET_COLOR "\n"); + printf(LOG_RESET_COLOR "\n"); } } break; case kLogCategory_Detail: { { - esp_log_write(ESP_LOG_DEBUG, tag, LOG_COLOR_D "D (%" PRIu32 ") %s: ", esp_log_timestamp(), tag); + printf(LOG_COLOR_D "D (%" PRIu32 ") %s: ", esp_log_timestamp(), tag); esp_log_writev(ESP_LOG_DEBUG, tag, msg, v); - esp_log_write(ESP_LOG_DEBUG, tag, LOG_RESET_COLOR "\n"); + printf(LOG_RESET_COLOR "\n"); } } break; From 55a6c6b8e55bc0978c8fff164bd21a833dca9d4a Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Fri, 11 Oct 2024 06:30:46 -0700 Subject: [PATCH 093/127] Correct copy&paste errors in log (#36019) --- examples/fabric-admin/device_manager/UniqueIdGetter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/fabric-admin/device_manager/UniqueIdGetter.cpp b/examples/fabric-admin/device_manager/UniqueIdGetter.cpp index 9c59e54137..49ce9b663c 100644 --- a/examples/fabric-admin/device_manager/UniqueIdGetter.cpp +++ b/examples/fabric-admin/device_manager/UniqueIdGetter.cpp @@ -131,7 +131,7 @@ void UniqueIdGetter::OnDeviceConnected(Messaging::ExchangeManager & exchangeMgr, if (err != CHIP_NO_ERROR) { - ChipLogError(NotSpecified, "Failed to issue subscription to AdministratorCommissioning data"); + ChipLogError(NotSpecified, "Failed to read unique ID from the bridged device."); OnDone(nullptr); return; } @@ -140,7 +140,7 @@ void UniqueIdGetter::OnDeviceConnected(Messaging::ExchangeManager & exchangeMgr, void UniqueIdGetter::OnDeviceConnectionFailure(const ScopedNodeId & peerId, CHIP_ERROR error) { VerifyOrDie(mCurrentlyGettingUid); - ChipLogError(NotSpecified, "DeviceSubscription failed to connect to " ChipLogFormatX64, ChipLogValueX64(peerId.GetNodeId())); + ChipLogError(NotSpecified, "UniqueIdGetter failed to connect to " ChipLogFormatX64, ChipLogValueX64(peerId.GetNodeId())); OnDone(nullptr); } From 907caa6227f9bc5f7ae30f69b8e5e6af2e19348b Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 11 Oct 2024 09:34:27 -0400 Subject: [PATCH 094/127] Fix dependency requirement for CI cancel (#36041) Co-authored-by: Andrei Litvin --- .github/workflows/cancel_workflows_for_pr.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cancel_workflows_for_pr.yaml b/.github/workflows/cancel_workflows_for_pr.yaml index 45b762488a..caba07bedf 100644 --- a/.github/workflows/cancel_workflows_for_pr.yaml +++ b/.github/workflows/cancel_workflows_for_pr.yaml @@ -35,10 +35,11 @@ jobs: python-version: '3.12' - name: Setup pip modules we use run: | - pip install \ - click \ - coloredlogs \ - pygithub \ + pip install \ + click \ + coloredlogs \ + python-dateutil \ + pygithub \ && echo "DONE installint python prerequisites" - name: Cancel runs run: | From 3732a89eb8d5e91b86e099677cdb254a6b9ff6ff Mon Sep 17 00:00:00 2001 From: Vatsal Ghelani <152916324+vatsalghelani-csa@users.noreply.github.com> Date: Fri, 11 Oct 2024 11:14:12 -0400 Subject: [PATCH 095/127] Restyler Fixes for reverted PR #34785 (#36022) * Refactoring of the matter testing infrastructure * Restyled by shfmt * Manually fix restyle * Manually fix restyle * Manually restyle * Manually fix restyle * Manually fix restyle * Renamed testing_support to matter_testing _support * Fixed the support scripts from matter_testing_support * Fixed TC_OVENOPSTATE_2_6.py for import command * replace all os.path.join and such (using _file_) with their own method * Fixed paths.py for import * Fixed imports for TC_DeviceConformace.py * Fixed the broken import for matter_testing * Make sure modules match master * Debug the data model files for spec_parsing * Try to guess data model root * Restyle * Moving Test* from python_testing to matter_testing_support * Removed the tests moved from glob python scripts * Restyled by isort * Added taglist_and_topology_test.py to the support tests list * Restyled by isort * Fixed the structure for accessing example_pics_xml_basic_info.xml * Fixing the TC_RVCCLEANM_2_2.py script according to master changes * Changes according to master * Fixing structuring of TestMatterTestingSupport.py and TestSpecParsingSupport.py * Restyled by isort * Fixed typo on src/python_testing/matter_testing_infrastructure/BUILD.gn tests section * Fixed import for TC_ICDM_3_2.py * Fix Import for TC_RVCCLEANM_2_2.py * Restyled by autopep8 * Update line formatting in TestSpecParsingSupport.py * Fixed comment on execute_python_tests.py * tests.yaml test * Test to fix src/python_testing/test_testing directory imports * Restyled by isort * Fixed code lints * Fix imports for test_testing directory * Fixed imports on test_TC_ICDM_2_1.py * Restyled by autopep8 * Restyled by isort * Updated imported fixes on test_TC_ICDM_2_1.py * Restyled by autopep8 * Restyled by isort * Import fixes for parent directory test imports * Fixing try-except imports for test_testing directory scripts * Remove unwanted import os from 2 scripts * Restyled by isort * Restyled by isort * Restyled by autopep8 * Restyled by isort * Updated paths and spec_xml scripts * Fixed unused imports * Restyled by isort * Try to guess data model root * Fixed wrong string via GUI that was set in vscode * Fix matter_testing imports * Comment * Remove comment * Fixed import and improved logging via flush of stdout * Fixed matter support import for test scripts * Restyled by isort * Fixed "os.environ is not callable, it is a dictionary" Co-authored-by: Andrei Litvin * Import fixed for TC_CCTRL_2_3.py * Update logic to match master * Fixed multiple executions of the same tests * Fixed test_testing scripts with master * Restyled by isort * Fixing code lints * Restyled by autopep8 * Fix formate changes happened with autosave on TestSpecParsingSupport.py * Fixed module import in MockTestRunner script * Restructured the tasks.py scripts in matter_testing_support * Fixed formatting * Restyled by shfmt * Restyled by isort * Fixed code lints * Fixed imports for the new scripts added * Fixed k1_4 for the test script * Restyled by autopep8 * Fixed import for new scripts added * Added support for v1_4 * Update TestSpecParsingSupport.py * Added the missed part of the code after hard reset from commit d0e36909af460b490565b1798bc7b4f0042a8545 * Print statements to test * Update TestSpecParsingSupport.py * Added in_progress for DEFAULT_OUTPUT_DIR_IN_PROGRESS * Added support for conformance_support in atomic attributes * Removing test prints statements * Restyled by isort * Checking in Thermostat's Revision * Check and Verified Cluster Thermostats's Revision * Restyled by isort * Fixed improts with news supports apps.py * Restyled by isort * Fixed imports for ECOINFO scripts * Restyled by isort * Renamed matter_testing_support to chip.testing * Update TestSpecParsingSupport.py * Restyled by shfmt * Restyled by isort * Fixed imports and correct wheel errors * Fixed chip_testing wheel * Update build_python.sh * Fixed the restyler added f-strings breaks * Restyled by autopep8 * Restyled by isort --------- Co-authored-by: Restyled.io Co-authored-by: Andrei Litvin --- docs/testing/python.md | 10 +- scripts/spec_xml/generate_spec_xml.py | 60 ++++------ scripts/spec_xml/paths.py | 109 ++++++++++++++++++ src/python_testing/MinimalRepresentation.py | 6 +- src/python_testing/TCP_Tests.py | 2 +- src/python_testing/TC_ACE_1_2.py | 2 +- src/python_testing/TC_ACE_1_3.py | 2 +- src/python_testing/TC_ACE_1_4.py | 2 +- src/python_testing/TC_ACE_1_5.py | 2 +- src/python_testing/TC_ACL_2_11.py | 4 +- src/python_testing/TC_ACL_2_2.py | 2 +- src/python_testing/TC_AccessChecker.py | 10 +- src/python_testing/TC_BOOLCFG_2_1.py | 2 +- src/python_testing/TC_BOOLCFG_3_1.py | 2 +- src/python_testing/TC_BOOLCFG_4_1.py | 2 +- src/python_testing/TC_BOOLCFG_4_2.py | 2 +- src/python_testing/TC_BOOLCFG_4_3.py | 2 +- src/python_testing/TC_BOOLCFG_4_4.py | 2 +- src/python_testing/TC_BOOLCFG_5_1.py | 2 +- src/python_testing/TC_BOOLCFG_5_2.py | 2 +- src/python_testing/TC_BRBINFO_4_1.py | 2 +- src/python_testing/TC_CADMIN_1_9.py | 2 +- src/python_testing/TC_CCTRL_2_1.py | 2 +- src/python_testing/TC_CCTRL_2_2.py | 4 +- src/python_testing/TC_CCTRL_2_3.py | 4 +- src/python_testing/TC_CC_10_1.py | 2 +- src/python_testing/TC_CC_2_2.py | 4 +- src/python_testing/TC_CGEN_2_4.py | 2 +- src/python_testing/TC_CNET_1_4.py | 2 +- src/python_testing/TC_CNET_4_4.py | 2 +- src/python_testing/TC_DA_1_2.py | 5 +- src/python_testing/TC_DA_1_5.py | 2 +- src/python_testing/TC_DA_1_7.py | 4 +- src/python_testing/TC_DEMTestBase.py | 2 +- src/python_testing/TC_DEM_2_1.py | 2 +- src/python_testing/TC_DEM_2_10.py | 4 +- src/python_testing/TC_DEM_2_2.py | 2 +- src/python_testing/TC_DEM_2_3.py | 2 +- src/python_testing/TC_DEM_2_4.py | 2 +- src/python_testing/TC_DEM_2_5.py | 2 +- src/python_testing/TC_DEM_2_6.py | 2 +- src/python_testing/TC_DEM_2_7.py | 2 +- src/python_testing/TC_DEM_2_8.py | 2 +- src/python_testing/TC_DEM_2_9.py | 2 +- src/python_testing/TC_DGGEN_2_4.py | 5 +- src/python_testing/TC_DGGEN_3_2.py | 2 +- src/python_testing/TC_DGSW_2_1.py | 2 +- src/python_testing/TC_DRLK_2_12.py | 2 +- src/python_testing/TC_DRLK_2_13.py | 2 +- src/python_testing/TC_DRLK_2_2.py | 2 +- src/python_testing/TC_DRLK_2_3.py | 2 +- src/python_testing/TC_DRLK_2_5.py | 2 +- src/python_testing/TC_DRLK_2_9.py | 2 +- .../TC_DeviceBasicComposition.py | 14 +-- src/python_testing/TC_DeviceConformance.py | 18 +-- src/python_testing/TC_ECOINFO_2_1.py | 2 +- src/python_testing/TC_ECOINFO_2_2.py | 2 +- src/python_testing/TC_EEM_2_1.py | 2 +- src/python_testing/TC_EEM_2_2.py | 2 +- src/python_testing/TC_EEM_2_3.py | 2 +- src/python_testing/TC_EEM_2_4.py | 2 +- src/python_testing/TC_EEM_2_5.py | 2 +- src/python_testing/TC_EEVSE_2_2.py | 2 +- src/python_testing/TC_EEVSE_2_3.py | 2 +- src/python_testing/TC_EEVSE_2_4.py | 2 +- src/python_testing/TC_EEVSE_2_5.py | 2 +- src/python_testing/TC_EEVSE_2_6.py | 4 +- src/python_testing/TC_EPM_2_1.py | 2 +- src/python_testing/TC_EPM_2_2.py | 2 +- src/python_testing/TC_EWATERHTR_2_1.py | 2 +- src/python_testing/TC_EWATERHTR_2_2.py | 2 +- src/python_testing/TC_EWATERHTR_2_3.py | 2 +- src/python_testing/TC_FAN_3_1.py | 2 +- src/python_testing/TC_FAN_3_2.py | 2 +- src/python_testing/TC_FAN_3_3.py | 2 +- src/python_testing/TC_FAN_3_4.py | 2 +- src/python_testing/TC_FAN_3_5.py | 2 +- src/python_testing/TC_ICDM_2_1.py | 2 +- src/python_testing/TC_ICDM_3_1.py | 2 +- src/python_testing/TC_ICDM_3_2.py | 2 +- src/python_testing/TC_ICDM_3_3.py | 2 +- src/python_testing/TC_ICDM_3_4.py | 4 +- src/python_testing/TC_ICDM_5_1.py | 2 +- src/python_testing/TC_ICDManagementCluster.py | 2 +- src/python_testing/TC_IDM_1_2.py | 2 +- src/python_testing/TC_IDM_1_4.py | 2 +- src/python_testing/TC_IDM_4_2.py | 2 +- src/python_testing/TC_LVL_2_3.py | 4 +- src/python_testing/TC_MCORE_FS_1_1.py | 2 +- src/python_testing/TC_MCORE_FS_1_2.py | 2 +- src/python_testing/TC_MCORE_FS_1_3.py | 2 +- src/python_testing/TC_MCORE_FS_1_4.py | 2 +- src/python_testing/TC_MCORE_FS_1_5.py | 2 +- src/python_testing/TC_MWOCTRL_2_1.py | 2 +- src/python_testing/TC_MWOCTRL_2_2.py | 2 +- src/python_testing/TC_MWOCTRL_2_4.py | 2 +- src/python_testing/TC_MWOM_1_2.py | 2 +- src/python_testing/TC_OCC_2_1.py | 2 +- src/python_testing/TC_OCC_2_2.py | 2 +- src/python_testing/TC_OCC_2_3.py | 2 +- src/python_testing/TC_OCC_3_1.py | 4 +- src/python_testing/TC_OCC_3_2.py | 4 +- src/python_testing/TC_OPCREDS_3_1.py | 2 +- src/python_testing/TC_OPCREDS_3_2.py | 2 +- src/python_testing/TC_OPSTATE_2_1.py | 2 +- src/python_testing/TC_OPSTATE_2_2.py | 2 +- src/python_testing/TC_OPSTATE_2_3.py | 2 +- src/python_testing/TC_OPSTATE_2_4.py | 2 +- src/python_testing/TC_OPSTATE_2_5.py | 2 +- src/python_testing/TC_OPSTATE_2_6.py | 2 +- src/python_testing/TC_OVENOPSTATE_2_1.py | 2 +- src/python_testing/TC_OVENOPSTATE_2_2.py | 2 +- src/python_testing/TC_OVENOPSTATE_2_3.py | 2 +- src/python_testing/TC_OVENOPSTATE_2_4.py | 2 +- src/python_testing/TC_OVENOPSTATE_2_5.py | 2 +- src/python_testing/TC_OVENOPSTATE_2_6.py | 2 +- src/python_testing/TC_OpstateCommon.py | 2 +- src/python_testing/TC_PS_2_3.py | 4 +- src/python_testing/TC_PWRTL_2_1.py | 2 +- src/python_testing/TC_RR_1_1.py | 2 +- src/python_testing/TC_RVCCLEANM_1_2.py | 2 +- src/python_testing/TC_RVCCLEANM_2_1.py | 2 +- src/python_testing/TC_RVCCLEANM_2_2.py | 2 +- src/python_testing/TC_RVCOPSTATE_2_1.py | 2 +- src/python_testing/TC_RVCOPSTATE_2_3.py | 2 +- src/python_testing/TC_RVCOPSTATE_2_4.py | 2 +- src/python_testing/TC_RVCRUNM_1_2.py | 2 +- src/python_testing/TC_RVCRUNM_2_1.py | 2 +- src/python_testing/TC_RVCRUNM_2_2.py | 2 +- src/python_testing/TC_SC_3_6.py | 2 +- src/python_testing/TC_SC_7_1.py | 2 +- src/python_testing/TC_SEAR_1_2.py | 2 +- src/python_testing/TC_SEAR_1_3.py | 2 +- src/python_testing/TC_SEAR_1_4.py | 2 +- src/python_testing/TC_SEAR_1_5.py | 2 +- src/python_testing/TC_SEAR_1_6.py | 2 +- src/python_testing/TC_SWTCH.py | 6 +- src/python_testing/TC_TIMESYNC_2_1.py | 4 +- src/python_testing/TC_TIMESYNC_2_10.py | 4 +- src/python_testing/TC_TIMESYNC_2_11.py | 4 +- src/python_testing/TC_TIMESYNC_2_12.py | 4 +- src/python_testing/TC_TIMESYNC_2_13.py | 2 +- src/python_testing/TC_TIMESYNC_2_2.py | 3 +- src/python_testing/TC_TIMESYNC_2_4.py | 3 +- src/python_testing/TC_TIMESYNC_2_5.py | 2 +- src/python_testing/TC_TIMESYNC_2_6.py | 2 +- src/python_testing/TC_TIMESYNC_2_7.py | 4 +- src/python_testing/TC_TIMESYNC_2_8.py | 4 +- src/python_testing/TC_TIMESYNC_2_9.py | 4 +- src/python_testing/TC_TIMESYNC_3_1.py | 2 +- src/python_testing/TC_TMP_2_1.py | 2 +- src/python_testing/TC_TSTAT_4_2.py | 2 +- src/python_testing/TC_TestEventTrigger.py | 2 +- src/python_testing/TC_VALCC_2_1.py | 2 +- src/python_testing/TC_VALCC_3_1.py | 2 +- src/python_testing/TC_VALCC_3_2.py | 2 +- src/python_testing/TC_VALCC_3_3.py | 2 +- src/python_testing/TC_VALCC_3_4.py | 2 +- src/python_testing/TC_VALCC_4_1.py | 2 +- src/python_testing/TC_VALCC_4_2.py | 2 +- src/python_testing/TC_VALCC_4_3.py | 2 +- src/python_testing/TC_VALCC_4_4.py | 3 +- src/python_testing/TC_VALCC_4_5.py | 2 +- src/python_testing/TC_WHM_1_2.py | 2 +- src/python_testing/TC_WHM_2_1.py | 2 +- src/python_testing/TC_pics_checker.py | 12 +- src/python_testing/TestBatchInvoke.py | 2 +- .../TestChoiceConformanceSupport.py | 8 +- .../TestCommissioningTimeSync.py | 2 +- src/python_testing/TestConformanceSupport.py | 8 +- src/python_testing/TestConformanceTest.py | 10 +- src/python_testing/TestGroupTableReports.py | 2 +- src/python_testing/TestIdChecks.py | 7 +- .../TestMatterTestingSupport.py | 13 ++- .../TestSpecParsingDeviceType.py | 6 +- src/python_testing/TestSpecParsingSupport.py | 17 ++- .../TestTimeSyncTrustedTimeSource.py | 2 +- .../TestUnitTestingErrorPath.py | 2 +- src/python_testing/drlk_2_x_common.py | 2 +- src/python_testing/execute_python_tests.py | 10 +- src/python_testing/hello_external_runner.py | 2 +- src/python_testing/hello_test.py | 2 +- .../matter_testing_infrastructure/BUILD.gn | 9 +- .../chip/testing/apps.py | 2 +- .../chip/testing/basic_composition.py} | 0 .../chip/testing/choice_conformance.py} | 8 +- .../chip/testing/conformance.py} | 0 .../chip/testing}/global_attribute_ids.py | 0 .../chip/testing/matter_testing.py} | 6 +- .../chip/testing/pics.py} | 0 .../chip/testing/spec_parsing.py} | 43 ++++--- .../testing/taglist_and_topology_test.py} | 0 .../production_device_checks.py | 12 +- .../test_plan_table_generator.py | 2 +- .../test_testing/MockTestRunner.py | 18 +-- .../test_testing/TestDecorators.py | 16 +-- .../test_testing/test_IDM_10_4.py | 8 +- .../test_testing/test_TC_CCNTL_2_2.py | 4 +- .../test_testing/test_TC_MCORE_FS_1_1.py | 4 +- .../test_testing/test_TC_SC_7_1.py | 9 +- src/tools/PICS-generator/PICSGenerator.py | 6 +- src/tools/PICS-generator/XMLPICSValidator.py | 2 +- src/tools/device-graph/matter-device-graph.py | 4 +- 203 files changed, 474 insertions(+), 380 deletions(-) create mode 100644 scripts/spec_xml/paths.py rename src/python_testing/{basic_composition_support.py => matter_testing_infrastructure/chip/testing/basic_composition.py} (100%) rename src/python_testing/{choice_conformance_support.py => matter_testing_infrastructure/chip/testing/choice_conformance.py} (93%) rename src/python_testing/{conformance_support.py => matter_testing_infrastructure/chip/testing/conformance.py} (100%) rename src/python_testing/{ => matter_testing_infrastructure/chip/testing}/global_attribute_ids.py (100%) rename src/python_testing/{matter_testing_support.py => matter_testing_infrastructure/chip/testing/matter_testing.py} (99%) rename src/python_testing/{pics_support.py => matter_testing_infrastructure/chip/testing/pics.py} (100%) rename src/python_testing/{spec_parsing_support.py => matter_testing_infrastructure/chip/testing/spec_parsing.py} (95%) rename src/python_testing/{taglist_and_topology_test_support.py => matter_testing_infrastructure/chip/testing/taglist_and_topology_test.py} (100%) diff --git a/docs/testing/python.md b/docs/testing/python.md index a957074e3c..4541871dcb 100644 --- a/docs/testing/python.md +++ b/docs/testing/python.md @@ -25,7 +25,7 @@ Python tests located in src/python_testing section should include various parameters and their respective values, which will guide the test runner on how to execute the tests. - All test classes inherit from `MatterBaseTest` in - [matter_testing_support.py](https://github.com/project-chip/connectedhomeip/blob/master/src/python_testing/matter_testing_support.py) + [matter_testing.py](https://github.com/project-chip/connectedhomeip/blob/master/src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py) - Support for commissioning using the python controller - Default controller (`self.default_controller`) of type `ChipDeviceCtrl` - `MatterBaseTest` inherits from the Mobly BaseTestClass @@ -38,7 +38,7 @@ Python tests located in src/python_testing decorated with the @async_test_body decorator - Use `ChipDeviceCtrl` to interact with the DUT - Controller API is in `ChipDeviceCtrl.py` (see API doc in file) - - Some support methods in `matter_testing_support.py` + - Some support methods in `matter_testing.py` - Use Mobly assertions for failing tests - `self.step()` along with a `steps_*` method to mark test plan steps for cert tests @@ -379,7 +379,7 @@ pai = await dev_ctrl.SendCommand(nodeid, 0, Clusters.OperationalCredentials.Comm ## Mobly helpers The test system is based on Mobly, and the -[matter_testing_support.py](https://github.com/project-chip/connectedhomeip/blob/master/src/python_testing/matter_testing_support.py) +[matter_testing.py](https://github.com/project-chip/connectedhomeip/blob/master/src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py) class provides some helpers for Mobly integration. - `default_matter_test_main` @@ -561,11 +561,11 @@ these steps to set this up: ## Other support utilities -- `basic_composition_support` +- `basic_composition` - wildcard read, whole device analysis - `CommissioningFlowBlocks` - various commissioning support for core tests -- `spec_parsing_support` +- `spec_parsing` - parsing data model XML into python readable format # Running tests locally diff --git a/scripts/spec_xml/generate_spec_xml.py b/scripts/spec_xml/generate_spec_xml.py index 0d41b3f519..43582fdb36 100755 --- a/scripts/spec_xml/generate_spec_xml.py +++ b/scripts/spec_xml/generate_spec_xml.py @@ -24,26 +24,17 @@ from pathlib import Path import click +from paths import Branch, get_chip_root, get_data_model_path, get_documentation_file_path, get_in_progress_defines -DEFAULT_CHIP_ROOT = os.path.abspath( - os.path.join(os.path.dirname(__file__), '..', '..')) -DEFAULT_OUTPUT_DIR_1_3 = os.path.abspath( - os.path.join(DEFAULT_CHIP_ROOT, 'data_model', '1.3')) -DEFAULT_OUTPUT_DIR_IN_PROGRESS = os.path.abspath( - os.path.join(DEFAULT_CHIP_ROOT, 'data_model', 'in_progress')) -DEFAULT_OUTPUT_DIR_TOT = os.path.abspath( - os.path.join(DEFAULT_CHIP_ROOT, 'data_model', 'master')) -DEFAULT_DOCUMENTATION_FILE = os.path.abspath( - os.path.join(DEFAULT_CHIP_ROOT, 'docs', 'spec_clusters.md')) - -# questions -# is energy-calendar still in? -# is heat-pump out? wasn't in 0.7 -# location-cluster - is this define gone now? -# queuedpreset - is this define gone now? -CURRENT_IN_PROGRESS_DEFINES = ['aliro', 'atomicwrites', 'battery-storage', 'device-location', 'e2e-jf', 'energy-calendar', 'energy-drlc', - 'energy-management', 'heat-pump', 'hrap-1', 'hvac', 'matter-fabric-synchronization', 'metering', 'secondary-net', - 'service-area-cluster', 'solar-power', 'tcp', 'water-heater', 'wifiSetup'] +# Use the get_in_progress_defines() function to fetch the in-progress defines +CURRENT_IN_PROGRESS_DEFINES = get_in_progress_defines() + +# Replace hardcoded paths with dynamic paths using paths.py functions +DEFAULT_CHIP_ROOT = get_chip_root() +DEFAULT_OUTPUT_DIR_1_3 = get_data_model_path(Branch.V1_3) +DEFAULT_OUTPUT_DIR_IN_PROGRESS = get_data_model_path(Branch.IN_PROGRESS) +DEFAULT_OUTPUT_DIR_TOT = get_data_model_path(Branch.MASTER) +DEFAULT_DOCUMENTATION_FILE = get_documentation_file_path() def get_xml_path(filename, output_dir): @@ -90,7 +81,6 @@ def make_asciidoc(target: str, include_in_progress: str, spec_dir: str, dry_run: '--include-in-progress', type=click.Choice(['All', 'None', 'Current']), default='All') def main(scraper, spec_root, output_dir, dry_run, include_in_progress): - # Clusters need to be scraped first because the cluster directory is passed to the device type directory if not output_dir: output_dir_map = {'All': DEFAULT_OUTPUT_DIR_TOT, 'None': DEFAULT_OUTPUT_DIR_1_3, 'Current': DEFAULT_OUTPUT_DIR_IN_PROGRESS} output_dir = output_dir_map[include_in_progress] @@ -103,30 +93,28 @@ def main(scraper, spec_root, output_dir, dry_run, include_in_progress): def scrape_clusters(scraper, spec_root, output_dir, dry_run, include_in_progress): src_dir = os.path.abspath(os.path.join(spec_root, 'src')) - sdm_clusters_dir = os.path.abspath( - os.path.join(src_dir, 'service_device_management')) + sdm_clusters_dir = os.path.abspath(os.path.join(src_dir, 'service_device_management')) app_clusters_dir = os.path.abspath(os.path.join(src_dir, 'app_clusters')) dm_clusters_dir = os.path.abspath(os.path.join(src_dir, 'data_model')) - media_clusters_dir = os.path.abspath( - os.path.join(app_clusters_dir, 'media')) - clusters_output_dir = os.path.abspath(os.path.join(output_dir, 'clusters')) + media_clusters_dir = os.path.abspath(os.path.join(app_clusters_dir, 'media')) + + clusters_output_dir = os.path.join(output_dir, 'clusters') if not os.path.exists(clusters_output_dir): os.makedirs(clusters_output_dir) - print('Generating main spec to get file include list - this make take a few minutes') + print('Generating main spec to get file include list - this may take a few minutes') main_out = make_asciidoc('pdf', include_in_progress, spec_root, dry_run) - print('Generating cluster spec to get file include list - this make take a few minutes') + print('Generating cluster spec to get file include list - this may take a few minutes') cluster_out = make_asciidoc('pdf-appclusters-book', include_in_progress, spec_root, dry_run) def scrape_cluster(filename: str) -> None: base = Path(filename).stem if base not in main_out and base not in cluster_out: - print(f'skipping file: {base} as it is not compiled into the asciidoc') + print(f'Skipping file: {base} as it is not compiled into the asciidoc') return xml_path = get_xml_path(filename, clusters_output_dir) - cmd = [scraper, 'cluster', '-i', filename, '-o', - xml_path, '-nd'] + cmd = [scraper, 'cluster', '-i', filename, '-o', xml_path, '-nd'] if include_in_progress == 'All': cmd.extend(['--define', 'in-progress']) elif include_in_progress == 'Current': @@ -150,33 +138,29 @@ def scrape_all_clusters(dir: str, exclude_list: list[str] = []) -> None: tree = ElementTree.parse(f'{xml_path}') root = tree.getroot() cluster = next(root.iter('cluster')) - # If there's no cluster ID table, this isn't a cluster try: next(cluster.iter('clusterIds')) except StopIteration: - # If there's no cluster ID table, this isn't a cluster just some kind of intro adoc print(f'Removing file {xml_path} as it does not include any cluster definitions') os.remove(xml_path) continue def scrape_device_types(scraper, spec_root, output_dir, dry_run, include_in_progress): - device_type_dir = os.path.abspath( - os.path.join(spec_root, 'src', 'device_types')) - device_types_output_dir = os.path.abspath( - os.path.join(output_dir, 'device_types')) + device_type_dir = os.path.abspath(os.path.join(spec_root, 'src', 'device_types')) + device_types_output_dir = os.path.abspath(os.path.join(output_dir, 'device_types')) clusters_output_dir = os.path.abspath(os.path.join(output_dir, 'clusters')) if not os.path.exists(device_types_output_dir): os.makedirs(device_types_output_dir) - print('Generating device type library to get file include list - this make take a few minutes') + print('Generating device type library to get file include list - this may take a few minutes') device_type_output = make_asciidoc('pdf-devicelibrary-book', include_in_progress, spec_root, dry_run) def scrape_device_type(filename: str) -> None: base = Path(filename).stem if base not in device_type_output: - print(f'skipping file: {filename} as it is not compiled into the asciidoc') + print(f'Skipping file: {filename} as it is not compiled into the asciidoc') return xml_path = get_xml_path(filename, device_types_output_dir) cmd = [scraper, 'devicetype', '-c', '-cls', clusters_output_dir, diff --git a/scripts/spec_xml/paths.py b/scripts/spec_xml/paths.py new file mode 100644 index 0000000000..3a5159cc51 --- /dev/null +++ b/scripts/spec_xml/paths.py @@ -0,0 +1,109 @@ +#!/usr/bin/env python3 + +# Copyright (c) 2024 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os +from enum import Enum + +# Define a branch enum for different versions or branches + + +class Branch(Enum): + MASTER = "master" + V1_3 = "v1_3" + V1_4 = "v1_4" + IN_PROGRESS = "in_progress" + + +def get_chip_root(): + """ + Returns the CHIP root directory, trying the environment variable first + and falling back if necessary. + """ + chip_root = os.getenv('PW_PROJECT_ROOT') + if chip_root: + return chip_root + else: + try: + return os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')) + except Exception as e: + raise EnvironmentError( + "Unable to determine CHIP root directory. Please ensure the environment is activated." + ) from e + + +def get_data_model_path(branch: Branch): + """ + Returns the path to the data model directory for a given branch. + """ + chip_root = get_chip_root() + data_model_path = os.path.join(chip_root, 'data_model', branch.value) + if not os.path.exists(data_model_path): + raise FileNotFoundError(f"Data model path for branch {branch} does not exist: {data_model_path}") + return data_model_path + + +def get_spec_xml_output_path(): + """ + Returns the path to the output directory for generated XML files. + """ + chip_root = get_chip_root() + output_dir = os.path.join(chip_root, 'out', 'spec_xml') + if not os.path.exists(output_dir): + os.makedirs(output_dir) # Automatically create the directory if it doesn't exist + return output_dir + + +def get_documentation_file_path(): + """ + Returns the path to the documentation file. + """ + chip_root = get_chip_root() + documentation_file = os.path.join(chip_root, 'docs', 'spec_clusters.md') + if not os.path.exists(documentation_file): + raise FileNotFoundError(f"Documentation file does not exist: {documentation_file}") + return documentation_file + + +def get_python_testing_path(): + """ + Returns the path to the python_testing directory. + """ + chip_root = get_chip_root() + python_testing_path = os.path.join(chip_root, 'src', 'python_testing') + if not os.path.exists(python_testing_path): + raise FileNotFoundError(f"Python testing directory does not exist: {python_testing_path}") + return python_testing_path + + +def get_in_progress_defines(): + """ + Returns a list of defines that are currently in progress. + This can be updated dynamically as needed. + """ + return [ + 'aliro', 'atomicwrites', 'battery-storage', 'device-location', 'e2e-jf', + 'energy-calendar', 'energy-drlc', 'energy-management', 'heat-pump', 'hrap-1', + 'hvac', 'matter-fabric-synchronization', 'metering', 'secondary-net', + 'service-area-cluster', 'solar-power', 'tcp', 'water-heater', 'wifiSetup' + ] + + +def get_available_branches(): + """ + Return a list of available branches for the data model. + This can be expanded or dynamically fetched if necessary. + """ + return [Branch.MASTER, Branch.V1_3, Branch.V1_4] diff --git a/src/python_testing/MinimalRepresentation.py b/src/python_testing/MinimalRepresentation.py index c99919a908..93ce543e09 100644 --- a/src/python_testing/MinimalRepresentation.py +++ b/src/python_testing/MinimalRepresentation.py @@ -17,10 +17,10 @@ from dataclasses import dataclass, field +from chip.testing.conformance import ConformanceDecision +from chip.testing.global_attribute_ids import GlobalAttributeIds +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from chip.tlv import uint -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 TC_DeviceConformance import DeviceConformanceTests diff --git a/src/python_testing/TCP_Tests.py b/src/python_testing/TCP_Tests.py index 849b3a9c07..10209346a0 100644 --- a/src/python_testing/TCP_Tests.py +++ b/src/python_testing/TCP_Tests.py @@ -33,7 +33,7 @@ import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.interaction_model import InteractionModelError -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_ACE_1_2.py b/src/python_testing/TC_ACE_1_2.py index 4955cbd3ff..5a38120561 100644 --- a/src/python_testing/TC_ACE_1_2.py +++ b/src/python_testing/TC_ACE_1_2.py @@ -42,7 +42,7 @@ from chip.clusters.Attribute import EventReadResult, SubscriptionTransaction, TypedAttributePath from chip.exceptions import ChipStackError from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_ACE_1_3.py b/src/python_testing/TC_ACE_1_3.py index 9e2108896d..2868d9548f 100644 --- a/src/python_testing/TC_ACE_1_3.py +++ b/src/python_testing/TC_ACE_1_3.py @@ -38,7 +38,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_ACE_1_4.py b/src/python_testing/TC_ACE_1_4.py index 0afdf03ede..37577b6270 100644 --- a/src/python_testing/TC_ACE_1_4.py +++ b/src/python_testing/TC_ACE_1_4.py @@ -42,7 +42,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts # This test requires several additional command line arguments diff --git a/src/python_testing/TC_ACE_1_5.py b/src/python_testing/TC_ACE_1_5.py index 9766e9a0c6..15c7380d23 100644 --- a/src/python_testing/TC_ACE_1_5.py +++ b/src/python_testing/TC_ACE_1_5.py @@ -40,7 +40,7 @@ import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_ACL_2_11.py b/src/python_testing/TC_ACL_2_11.py index 9f4aea3218..e8aa253ae7 100644 --- a/src/python_testing/TC_ACL_2_11.py +++ b/src/python_testing/TC_ACL_2_11.py @@ -42,13 +42,13 @@ import queue import chip.clusters as Clusters -from basic_composition_support import arls_populated from chip.clusters.Attribute import EventReadResult, SubscriptionTransaction, ValueDecodeFailure from chip.clusters.ClusterObjects import ALL_ACCEPTED_COMMANDS, ALL_ATTRIBUTES, ALL_CLUSTERS, ClusterEvent from chip.clusters.Objects import AccessControl from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.basic_composition import arls_populated +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_ACL_2_2.py b/src/python_testing/TC_ACL_2_2.py index 219be92b35..6f5ed4760c 100644 --- a/src/python_testing/TC_ACL_2_2.py +++ b/src/python_testing/TC_ACL_2_2.py @@ -32,7 +32,7 @@ # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_AccessChecker.py b/src/python_testing/TC_AccessChecker.py index 23e8535f51..5f3b3d69ec 100644 --- a/src/python_testing/TC_AccessChecker.py +++ b/src/python_testing/TC_AccessChecker.py @@ -23,13 +23,13 @@ from typing import Optional import chip.clusters as Clusters -from basic_composition_support import BasicCompositionTests from chip.interaction_model import Status +from chip.testing.basic_composition import BasicCompositionTests +from chip.testing.global_attribute_ids import GlobalAttributeIds +from chip.testing.matter_testing import (AttributePathLocation, ClusterPathLocation, MatterBaseTest, TestStep, async_test_body, + default_matter_test_main) +from chip.testing.spec_parsing import XmlCluster, build_xml_clusters from chip.tlv import uint -from global_attribute_ids import GlobalAttributeIds -from matter_testing_support import (AttributePathLocation, ClusterPathLocation, MatterBaseTest, TestStep, async_test_body, - default_matter_test_main) -from spec_parsing_support import XmlCluster, build_xml_clusters class AccessTestType(Enum): diff --git a/src/python_testing/TC_BOOLCFG_2_1.py b/src/python_testing/TC_BOOLCFG_2_1.py index 27e016da52..2e90245f47 100644 --- a/src/python_testing/TC_BOOLCFG_2_1.py +++ b/src/python_testing/TC_BOOLCFG_2_1.py @@ -36,7 +36,7 @@ from operator import ior import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_BOOLCFG_3_1.py b/src/python_testing/TC_BOOLCFG_3_1.py index 4b3156bbe9..8ed77f6ba8 100644 --- a/src/python_testing/TC_BOOLCFG_3_1.py +++ b/src/python_testing/TC_BOOLCFG_3_1.py @@ -36,7 +36,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_BOOLCFG_4_1.py b/src/python_testing/TC_BOOLCFG_4_1.py index 3cd7f3a9b2..dfe6aac340 100644 --- a/src/python_testing/TC_BOOLCFG_4_1.py +++ b/src/python_testing/TC_BOOLCFG_4_1.py @@ -34,7 +34,7 @@ import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_BOOLCFG_4_2.py b/src/python_testing/TC_BOOLCFG_4_2.py index 7897847acc..093e389dcf 100644 --- a/src/python_testing/TC_BOOLCFG_4_2.py +++ b/src/python_testing/TC_BOOLCFG_4_2.py @@ -40,7 +40,7 @@ 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 chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts sensorTrigger = 0x0080_0000_0000_0000 diff --git a/src/python_testing/TC_BOOLCFG_4_3.py b/src/python_testing/TC_BOOLCFG_4_3.py index aeb245a9be..845d8e9d4a 100644 --- a/src/python_testing/TC_BOOLCFG_4_3.py +++ b/src/python_testing/TC_BOOLCFG_4_3.py @@ -40,7 +40,7 @@ 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 chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts sensorTrigger = 0x0080_0000_0000_0000 diff --git a/src/python_testing/TC_BOOLCFG_4_4.py b/src/python_testing/TC_BOOLCFG_4_4.py index 66a1d06c05..c585b14a84 100644 --- a/src/python_testing/TC_BOOLCFG_4_4.py +++ b/src/python_testing/TC_BOOLCFG_4_4.py @@ -40,7 +40,7 @@ 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 chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts sensorTrigger = 0x0080_0000_0000_0000 diff --git a/src/python_testing/TC_BOOLCFG_5_1.py b/src/python_testing/TC_BOOLCFG_5_1.py index cef0eae01b..ec31d8341b 100644 --- a/src/python_testing/TC_BOOLCFG_5_1.py +++ b/src/python_testing/TC_BOOLCFG_5_1.py @@ -40,7 +40,7 @@ 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 chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts sensorTrigger = 0x0080_0000_0000_0000 diff --git a/src/python_testing/TC_BOOLCFG_5_2.py b/src/python_testing/TC_BOOLCFG_5_2.py index 6ab8c82be6..fd6b88370d 100644 --- a/src/python_testing/TC_BOOLCFG_5_2.py +++ b/src/python_testing/TC_BOOLCFG_5_2.py @@ -40,7 +40,7 @@ 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 chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts sensorTrigger = 0x0080_0000_0000_0000 diff --git a/src/python_testing/TC_BRBINFO_4_1.py b/src/python_testing/TC_BRBINFO_4_1.py index 07b6fc2745..f5eeec3344 100644 --- a/src/python_testing/TC_BRBINFO_4_1.py +++ b/src/python_testing/TC_BRBINFO_4_1.py @@ -53,7 +53,7 @@ from chip import ChipDeviceCtrl from chip.interaction_model import InteractionModelError, Status from chip.testing.apps import IcdAppServerSubprocess -from matter_testing_support import MatterBaseTest, SimpleEventCallback, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, SimpleEventCallback, TestStep, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_CADMIN_1_9.py b/src/python_testing/TC_CADMIN_1_9.py index 060a540017..b3b09afad3 100644 --- a/src/python_testing/TC_CADMIN_1_9.py +++ b/src/python_testing/TC_CADMIN_1_9.py @@ -40,7 +40,7 @@ from chip.ChipDeviceCtrl import CommissioningParameters from chip.exceptions import ChipStackError from chip.native import PyChipError -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_CCTRL_2_1.py b/src/python_testing/TC_CCTRL_2_1.py index c689dd649b..b656973f6a 100644 --- a/src/python_testing/TC_CCTRL_2_1.py +++ b/src/python_testing/TC_CCTRL_2_1.py @@ -38,7 +38,7 @@ # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, default_matter_test_main, has_cluster, run_if_endpoint_matches +from chip.testing.matter_testing import MatterBaseTest, TestStep, default_matter_test_main, has_cluster, run_if_endpoint_matches from mobly import asserts diff --git a/src/python_testing/TC_CCTRL_2_2.py b/src/python_testing/TC_CCTRL_2_2.py index 76e8e83c92..a2e7b15dc2 100644 --- a/src/python_testing/TC_CCTRL_2_2.py +++ b/src/python_testing/TC_CCTRL_2_2.py @@ -50,8 +50,8 @@ from chip import ChipDeviceCtrl from chip.interaction_model import InteractionModelError, Status from chip.testing.apps import AppServerSubprocess -from matter_testing_support import (MatterBaseTest, TestStep, async_test_body, default_matter_test_main, has_cluster, - run_if_endpoint_matches) +from chip.testing.matter_testing import (MatterBaseTest, TestStep, async_test_body, default_matter_test_main, has_cluster, + run_if_endpoint_matches) from mobly import asserts diff --git a/src/python_testing/TC_CCTRL_2_3.py b/src/python_testing/TC_CCTRL_2_3.py index 07d5706a22..fe7ed3de40 100644 --- a/src/python_testing/TC_CCTRL_2_3.py +++ b/src/python_testing/TC_CCTRL_2_3.py @@ -50,8 +50,8 @@ from chip import ChipDeviceCtrl from chip.interaction_model import InteractionModelError, Status from chip.testing.apps import AppServerSubprocess -from matter_testing_support import (MatterBaseTest, TestStep, async_test_body, default_matter_test_main, has_cluster, - run_if_endpoint_matches) +from chip.testing.matter_testing import (MatterBaseTest, TestStep, async_test_body, default_matter_test_main, has_cluster, + run_if_endpoint_matches) from mobly import asserts diff --git a/src/python_testing/TC_CC_10_1.py b/src/python_testing/TC_CC_10_1.py index 2cbbf0fe9a..c2c76ecde0 100644 --- a/src/python_testing/TC_CC_10_1.py +++ b/src/python_testing/TC_CC_10_1.py @@ -41,7 +41,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts kCCAttributeValueIDs = [0x0001, 0x0003, 0x0004, 0x0007, 0x4000, 0x4001, 0x4002, 0x4003, 0x4004] diff --git a/src/python_testing/TC_CC_2_2.py b/src/python_testing/TC_CC_2_2.py index 647bee1528..09d9af23e8 100644 --- a/src/python_testing/TC_CC_2_2.py +++ b/src/python_testing/TC_CC_2_2.py @@ -41,8 +41,8 @@ import chip.clusters as Clusters from chip.clusters import ClusterObjects as ClusterObjects -from matter_testing_support import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, default_matter_test_main, - has_cluster, run_if_endpoint_matches) +from chip.testing.matter_testing import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, default_matter_test_main, + has_cluster, run_if_endpoint_matches) from mobly import asserts from test_plan_support import commission_if_required, read_attribute, verify_success diff --git a/src/python_testing/TC_CGEN_2_4.py b/src/python_testing/TC_CGEN_2_4.py index 1cf2f7e8a0..7db0ddca28 100644 --- a/src/python_testing/TC_CGEN_2_4.py +++ b/src/python_testing/TC_CGEN_2_4.py @@ -46,7 +46,7 @@ from chip.ChipDeviceCtrl import CommissioningParameters from chip.exceptions import ChipStackError from chip.native import PyChipError -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts # Commissioning stage numbers - we should find a better way to match these to the C++ code diff --git a/src/python_testing/TC_CNET_1_4.py b/src/python_testing/TC_CNET_1_4.py index 7e19f8dee9..2c69456e86 100644 --- a/src/python_testing/TC_CNET_1_4.py +++ b/src/python_testing/TC_CNET_1_4.py @@ -38,7 +38,7 @@ import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts kRootEndpointId = 0 diff --git a/src/python_testing/TC_CNET_4_4.py b/src/python_testing/TC_CNET_4_4.py index 12407e6c5f..223cfdf588 100644 --- a/src/python_testing/TC_CNET_4_4.py +++ b/src/python_testing/TC_CNET_4_4.py @@ -22,7 +22,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts diff --git a/src/python_testing/TC_DA_1_2.py b/src/python_testing/TC_DA_1_2.py index 9fa60cd8bf..9bf08fe72a 100644 --- a/src/python_testing/TC_DA_1_2.py +++ b/src/python_testing/TC_DA_1_2.py @@ -40,8 +40,10 @@ import re import chip.clusters as Clusters -from basic_composition_support import BasicCompositionTests from chip.interaction_model import InteractionModelError, Status +from chip.testing.basic_composition import BasicCompositionTests +from chip.testing.matter_testing import (MatterBaseTest, TestStep, async_test_body, default_matter_test_main, hex_from_bytes, + type_matches) from chip.tlv import TLVReader from cryptography import x509 from cryptography.exceptions import InvalidSignature @@ -49,7 +51,6 @@ from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.asymmetric import ec, utils from ecdsa.curves import curve_by_name -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, hex_from_bytes, type_matches from mobly import asserts from pyasn1.codec.der.decoder import decode as der_decoder from pyasn1.error import PyAsn1Error diff --git a/src/python_testing/TC_DA_1_5.py b/src/python_testing/TC_DA_1_5.py index c08f4eb4ef..e8e6ce773c 100644 --- a/src/python_testing/TC_DA_1_5.py +++ b/src/python_testing/TC_DA_1_5.py @@ -40,12 +40,12 @@ import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.interaction_model import InteractionModelError, Status +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, hex_from_bytes, type_matches from chip.tlv import TLVReader from cryptography import x509 from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.asymmetric import ec, utils from ecdsa.curves import curve_by_name -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, hex_from_bytes, type_matches from mobly import asserts from pyasn1.codec.der.decoder import decode as der_decoder from pyasn1.error import PyAsn1Error diff --git a/src/python_testing/TC_DA_1_7.py b/src/python_testing/TC_DA_1_7.py index 1130a7b423..6678080a60 100644 --- a/src/python_testing/TC_DA_1_7.py +++ b/src/python_testing/TC_DA_1_7.py @@ -41,13 +41,13 @@ from typing import List, Optional import chip.clusters as Clusters +from chip.testing.matter_testing import (MatterBaseTest, TestStep, async_test_body, bytes_from_hex, default_matter_test_main, + hex_from_bytes) from cryptography.exceptions import InvalidSignature from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.asymmetric import ec from cryptography.hazmat.primitives.serialization import Encoding, PublicFormat from cryptography.x509 import AuthorityKeyIdentifier, Certificate, SubjectKeyIdentifier, load_der_x509_certificate -from matter_testing_support import (MatterBaseTest, TestStep, async_test_body, bytes_from_hex, default_matter_test_main, - hex_from_bytes) from mobly import asserts # Those are SDK samples that are known to be non-production. diff --git a/src/python_testing/TC_DEMTestBase.py b/src/python_testing/TC_DEMTestBase.py index da51ba2528..49c8c6a637 100644 --- a/src/python_testing/TC_DEMTestBase.py +++ b/src/python_testing/TC_DEMTestBase.py @@ -19,7 +19,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import utc_time_in_matter_epoch +from chip.testing.matter_testing import utc_time_in_matter_epoch from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_DEM_2_1.py b/src/python_testing/TC_DEM_2_1.py index 4975d3ae29..851099cb8e 100644 --- a/src/python_testing/TC_DEM_2_1.py +++ b/src/python_testing/TC_DEM_2_1.py @@ -49,7 +49,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_10.py b/src/python_testing/TC_DEM_2_10.py index 8f2e0baf35..810efdbfa2 100644 --- a/src/python_testing/TC_DEM_2_10.py +++ b/src/python_testing/TC_DEM_2_10.py @@ -50,8 +50,8 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, async_test_body, - default_matter_test_main) +from chip.testing.matter_testing import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, async_test_body, + default_matter_test_main) from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_2.py b/src/python_testing/TC_DEM_2_2.py index b5e26e4336..168417dd98 100644 --- a/src/python_testing/TC_DEM_2_2.py +++ b/src/python_testing/TC_DEM_2_2.py @@ -52,7 +52,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_3.py b/src/python_testing/TC_DEM_2_3.py index 25398b41ea..c5699c0318 100644 --- a/src/python_testing/TC_DEM_2_3.py +++ b/src/python_testing/TC_DEM_2_3.py @@ -46,7 +46,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_4.py b/src/python_testing/TC_DEM_2_4.py index 6a396fc3a3..1b591cd438 100644 --- a/src/python_testing/TC_DEM_2_4.py +++ b/src/python_testing/TC_DEM_2_4.py @@ -47,7 +47,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import Status -from matter_testing_support import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_5.py b/src/python_testing/TC_DEM_2_5.py index f7f7d75d53..c845ec1997 100644 --- a/src/python_testing/TC_DEM_2_5.py +++ b/src/python_testing/TC_DEM_2_5.py @@ -49,7 +49,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_6.py b/src/python_testing/TC_DEM_2_6.py index 2e2a96f92b..32dea4af4f 100644 --- a/src/python_testing/TC_DEM_2_6.py +++ b/src/python_testing/TC_DEM_2_6.py @@ -49,7 +49,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_7.py b/src/python_testing/TC_DEM_2_7.py index 36e7ab984a..44c65fbc58 100644 --- a/src/python_testing/TC_DEM_2_7.py +++ b/src/python_testing/TC_DEM_2_7.py @@ -49,7 +49,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_8.py b/src/python_testing/TC_DEM_2_8.py index 1f3d240b22..016778fdf1 100644 --- a/src/python_testing/TC_DEM_2_8.py +++ b/src/python_testing/TC_DEM_2_8.py @@ -49,7 +49,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_9.py b/src/python_testing/TC_DEM_2_9.py index 4541b9cc6e..05111e3b8f 100644 --- a/src/python_testing/TC_DEM_2_9.py +++ b/src/python_testing/TC_DEM_2_9.py @@ -48,7 +48,7 @@ import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DGGEN_2_4.py b/src/python_testing/TC_DGGEN_2_4.py index 27542e651d..17b068452c 100644 --- a/src/python_testing/TC_DGGEN_2_4.py +++ b/src/python_testing/TC_DGGEN_2_4.py @@ -40,8 +40,9 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError -from matter_testing_support import (MatterBaseTest, async_test_body, default_matter_test_main, matter_epoch_us_from_utc_datetime, - utc_datetime_from_matter_epoch_us, utc_datetime_from_posix_time_ms) +from chip.testing.matter_testing import (MatterBaseTest, async_test_body, default_matter_test_main, + matter_epoch_us_from_utc_datetime, utc_datetime_from_matter_epoch_us, + utc_datetime_from_posix_time_ms) from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_DGGEN_3_2.py b/src/python_testing/TC_DGGEN_3_2.py index 7e5af6c7a5..58c333e8b4 100644 --- a/src/python_testing/TC_DGGEN_3_2.py +++ b/src/python_testing/TC_DGGEN_3_2.py @@ -16,7 +16,7 @@ # import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_DGSW_2_1.py b/src/python_testing/TC_DGSW_2_1.py index 46ed696da9..6338932725 100644 --- a/src/python_testing/TC_DGSW_2_1.py +++ b/src/python_testing/TC_DGSW_2_1.py @@ -36,7 +36,7 @@ # import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_DRLK_2_12.py b/src/python_testing/TC_DRLK_2_12.py index cf63bd810a..342fbc64f6 100644 --- a/src/python_testing/TC_DRLK_2_12.py +++ b/src/python_testing/TC_DRLK_2_12.py @@ -35,8 +35,8 @@ # quiet: true # === END CI TEST ARGUMENTS === +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from drlk_2_x_common import DRLK_COMMON -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main # Configurable parameters: # - userIndex: userIndex to use when creating a user on the DUT for testing purposes diff --git a/src/python_testing/TC_DRLK_2_13.py b/src/python_testing/TC_DRLK_2_13.py index dc1b69da22..809e278517 100644 --- a/src/python_testing/TC_DRLK_2_13.py +++ b/src/python_testing/TC_DRLK_2_13.py @@ -43,7 +43,7 @@ from chip.clusters.Attribute import EventPriority from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_DRLK_2_2.py b/src/python_testing/TC_DRLK_2_2.py index 84a511b98d..f9f192f18e 100644 --- a/src/python_testing/TC_DRLK_2_2.py +++ b/src/python_testing/TC_DRLK_2_2.py @@ -35,8 +35,8 @@ # quiet: true # === END CI TEST ARGUMENTS === +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from drlk_2_x_common import DRLK_COMMON -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main # Configurable parameters: # - userIndex: userIndex to use when creating a user on the DUT for testing purposes diff --git a/src/python_testing/TC_DRLK_2_3.py b/src/python_testing/TC_DRLK_2_3.py index 75690865cf..114f41ab9c 100644 --- a/src/python_testing/TC_DRLK_2_3.py +++ b/src/python_testing/TC_DRLK_2_3.py @@ -35,8 +35,8 @@ # quiet: true # === END CI TEST ARGUMENTS === +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from drlk_2_x_common import DRLK_COMMON -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main # Configurable parameters: # - userIndex: userIndex to use when creating a user on the DUT for testing purposes diff --git a/src/python_testing/TC_DRLK_2_5.py b/src/python_testing/TC_DRLK_2_5.py index defe78eafd..84451d2600 100644 --- a/src/python_testing/TC_DRLK_2_5.py +++ b/src/python_testing/TC_DRLK_2_5.py @@ -38,7 +38,7 @@ 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, type_matches +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_DRLK_2_9.py b/src/python_testing/TC_DRLK_2_9.py index b92eaf42b5..fb294b724f 100644 --- a/src/python_testing/TC_DRLK_2_9.py +++ b/src/python_testing/TC_DRLK_2_9.py @@ -41,8 +41,8 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from drlk_2_x_common import DRLK_COMMON -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_DeviceBasicComposition.py b/src/python_testing/TC_DeviceBasicComposition.py index ba10ba9767..59182fa4e2 100644 --- a/src/python_testing/TC_DeviceBasicComposition.py +++ b/src/python_testing/TC_DeviceBasicComposition.py @@ -103,19 +103,19 @@ import chip.clusters as Clusters import chip.clusters.ClusterObjects import chip.tlv -from basic_composition_support import BasicCompositionTests from chip import ChipUtility from chip.clusters.Attribute import ValueDecodeFailure from chip.clusters.ClusterObjects import ClusterAttributeDescriptor, ClusterObjectFieldDescriptor from chip.interaction_model import InteractionModelError, Status +from chip.testing.basic_composition import BasicCompositionTests +from chip.testing.global_attribute_ids import AttributeIdType, ClusterIdType, GlobalAttributeIds, attribute_id_type, cluster_id_type +from chip.testing.matter_testing import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, MatterBaseTest, TestStep, + async_test_body, default_matter_test_main) +from chip.testing.taglist_and_topology_test import (create_device_type_list_for_root, create_device_type_lists, + find_tag_list_problems, find_tree_roots, flat_list_ok, + get_direct_children_of_root, parts_list_cycles, separate_endpoint_types) from chip.tlv import uint -from global_attribute_ids import AttributeIdType, ClusterIdType, GlobalAttributeIds, attribute_id_type, cluster_id_type -from matter_testing_support import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, MatterBaseTest, TestStep, - async_test_body, default_matter_test_main) from mobly import asserts -from taglist_and_topology_test_support import (create_device_type_list_for_root, create_device_type_lists, find_tag_list_problems, - find_tree_roots, flat_list_ok, get_direct_children_of_root, parts_list_cycles, - separate_endpoint_types) def get_vendor_id(mei: int) -> int: diff --git a/src/python_testing/TC_DeviceConformance.py b/src/python_testing/TC_DeviceConformance.py index 8e700b49ab..a3e350bdfb 100644 --- a/src/python_testing/TC_DeviceConformance.py +++ b/src/python_testing/TC_DeviceConformance.py @@ -39,16 +39,16 @@ from typing import Callable import chip.clusters as Clusters -from basic_composition_support import BasicCompositionTests +from chip.testing.basic_composition import BasicCompositionTests +from chip.testing.choice_conformance import (evaluate_attribute_choice_conformance, evaluate_command_choice_conformance, + evaluate_feature_choice_conformance) +from chip.testing.conformance import ConformanceDecision, conformance_allowed +from chip.testing.global_attribute_ids import (ClusterIdType, DeviceTypeIdType, GlobalAttributeIds, cluster_id_type, + device_type_id_type, is_valid_device_type_id) +from chip.testing.matter_testing import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, DeviceTypePathLocation, + MatterBaseTest, ProblemNotice, ProblemSeverity, async_test_body, default_matter_test_main) +from chip.testing.spec_parsing import CommandType, build_xml_clusters, build_xml_device_types from chip.tlv import uint -from choice_conformance_support import (evaluate_attribute_choice_conformance, evaluate_command_choice_conformance, - evaluate_feature_choice_conformance) -from conformance_support import ConformanceDecision, conformance_allowed -from global_attribute_ids import (ClusterIdType, DeviceTypeIdType, GlobalAttributeIds, cluster_id_type, device_type_id_type, - is_valid_device_type_id) -from matter_testing_support import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, DeviceTypePathLocation, - MatterBaseTest, ProblemNotice, ProblemSeverity, async_test_body, default_matter_test_main) -from spec_parsing_support import CommandType, build_xml_clusters, build_xml_device_types class DeviceConformanceTests(BasicCompositionTests): diff --git a/src/python_testing/TC_ECOINFO_2_1.py b/src/python_testing/TC_ECOINFO_2_1.py index 1cb6ec203a..a0adf75ac4 100644 --- a/src/python_testing/TC_ECOINFO_2_1.py +++ b/src/python_testing/TC_ECOINFO_2_1.py @@ -47,8 +47,8 @@ from chip.clusters.Types import NullValue from chip.interaction_model import Status from chip.testing.apps import AppServerSubprocess +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from chip.tlv import uint -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts diff --git a/src/python_testing/TC_ECOINFO_2_2.py b/src/python_testing/TC_ECOINFO_2_2.py index 6e0e588d2f..6ce1e490d5 100644 --- a/src/python_testing/TC_ECOINFO_2_2.py +++ b/src/python_testing/TC_ECOINFO_2_2.py @@ -46,7 +46,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status from chip.testing.apps import AppServerSubprocess -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts _DEVICE_TYPE_AGGREGATOR = 0x000E diff --git a/src/python_testing/TC_EEM_2_1.py b/src/python_testing/TC_EEM_2_1.py index 0b6b4809a4..653bd942a9 100644 --- a/src/python_testing/TC_EEM_2_1.py +++ b/src/python_testing/TC_EEM_2_1.py @@ -43,7 +43,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EnergyReporting_Utils import EnergyReportingBaseTestHelper diff --git a/src/python_testing/TC_EEM_2_2.py b/src/python_testing/TC_EEM_2_2.py index 6058aa34c5..408cd85adb 100644 --- a/src/python_testing/TC_EEM_2_2.py +++ b/src/python_testing/TC_EEM_2_2.py @@ -41,7 +41,7 @@ import time -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EnergyReporting_Utils import EnergyReportingBaseTestHelper diff --git a/src/python_testing/TC_EEM_2_3.py b/src/python_testing/TC_EEM_2_3.py index 6e8bd7d9f5..69a41b08e0 100644 --- a/src/python_testing/TC_EEM_2_3.py +++ b/src/python_testing/TC_EEM_2_3.py @@ -41,7 +41,7 @@ import time -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EnergyReporting_Utils import EnergyReportingBaseTestHelper diff --git a/src/python_testing/TC_EEM_2_4.py b/src/python_testing/TC_EEM_2_4.py index fb5d5f6b36..0f67fb0405 100644 --- a/src/python_testing/TC_EEM_2_4.py +++ b/src/python_testing/TC_EEM_2_4.py @@ -41,7 +41,7 @@ import time -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EnergyReporting_Utils import EnergyReportingBaseTestHelper diff --git a/src/python_testing/TC_EEM_2_5.py b/src/python_testing/TC_EEM_2_5.py index 1408e2b9f6..43cb2cddf8 100644 --- a/src/python_testing/TC_EEM_2_5.py +++ b/src/python_testing/TC_EEM_2_5.py @@ -41,7 +41,7 @@ import time -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EnergyReporting_Utils import EnergyReportingBaseTestHelper diff --git a/src/python_testing/TC_EEVSE_2_2.py b/src/python_testing/TC_EEVSE_2_2.py index 61e52ed0be..144bfd82d3 100644 --- a/src/python_testing/TC_EEVSE_2_2.py +++ b/src/python_testing/TC_EEVSE_2_2.py @@ -46,7 +46,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EEVSE_Utils import EEVSEBaseTestHelper diff --git a/src/python_testing/TC_EEVSE_2_3.py b/src/python_testing/TC_EEVSE_2_3.py index 92005f345b..eb4e43d0b5 100644 --- a/src/python_testing/TC_EEVSE_2_3.py +++ b/src/python_testing/TC_EEVSE_2_3.py @@ -46,7 +46,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import Status -from matter_testing_support import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EEVSE_Utils import EEVSEBaseTestHelper diff --git a/src/python_testing/TC_EEVSE_2_4.py b/src/python_testing/TC_EEVSE_2_4.py index aaebf642b1..10355debd0 100644 --- a/src/python_testing/TC_EEVSE_2_4.py +++ b/src/python_testing/TC_EEVSE_2_4.py @@ -45,7 +45,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_EEVSE_Utils import EEVSEBaseTestHelper logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_EEVSE_2_5.py b/src/python_testing/TC_EEVSE_2_5.py index b25cfe16ce..4571cfb363 100644 --- a/src/python_testing/TC_EEVSE_2_5.py +++ b/src/python_testing/TC_EEVSE_2_5.py @@ -45,7 +45,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import Status -from matter_testing_support import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_EEVSE_Utils import EEVSEBaseTestHelper logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_EEVSE_2_6.py b/src/python_testing/TC_EEVSE_2_6.py index 8f809b4ada..d66ff60bf6 100644 --- a/src/python_testing/TC_EEVSE_2_6.py +++ b/src/python_testing/TC_EEVSE_2_6.py @@ -45,8 +45,8 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import (ClusterAttributeChangeAccumulator, EventChangeCallback, MatterBaseTest, TestStep, - async_test_body, default_matter_test_main) +from chip.testing.matter_testing import (ClusterAttributeChangeAccumulator, EventChangeCallback, MatterBaseTest, TestStep, + async_test_body, default_matter_test_main) from mobly import asserts from TC_EEVSE_Utils import EEVSEBaseTestHelper diff --git a/src/python_testing/TC_EPM_2_1.py b/src/python_testing/TC_EPM_2_1.py index f12cafea66..bee38aa129 100644 --- a/src/python_testing/TC_EPM_2_1.py +++ b/src/python_testing/TC_EPM_2_1.py @@ -42,7 +42,7 @@ import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EnergyReporting_Utils import EnergyReportingBaseTestHelper diff --git a/src/python_testing/TC_EPM_2_2.py b/src/python_testing/TC_EPM_2_2.py index 97e9e047d2..d817042753 100644 --- a/src/python_testing/TC_EPM_2_2.py +++ b/src/python_testing/TC_EPM_2_2.py @@ -42,7 +42,7 @@ import logging import time -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EnergyReporting_Utils import EnergyReportingBaseTestHelper diff --git a/src/python_testing/TC_EWATERHTR_2_1.py b/src/python_testing/TC_EWATERHTR_2_1.py index ced3b16b3d..82c9e93dad 100644 --- a/src/python_testing/TC_EWATERHTR_2_1.py +++ b/src/python_testing/TC_EWATERHTR_2_1.py @@ -45,7 +45,7 @@ import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EWATERHTRBase import EWATERHTRBase diff --git a/src/python_testing/TC_EWATERHTR_2_2.py b/src/python_testing/TC_EWATERHTR_2_2.py index 11e8d545b5..1bd7185b1f 100644 --- a/src/python_testing/TC_EWATERHTR_2_2.py +++ b/src/python_testing/TC_EWATERHTR_2_2.py @@ -47,7 +47,7 @@ import time import chip.clusters as Clusters -from matter_testing_support import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EWATERHTRBase import EWATERHTRBase diff --git a/src/python_testing/TC_EWATERHTR_2_3.py b/src/python_testing/TC_EWATERHTR_2_3.py index 5f7df8c160..0f1c3deae6 100644 --- a/src/python_testing/TC_EWATERHTR_2_3.py +++ b/src/python_testing/TC_EWATERHTR_2_3.py @@ -45,7 +45,7 @@ import logging import chip.clusters as Clusters -from matter_testing_support import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EWATERHTRBase import EWATERHTRBase diff --git a/src/python_testing/TC_FAN_3_1.py b/src/python_testing/TC_FAN_3_1.py index f8322506e6..483be894ba 100644 --- a/src/python_testing/TC_FAN_3_1.py +++ b/src/python_testing/TC_FAN_3_1.py @@ -39,7 +39,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_FAN_3_2.py b/src/python_testing/TC_FAN_3_2.py index 736c97096e..799510eeea 100644 --- a/src/python_testing/TC_FAN_3_2.py +++ b/src/python_testing/TC_FAN_3_2.py @@ -39,7 +39,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_FAN_3_3.py b/src/python_testing/TC_FAN_3_3.py index 935811de21..7a4dde3f6c 100644 --- a/src/python_testing/TC_FAN_3_3.py +++ b/src/python_testing/TC_FAN_3_3.py @@ -38,7 +38,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_FAN_3_4.py b/src/python_testing/TC_FAN_3_4.py index 722339357b..989680ed6b 100644 --- a/src/python_testing/TC_FAN_3_4.py +++ b/src/python_testing/TC_FAN_3_4.py @@ -38,7 +38,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts # import time diff --git a/src/python_testing/TC_FAN_3_5.py b/src/python_testing/TC_FAN_3_5.py index d03f99e55f..26dfc3e52f 100644 --- a/src/python_testing/TC_FAN_3_5.py +++ b/src/python_testing/TC_FAN_3_5.py @@ -39,7 +39,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_ICDM_2_1.py b/src/python_testing/TC_ICDM_2_1.py index 35d1cb62c0..8d7f6d5ed8 100644 --- a/src/python_testing/TC_ICDM_2_1.py +++ b/src/python_testing/TC_ICDM_2_1.py @@ -39,7 +39,7 @@ import re import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_ICDM_3_1.py b/src/python_testing/TC_ICDM_3_1.py index d46d72553d..58181a6588 100644 --- a/src/python_testing/TC_ICDM_3_1.py +++ b/src/python_testing/TC_ICDM_3_1.py @@ -41,7 +41,7 @@ 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 chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_ICDM_3_2.py b/src/python_testing/TC_ICDM_3_2.py index 924c6f4a01..d9800d65b7 100644 --- a/src/python_testing/TC_ICDM_3_2.py +++ b/src/python_testing/TC_ICDM_3_2.py @@ -42,7 +42,7 @@ 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 chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_ICDM_3_3.py b/src/python_testing/TC_ICDM_3_3.py index bc1d698071..d261e53904 100644 --- a/src/python_testing/TC_ICDM_3_3.py +++ b/src/python_testing/TC_ICDM_3_3.py @@ -41,7 +41,7 @@ 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 chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_ICDM_3_4.py b/src/python_testing/TC_ICDM_3_4.py index 4ebb32525c..8ff2a57037 100644 --- a/src/python_testing/TC_ICDM_3_4.py +++ b/src/python_testing/TC_ICDM_3_4.py @@ -40,8 +40,8 @@ import time import chip.clusters as Clusters -from matter_testing_support import (MatterBaseTest, MatterStackState, MatterTestConfig, TestStep, async_test_body, - default_matter_test_main) +from chip.testing.matter_testing import (MatterBaseTest, MatterStackState, MatterTestConfig, TestStep, async_test_body, + default_matter_test_main) from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_ICDM_5_1.py b/src/python_testing/TC_ICDM_5_1.py index 4b7222b690..dacfe58c8b 100644 --- a/src/python_testing/TC_ICDM_5_1.py +++ b/src/python_testing/TC_ICDM_5_1.py @@ -40,7 +40,7 @@ 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 chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mdns_discovery import mdns_discovery from mobly import asserts diff --git a/src/python_testing/TC_ICDManagementCluster.py b/src/python_testing/TC_ICDManagementCluster.py index 07c889a6ea..c0437cb809 100644 --- a/src/python_testing/TC_ICDManagementCluster.py +++ b/src/python_testing/TC_ICDManagementCluster.py @@ -42,7 +42,7 @@ from enum import IntEnum import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts # Assumes `--enable-key 000102030405060708090a0b0c0d0e0f` on Linux app command line, or a DUT diff --git a/src/python_testing/TC_IDM_1_2.py b/src/python_testing/TC_IDM_1_2.py index 7bfb97c22e..a1db9bac83 100644 --- a/src/python_testing/TC_IDM_1_2.py +++ b/src/python_testing/TC_IDM_1_2.py @@ -44,7 +44,7 @@ from chip import ChipUtility from chip.exceptions import ChipStackError from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, type_matches +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, type_matches from mobly import asserts diff --git a/src/python_testing/TC_IDM_1_4.py b/src/python_testing/TC_IDM_1_4.py index b00de41f37..74194135de 100644 --- a/src/python_testing/TC_IDM_1_4.py +++ b/src/python_testing/TC_IDM_1_4.py @@ -44,7 +44,7 @@ import chip.clusters as Clusters from chip.exceptions import ChipStackError from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts # If DUT supports `MaxPathsPerInvoke > 1`, additional command line argument diff --git a/src/python_testing/TC_IDM_4_2.py b/src/python_testing/TC_IDM_4_2.py index d9e876bcd0..0f4cd513e3 100644 --- a/src/python_testing/TC_IDM_4_2.py +++ b/src/python_testing/TC_IDM_4_2.py @@ -44,7 +44,7 @@ from chip.clusters.Attribute import AttributePath, TypedAttributePath from chip.exceptions import ChipStackError from chip.interaction_model import Status -from matter_testing_support import AttributeChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import AttributeChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts ''' diff --git a/src/python_testing/TC_LVL_2_3.py b/src/python_testing/TC_LVL_2_3.py index 94c33d58c0..d120bb7169 100644 --- a/src/python_testing/TC_LVL_2_3.py +++ b/src/python_testing/TC_LVL_2_3.py @@ -41,8 +41,8 @@ import chip.clusters as Clusters import test_plan_support -from matter_testing_support import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, default_matter_test_main, - has_cluster, run_if_endpoint_matches) +from chip.testing.matter_testing import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, default_matter_test_main, + has_cluster, run_if_endpoint_matches) from mobly import asserts diff --git a/src/python_testing/TC_MCORE_FS_1_1.py b/src/python_testing/TC_MCORE_FS_1_1.py index a04cbf0cde..995a80cd94 100755 --- a/src/python_testing/TC_MCORE_FS_1_1.py +++ b/src/python_testing/TC_MCORE_FS_1_1.py @@ -48,7 +48,7 @@ import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.testing.apps import AppServerSubprocess -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts _DEVICE_TYPE_AGGREGATOR = 0x000E diff --git a/src/python_testing/TC_MCORE_FS_1_2.py b/src/python_testing/TC_MCORE_FS_1_2.py index a7d318ca65..f806db4d09 100644 --- a/src/python_testing/TC_MCORE_FS_1_2.py +++ b/src/python_testing/TC_MCORE_FS_1_2.py @@ -51,8 +51,8 @@ import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.testing.apps import AppServerSubprocess +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches 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 diff --git a/src/python_testing/TC_MCORE_FS_1_3.py b/src/python_testing/TC_MCORE_FS_1_3.py index c0b3e83fe3..2ac1556199 100644 --- a/src/python_testing/TC_MCORE_FS_1_3.py +++ b/src/python_testing/TC_MCORE_FS_1_3.py @@ -51,7 +51,7 @@ from chip import ChipDeviceCtrl from chip.interaction_model import Status from chip.testing.apps import AppServerSubprocess -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts _DEVICE_TYPE_AGGREGATOR = 0x000E diff --git a/src/python_testing/TC_MCORE_FS_1_4.py b/src/python_testing/TC_MCORE_FS_1_4.py index 74a8becdf7..795e81cf2f 100644 --- a/src/python_testing/TC_MCORE_FS_1_4.py +++ b/src/python_testing/TC_MCORE_FS_1_4.py @@ -50,8 +50,8 @@ from chip import ChipDeviceCtrl from chip.interaction_model import Status from chip.testing.apps import AppServerSubprocess +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from chip.testing.tasks import Subprocess -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts diff --git a/src/python_testing/TC_MCORE_FS_1_5.py b/src/python_testing/TC_MCORE_FS_1_5.py index 57ae214a5d..59549fd0bc 100755 --- a/src/python_testing/TC_MCORE_FS_1_5.py +++ b/src/python_testing/TC_MCORE_FS_1_5.py @@ -51,8 +51,8 @@ import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.testing.apps import AppServerSubprocess +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches 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 diff --git a/src/python_testing/TC_MWOCTRL_2_1.py b/src/python_testing/TC_MWOCTRL_2_1.py index 57c51fa98d..6f913578cb 100644 --- a/src/python_testing/TC_MWOCTRL_2_1.py +++ b/src/python_testing/TC_MWOCTRL_2_1.py @@ -37,7 +37,7 @@ 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 chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts # This test requires several additional command line arguments diff --git a/src/python_testing/TC_MWOCTRL_2_2.py b/src/python_testing/TC_MWOCTRL_2_2.py index 35eef081a9..4559689640 100644 --- a/src/python_testing/TC_MWOCTRL_2_2.py +++ b/src/python_testing/TC_MWOCTRL_2_2.py @@ -39,7 +39,7 @@ 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 chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts # This test requires several additional command line arguments diff --git a/src/python_testing/TC_MWOCTRL_2_4.py b/src/python_testing/TC_MWOCTRL_2_4.py index 9e11724975..e05c4a5bd5 100644 --- a/src/python_testing/TC_MWOCTRL_2_4.py +++ b/src/python_testing/TC_MWOCTRL_2_4.py @@ -39,7 +39,7 @@ 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 chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts # This test requires several additional command line arguments diff --git a/src/python_testing/TC_MWOM_1_2.py b/src/python_testing/TC_MWOM_1_2.py index 8a7762337e..5cad6ce013 100644 --- a/src/python_testing/TC_MWOM_1_2.py +++ b/src/python_testing/TC_MWOM_1_2.py @@ -37,7 +37,7 @@ import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_OCC_2_1.py b/src/python_testing/TC_OCC_2_1.py index 885ec6b16c..d831d486d2 100644 --- a/src/python_testing/TC_OCC_2_1.py +++ b/src/python_testing/TC_OCC_2_1.py @@ -43,7 +43,7 @@ import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_OCC_2_2.py b/src/python_testing/TC_OCC_2_2.py index 463b8136d5..afa2e3cd61 100644 --- a/src/python_testing/TC_OCC_2_2.py +++ b/src/python_testing/TC_OCC_2_2.py @@ -37,7 +37,7 @@ # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_OCC_2_3.py b/src/python_testing/TC_OCC_2_3.py index 9c6cb80d9a..8d4b53f429 100644 --- a/src/python_testing/TC_OCC_2_3.py +++ b/src/python_testing/TC_OCC_2_3.py @@ -39,7 +39,7 @@ import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_OCC_3_1.py b/src/python_testing/TC_OCC_3_1.py index b6ba0ead01..cce0a2f697 100644 --- a/src/python_testing/TC_OCC_3_1.py +++ b/src/python_testing/TC_OCC_3_1.py @@ -43,8 +43,8 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import (ClusterAttributeChangeAccumulator, EventChangeCallback, MatterBaseTest, TestStep, - async_test_body, await_sequence_of_reports, default_matter_test_main) +from chip.testing.matter_testing import (ClusterAttributeChangeAccumulator, EventChangeCallback, MatterBaseTest, TestStep, + async_test_body, await_sequence_of_reports, default_matter_test_main) from mobly import asserts diff --git a/src/python_testing/TC_OCC_3_2.py b/src/python_testing/TC_OCC_3_2.py index d4e5f18662..3a5ca17069 100644 --- a/src/python_testing/TC_OCC_3_2.py +++ b/src/python_testing/TC_OCC_3_2.py @@ -44,8 +44,8 @@ import time import chip.clusters as Clusters -from matter_testing_support import (AttributeValue, ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, async_test_body, - await_sequence_of_reports, default_matter_test_main) +from chip.testing.matter_testing import (AttributeValue, ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, + async_test_body, await_sequence_of_reports, default_matter_test_main) from mobly import asserts diff --git a/src/python_testing/TC_OPCREDS_3_1.py b/src/python_testing/TC_OPCREDS_3_1.py index be21c6d7d4..1506d2a712 100644 --- a/src/python_testing/TC_OPCREDS_3_1.py +++ b/src/python_testing/TC_OPCREDS_3_1.py @@ -42,8 +42,8 @@ from chip import ChipDeviceCtrl from chip.exceptions import ChipStackError from chip.interaction_model import InteractionModelError, Status +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from chip.tlv import TLVReader, TLVWriter -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_OPCREDS_3_2.py b/src/python_testing/TC_OPCREDS_3_2.py index 91e2958fb0..2bfc214665 100644 --- a/src/python_testing/TC_OPCREDS_3_2.py +++ b/src/python_testing/TC_OPCREDS_3_2.py @@ -36,9 +36,9 @@ # === END CI TEST ARGUMENTS === import chip.clusters as Clusters +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from chip.tlv import TLVReader from chip.utils import CommissioningBuildingBlocks -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from test_plan_support import (commission_from_existing, commission_if_required, read_attribute, remove_fabric, verify_commissioning_successful, verify_success) diff --git a/src/python_testing/TC_OPSTATE_2_1.py b/src/python_testing/TC_OPSTATE_2_1.py index 1b6966a09a..060b71d85e 100644 --- a/src/python_testing/TC_OPSTATE_2_1.py +++ b/src/python_testing/TC_OPSTATE_2_1.py @@ -37,7 +37,7 @@ # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OPSTATE_2_2.py b/src/python_testing/TC_OPSTATE_2_2.py index 8617d3ddd6..f0ed8f214d 100644 --- a/src/python_testing/TC_OPSTATE_2_2.py +++ b/src/python_testing/TC_OPSTATE_2_2.py @@ -38,7 +38,7 @@ # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OPSTATE_2_3.py b/src/python_testing/TC_OPSTATE_2_3.py index 3671747dee..d35aa6e61e 100644 --- a/src/python_testing/TC_OPSTATE_2_3.py +++ b/src/python_testing/TC_OPSTATE_2_3.py @@ -39,7 +39,7 @@ import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OPSTATE_2_4.py b/src/python_testing/TC_OPSTATE_2_4.py index d468227781..ec2c7c17da 100644 --- a/src/python_testing/TC_OPSTATE_2_4.py +++ b/src/python_testing/TC_OPSTATE_2_4.py @@ -39,7 +39,7 @@ import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OPSTATE_2_5.py b/src/python_testing/TC_OPSTATE_2_5.py index 687f4d21b0..89a2462a2b 100644 --- a/src/python_testing/TC_OPSTATE_2_5.py +++ b/src/python_testing/TC_OPSTATE_2_5.py @@ -39,7 +39,7 @@ import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OPSTATE_2_6.py b/src/python_testing/TC_OPSTATE_2_6.py index 9441569c87..0b9e1ec3bb 100644 --- a/src/python_testing/TC_OPSTATE_2_6.py +++ b/src/python_testing/TC_OPSTATE_2_6.py @@ -39,7 +39,7 @@ import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OVENOPSTATE_2_1.py b/src/python_testing/TC_OVENOPSTATE_2_1.py index 6bf7226986..d830a416c0 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_1.py +++ b/src/python_testing/TC_OVENOPSTATE_2_1.py @@ -38,7 +38,7 @@ import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OVENOPSTATE_2_2.py b/src/python_testing/TC_OVENOPSTATE_2_2.py index 2fa1215bd1..55afad11be 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_2.py +++ b/src/python_testing/TC_OVENOPSTATE_2_2.py @@ -38,7 +38,7 @@ # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OVENOPSTATE_2_3.py b/src/python_testing/TC_OVENOPSTATE_2_3.py index 815fcef97b..329bceb1fb 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_3.py +++ b/src/python_testing/TC_OVENOPSTATE_2_3.py @@ -38,7 +38,7 @@ # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OVENOPSTATE_2_4.py b/src/python_testing/TC_OVENOPSTATE_2_4.py index 892bf28f0d..ffc639390e 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_4.py +++ b/src/python_testing/TC_OVENOPSTATE_2_4.py @@ -38,7 +38,7 @@ # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OVENOPSTATE_2_5.py b/src/python_testing/TC_OVENOPSTATE_2_5.py index 4fd9ef9271..42edca72f3 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_5.py +++ b/src/python_testing/TC_OVENOPSTATE_2_5.py @@ -39,7 +39,7 @@ import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OVENOPSTATE_2_6.py b/src/python_testing/TC_OVENOPSTATE_2_6.py index db4b390027..2770625bb7 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_6.py +++ b/src/python_testing/TC_OVENOPSTATE_2_6.py @@ -39,7 +39,7 @@ import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OpstateCommon.py b/src/python_testing/TC_OpstateCommon.py index c697c7ab5f..557b7606cc 100644 --- a/src/python_testing/TC_OpstateCommon.py +++ b/src/python_testing/TC_OpstateCommon.py @@ -27,7 +27,7 @@ from chip.clusters.Attribute import EventReadResult, SubscriptionTransaction from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import ClusterAttributeChangeAccumulator, EventChangeCallback, TestStep +from chip.testing.matter_testing import ClusterAttributeChangeAccumulator, EventChangeCallback, TestStep from mobly import asserts diff --git a/src/python_testing/TC_PS_2_3.py b/src/python_testing/TC_PS_2_3.py index dbff20e6f4..13f4420b0a 100644 --- a/src/python_testing/TC_PS_2_3.py +++ b/src/python_testing/TC_PS_2_3.py @@ -38,8 +38,8 @@ import time import chip.clusters as Clusters -from matter_testing_support import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, async_test_body, - default_matter_test_main) +from chip.testing.matter_testing import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, async_test_body, + default_matter_test_main) from mobly import asserts diff --git a/src/python_testing/TC_PWRTL_2_1.py b/src/python_testing/TC_PWRTL_2_1.py index 639bd3dd9a..3de09c6e93 100644 --- a/src/python_testing/TC_PWRTL_2_1.py +++ b/src/python_testing/TC_PWRTL_2_1.py @@ -37,7 +37,7 @@ import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_RR_1_1.py b/src/python_testing/TC_RR_1_1.py index 2785171f94..0cbf0274c5 100644 --- a/src/python_testing/TC_RR_1_1.py +++ b/src/python_testing/TC_RR_1_1.py @@ -45,8 +45,8 @@ import chip.clusters as Clusters from chip.interaction_model import Status as StatusEnum +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from chip.utils import CommissioningBuildingBlocks -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts from TC_SC_3_6 import AttributeChangeAccumulator, ResubscriptionCatcher diff --git a/src/python_testing/TC_RVCCLEANM_1_2.py b/src/python_testing/TC_RVCCLEANM_1_2.py index 9e4bca4762..3dfd75f4f4 100644 --- a/src/python_testing/TC_RVCCLEANM_1_2.py +++ b/src/python_testing/TC_RVCCLEANM_1_2.py @@ -39,7 +39,7 @@ import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_RVCCLEANM_2_1.py b/src/python_testing/TC_RVCCLEANM_2_1.py index 2c4ddd1dc7..5234a74685 100644 --- a/src/python_testing/TC_RVCCLEANM_2_1.py +++ b/src/python_testing/TC_RVCCLEANM_2_1.py @@ -41,7 +41,7 @@ import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, type_matches +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, type_matches from mobly import asserts # This test requires several additional command line arguments diff --git a/src/python_testing/TC_RVCCLEANM_2_2.py b/src/python_testing/TC_RVCCLEANM_2_2.py index 5262465555..7352d03e24 100644 --- a/src/python_testing/TC_RVCCLEANM_2_2.py +++ b/src/python_testing/TC_RVCCLEANM_2_2.py @@ -39,7 +39,7 @@ import enum import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, type_matches +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, type_matches from mobly import asserts diff --git a/src/python_testing/TC_RVCOPSTATE_2_1.py b/src/python_testing/TC_RVCOPSTATE_2_1.py index ae3e6c3930..48715c3b7a 100644 --- a/src/python_testing/TC_RVCOPSTATE_2_1.py +++ b/src/python_testing/TC_RVCOPSTATE_2_1.py @@ -40,7 +40,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_RVCOPSTATE_2_3.py b/src/python_testing/TC_RVCOPSTATE_2_3.py index 60bbed18bd..1b522117b9 100644 --- a/src/python_testing/TC_RVCOPSTATE_2_3.py +++ b/src/python_testing/TC_RVCOPSTATE_2_3.py @@ -41,7 +41,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, type_matches +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, type_matches from mobly import asserts diff --git a/src/python_testing/TC_RVCOPSTATE_2_4.py b/src/python_testing/TC_RVCOPSTATE_2_4.py index 458b3cf740..ad515dbff1 100644 --- a/src/python_testing/TC_RVCOPSTATE_2_4.py +++ b/src/python_testing/TC_RVCOPSTATE_2_4.py @@ -39,7 +39,7 @@ import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, type_matches +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, type_matches from mobly import asserts diff --git a/src/python_testing/TC_RVCRUNM_1_2.py b/src/python_testing/TC_RVCRUNM_1_2.py index d3040fdb6b..90db1601b1 100644 --- a/src/python_testing/TC_RVCRUNM_1_2.py +++ b/src/python_testing/TC_RVCRUNM_1_2.py @@ -39,7 +39,7 @@ import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_RVCRUNM_2_1.py b/src/python_testing/TC_RVCRUNM_2_1.py index 850faf052a..55c37c7094 100644 --- a/src/python_testing/TC_RVCRUNM_2_1.py +++ b/src/python_testing/TC_RVCRUNM_2_1.py @@ -41,7 +41,7 @@ import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, type_matches +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, type_matches from mobly import asserts # This test requires several additional command line arguments diff --git a/src/python_testing/TC_RVCRUNM_2_2.py b/src/python_testing/TC_RVCRUNM_2_2.py index f53a75503b..e78d6d7f42 100644 --- a/src/python_testing/TC_RVCRUNM_2_2.py +++ b/src/python_testing/TC_RVCRUNM_2_2.py @@ -41,7 +41,7 @@ import enum import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts # This test requires several additional command line arguments. diff --git a/src/python_testing/TC_SC_3_6.py b/src/python_testing/TC_SC_3_6.py index 74c09e2b72..8cfbee8e46 100644 --- a/src/python_testing/TC_SC_3_6.py +++ b/src/python_testing/TC_SC_3_6.py @@ -45,8 +45,8 @@ import chip.clusters as Clusters from chip.clusters import ClusterObjects as ClustersObjects from chip.clusters.Attribute import SubscriptionTransaction, TypedAttributePath +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from chip.utils import CommissioningBuildingBlocks -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts # TODO: Overall, we need to add validation that session IDs have not changed throughout to be agnostic diff --git a/src/python_testing/TC_SC_7_1.py b/src/python_testing/TC_SC_7_1.py index 19229b38ec..42ad785843 100644 --- a/src/python_testing/TC_SC_7_1.py +++ b/src/python_testing/TC_SC_7_1.py @@ -38,7 +38,7 @@ import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_SEAR_1_2.py b/src/python_testing/TC_SEAR_1_2.py index 41482be51c..41773804e4 100644 --- a/src/python_testing/TC_SEAR_1_2.py +++ b/src/python_testing/TC_SEAR_1_2.py @@ -41,7 +41,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_SEAR_1_3.py b/src/python_testing/TC_SEAR_1_3.py index 9592bce3fe..2c2b85a13c 100644 --- a/src/python_testing/TC_SEAR_1_3.py +++ b/src/python_testing/TC_SEAR_1_3.py @@ -41,7 +41,7 @@ import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_SEAR_1_4.py b/src/python_testing/TC_SEAR_1_4.py index 3f3a84bdf2..cf53f446f9 100644 --- a/src/python_testing/TC_SEAR_1_4.py +++ b/src/python_testing/TC_SEAR_1_4.py @@ -40,7 +40,7 @@ import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_SEAR_1_5.py b/src/python_testing/TC_SEAR_1_5.py index 99da6da78b..130ccb8d59 100644 --- a/src/python_testing/TC_SEAR_1_5.py +++ b/src/python_testing/TC_SEAR_1_5.py @@ -41,7 +41,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_SEAR_1_6.py b/src/python_testing/TC_SEAR_1_6.py index 434da00258..dc6188a14e 100644 --- a/src/python_testing/TC_SEAR_1_6.py +++ b/src/python_testing/TC_SEAR_1_6.py @@ -41,7 +41,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_SWTCH.py b/src/python_testing/TC_SWTCH.py index 7cafaa7b55..fe55013452 100644 --- a/src/python_testing/TC_SWTCH.py +++ b/src/python_testing/TC_SWTCH.py @@ -90,10 +90,10 @@ import test_plan_support from chip.clusters import ClusterObjects as ClusterObjects from chip.clusters.Attribute import EventReadResult +from chip.testing.matter_testing import (AttributeValue, ClusterAttributeChangeAccumulator, EventChangeCallback, MatterBaseTest, + TestStep, await_sequence_of_reports, default_matter_test_main, has_feature, + run_if_endpoint_matches) from chip.tlv import uint -from matter_testing_support import (AttributeValue, ClusterAttributeChangeAccumulator, EventChangeCallback, MatterBaseTest, - TestStep, await_sequence_of_reports, default_matter_test_main, has_feature, - run_if_endpoint_matches) from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_TIMESYNC_2_1.py b/src/python_testing/TC_TIMESYNC_2_1.py index 9858976520..cb2df9d66a 100644 --- a/src/python_testing/TC_TIMESYNC_2_1.py +++ b/src/python_testing/TC_TIMESYNC_2_1.py @@ -41,8 +41,8 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import (MatterBaseTest, default_matter_test_main, has_attribute, has_cluster, run_if_endpoint_matches, - utc_time_in_matter_epoch) +from chip.testing.matter_testing import (MatterBaseTest, default_matter_test_main, has_attribute, has_cluster, + run_if_endpoint_matches, utc_time_in_matter_epoch) from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_10.py b/src/python_testing/TC_TIMESYNC_2_10.py index b9aa7dabb7..99ca9f3ac0 100644 --- a/src/python_testing/TC_TIMESYNC_2_10.py +++ b/src/python_testing/TC_TIMESYNC_2_10.py @@ -43,9 +43,9 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError +from chip.testing.matter_testing import (MatterBaseTest, SimpleEventCallback, async_test_body, default_matter_test_main, + utc_time_in_matter_epoch) from chip.tlv import uint -from matter_testing_support import (MatterBaseTest, SimpleEventCallback, async_test_body, default_matter_test_main, - utc_time_in_matter_epoch) from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_11.py b/src/python_testing/TC_TIMESYNC_2_11.py index 1aaed7a14e..0865bc87f4 100644 --- a/src/python_testing/TC_TIMESYNC_2_11.py +++ b/src/python_testing/TC_TIMESYNC_2_11.py @@ -43,9 +43,9 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError +from chip.testing.matter_testing import (MatterBaseTest, SimpleEventCallback, async_test_body, default_matter_test_main, + get_wait_seconds_from_set_time, type_matches, utc_time_in_matter_epoch) from chip.tlv import uint -from matter_testing_support import (MatterBaseTest, SimpleEventCallback, async_test_body, default_matter_test_main, - get_wait_seconds_from_set_time, type_matches, utc_time_in_matter_epoch) from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_12.py b/src/python_testing/TC_TIMESYNC_2_12.py index cd4378fcdc..7677dcf184 100644 --- a/src/python_testing/TC_TIMESYNC_2_12.py +++ b/src/python_testing/TC_TIMESYNC_2_12.py @@ -43,9 +43,9 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError +from chip.testing.matter_testing import (MatterBaseTest, SimpleEventCallback, async_test_body, default_matter_test_main, + get_wait_seconds_from_set_time, type_matches, utc_time_in_matter_epoch) from chip.tlv import uint -from matter_testing_support import (MatterBaseTest, SimpleEventCallback, async_test_body, default_matter_test_main, - get_wait_seconds_from_set_time, type_matches, utc_time_in_matter_epoch) from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_13.py b/src/python_testing/TC_TIMESYNC_2_13.py index 91c679e14b..8138983030 100644 --- a/src/python_testing/TC_TIMESYNC_2_13.py +++ b/src/python_testing/TC_TIMESYNC_2_13.py @@ -41,7 +41,7 @@ import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.clusters.Types import NullValue -from matter_testing_support import MatterBaseTest, SimpleEventCallback, async_test_body, default_matter_test_main, type_matches +from chip.testing.matter_testing import MatterBaseTest, SimpleEventCallback, async_test_body, default_matter_test_main, type_matches from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_2.py b/src/python_testing/TC_TIMESYNC_2_2.py index dff4bd5f82..74f935aac9 100644 --- a/src/python_testing/TC_TIMESYNC_2_2.py +++ b/src/python_testing/TC_TIMESYNC_2_2.py @@ -40,7 +40,8 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError -from matter_testing_support import MatterBaseTest, async_test_body, compare_time, default_matter_test_main, utc_time_in_matter_epoch +from chip.testing.matter_testing import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, + utc_time_in_matter_epoch) from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_4.py b/src/python_testing/TC_TIMESYNC_2_4.py index a367dcad3d..76fe9074be 100644 --- a/src/python_testing/TC_TIMESYNC_2_4.py +++ b/src/python_testing/TC_TIMESYNC_2_4.py @@ -40,7 +40,8 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, type_matches, utc_time_in_matter_epoch +from chip.testing.matter_testing import (MatterBaseTest, async_test_body, default_matter_test_main, type_matches, + utc_time_in_matter_epoch) from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_5.py b/src/python_testing/TC_TIMESYNC_2_5.py index d62797e91e..f363f03ba6 100644 --- a/src/python_testing/TC_TIMESYNC_2_5.py +++ b/src/python_testing/TC_TIMESYNC_2_5.py @@ -40,7 +40,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, utc_time_in_matter_epoch +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, utc_time_in_matter_epoch from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_6.py b/src/python_testing/TC_TIMESYNC_2_6.py index f6fe8738f4..0e9ec9f795 100644 --- a/src/python_testing/TC_TIMESYNC_2_6.py +++ b/src/python_testing/TC_TIMESYNC_2_6.py @@ -40,7 +40,7 @@ import chip.clusters as Clusters from chip.clusters.Types import Nullable, NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_7.py b/src/python_testing/TC_TIMESYNC_2_7.py index edc71545cf..1c6cea2023 100644 --- a/src/python_testing/TC_TIMESYNC_2_7.py +++ b/src/python_testing/TC_TIMESYNC_2_7.py @@ -42,9 +42,9 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError +from chip.testing.matter_testing import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, type_matches, + utc_time_in_matter_epoch) from chip.tlv import uint -from matter_testing_support import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, type_matches, - utc_time_in_matter_epoch) from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_8.py b/src/python_testing/TC_TIMESYNC_2_8.py index 07785346c7..82a77c4c88 100644 --- a/src/python_testing/TC_TIMESYNC_2_8.py +++ b/src/python_testing/TC_TIMESYNC_2_8.py @@ -42,9 +42,9 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError +from chip.testing.matter_testing import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, type_matches, + utc_time_in_matter_epoch) from chip.tlv import uint -from matter_testing_support import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, type_matches, - utc_time_in_matter_epoch) from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_9.py b/src/python_testing/TC_TIMESYNC_2_9.py index 1f439b84e6..4ce83f81dd 100644 --- a/src/python_testing/TC_TIMESYNC_2_9.py +++ b/src/python_testing/TC_TIMESYNC_2_9.py @@ -41,9 +41,9 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError +from chip.testing.matter_testing import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, type_matches, + utc_time_in_matter_epoch) from chip.tlv import uint -from matter_testing_support import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, type_matches, - utc_time_in_matter_epoch) from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_3_1.py b/src/python_testing/TC_TIMESYNC_3_1.py index 3f292d0e85..4c7c9d9420 100644 --- a/src/python_testing/TC_TIMESYNC_3_1.py +++ b/src/python_testing/TC_TIMESYNC_3_1.py @@ -35,7 +35,7 @@ # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_TMP_2_1.py b/src/python_testing/TC_TMP_2_1.py index f48b96991e..d0ae9cf86a 100644 --- a/src/python_testing/TC_TMP_2_1.py +++ b/src/python_testing/TC_TMP_2_1.py @@ -16,7 +16,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_TSTAT_4_2.py b/src/python_testing/TC_TSTAT_4_2.py index fa77f94ae7..6dad144f30 100644 --- a/src/python_testing/TC_TSTAT_4_2.py +++ b/src/python_testing/TC_TSTAT_4_2.py @@ -43,7 +43,7 @@ from chip.clusters import Globals from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_TestEventTrigger.py b/src/python_testing/TC_TestEventTrigger.py index 38053540c6..ae4f64a805 100644 --- a/src/python_testing/TC_TestEventTrigger.py +++ b/src/python_testing/TC_TestEventTrigger.py @@ -43,7 +43,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts # Assumes `--enable-key 000102030405060708090a0b0c0d0e0f` on Linux app command line, or a DUT diff --git a/src/python_testing/TC_VALCC_2_1.py b/src/python_testing/TC_VALCC_2_1.py index a079c88c8b..d6f00b00a6 100644 --- a/src/python_testing/TC_VALCC_2_1.py +++ b/src/python_testing/TC_VALCC_2_1.py @@ -35,7 +35,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_VALCC_3_1.py b/src/python_testing/TC_VALCC_3_1.py index f4c6ebfa14..4b53ab032c 100644 --- a/src/python_testing/TC_VALCC_3_1.py +++ b/src/python_testing/TC_VALCC_3_1.py @@ -36,7 +36,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_VALCC_3_2.py b/src/python_testing/TC_VALCC_3_2.py index 0609051f4e..6905e3bde8 100644 --- a/src/python_testing/TC_VALCC_3_2.py +++ b/src/python_testing/TC_VALCC_3_2.py @@ -37,7 +37,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_VALCC_3_3.py b/src/python_testing/TC_VALCC_3_3.py index d90065d5bb..a63053cf34 100644 --- a/src/python_testing/TC_VALCC_3_3.py +++ b/src/python_testing/TC_VALCC_3_3.py @@ -37,7 +37,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_VALCC_3_4.py b/src/python_testing/TC_VALCC_3_4.py index f1363a51f3..30c57dcb3f 100644 --- a/src/python_testing/TC_VALCC_3_4.py +++ b/src/python_testing/TC_VALCC_3_4.py @@ -35,7 +35,7 @@ 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 chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_VALCC_4_1.py b/src/python_testing/TC_VALCC_4_1.py index a103898567..9af428d103 100644 --- a/src/python_testing/TC_VALCC_4_1.py +++ b/src/python_testing/TC_VALCC_4_1.py @@ -36,7 +36,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_VALCC_4_2.py b/src/python_testing/TC_VALCC_4_2.py index f2f0dd6631..9365e5bc78 100644 --- a/src/python_testing/TC_VALCC_4_2.py +++ b/src/python_testing/TC_VALCC_4_2.py @@ -36,7 +36,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_VALCC_4_3.py b/src/python_testing/TC_VALCC_4_3.py index a66d4eafd4..b0762d0d88 100644 --- a/src/python_testing/TC_VALCC_4_3.py +++ b/src/python_testing/TC_VALCC_4_3.py @@ -36,7 +36,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_VALCC_4_4.py b/src/python_testing/TC_VALCC_4_4.py index f6ad63d368..b85ff9a9f0 100644 --- a/src/python_testing/TC_VALCC_4_4.py +++ b/src/python_testing/TC_VALCC_4_4.py @@ -36,7 +36,8 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, utc_time_in_matter_epoch +from chip.testing.matter_testing import (MatterBaseTest, TestStep, async_test_body, default_matter_test_main, + utc_time_in_matter_epoch) from mobly import asserts diff --git a/src/python_testing/TC_VALCC_4_5.py b/src/python_testing/TC_VALCC_4_5.py index 3b850c0804..c6b7674c6c 100644 --- a/src/python_testing/TC_VALCC_4_5.py +++ b/src/python_testing/TC_VALCC_4_5.py @@ -36,7 +36,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_WHM_1_2.py b/src/python_testing/TC_WHM_1_2.py index 9d7d9b2879..2bbcdd5108 100644 --- a/src/python_testing/TC_WHM_1_2.py +++ b/src/python_testing/TC_WHM_1_2.py @@ -41,7 +41,7 @@ import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_WHM_2_1.py b/src/python_testing/TC_WHM_2_1.py index 6172ee013f..b9dcb0257d 100644 --- a/src/python_testing/TC_WHM_2_1.py +++ b/src/python_testing/TC_WHM_2_1.py @@ -43,7 +43,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts diff --git a/src/python_testing/TC_pics_checker.py b/src/python_testing/TC_pics_checker.py index 91e2102b5e..07e8613cc1 100644 --- a/src/python_testing/TC_pics_checker.py +++ b/src/python_testing/TC_pics_checker.py @@ -17,13 +17,13 @@ import math import chip.clusters as Clusters -from basic_composition_support import BasicCompositionTests -from global_attribute_ids import GlobalAttributeIds -from matter_testing_support import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, FeaturePathLocation, - MatterBaseTest, ProblemLocation, TestStep, async_test_body, default_matter_test_main) +from chip.testing.basic_composition import BasicCompositionTests +from chip.testing.global_attribute_ids import GlobalAttributeIds +from chip.testing.matter_testing import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, FeaturePathLocation, + MatterBaseTest, ProblemLocation, TestStep, async_test_body, default_matter_test_main) +from chip.testing.pics import accepted_cmd_pics_str, attribute_pics_str, feature_pics_str, generated_cmd_pics_str +from chip.testing.spec_parsing import build_xml_clusters from mobly import asserts -from pics_support import accepted_cmd_pics_str, attribute_pics_str, feature_pics_str, generated_cmd_pics_str -from spec_parsing_support import build_xml_clusters class TC_PICS_Checker(MatterBaseTest, BasicCompositionTests): diff --git a/src/python_testing/TestBatchInvoke.py b/src/python_testing/TestBatchInvoke.py index a17f7b8be4..6465692c95 100644 --- a/src/python_testing/TestBatchInvoke.py +++ b/src/python_testing/TestBatchInvoke.py @@ -38,7 +38,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, type_matches +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, type_matches from mobly import asserts ''' Integration test of batch commands using UnitTesting Cluster diff --git a/src/python_testing/TestChoiceConformanceSupport.py b/src/python_testing/TestChoiceConformanceSupport.py index 8436bc8418..77eca93761 100644 --- a/src/python_testing/TestChoiceConformanceSupport.py +++ b/src/python_testing/TestChoiceConformanceSupport.py @@ -19,11 +19,11 @@ import xml.etree.ElementTree as ElementTree import jinja2 -from choice_conformance_support import (evaluate_attribute_choice_conformance, evaluate_command_choice_conformance, - evaluate_feature_choice_conformance) -from matter_testing_support import MatterBaseTest, ProblemNotice, default_matter_test_main +from chip.testing.choice_conformance import (evaluate_attribute_choice_conformance, evaluate_command_choice_conformance, + evaluate_feature_choice_conformance) +from chip.testing.matter_testing import MatterBaseTest, ProblemNotice, default_matter_test_main +from chip.testing.spec_parsing import XmlCluster, add_cluster_data_from_xml from mobly import asserts -from spec_parsing_support import XmlCluster, add_cluster_data_from_xml FEATURE_TEMPLATE = '''\ diff --git a/src/python_testing/TestCommissioningTimeSync.py b/src/python_testing/TestCommissioningTimeSync.py index dfd03d957d..d4033ea58b 100644 --- a/src/python_testing/TestCommissioningTimeSync.py +++ b/src/python_testing/TestCommissioningTimeSync.py @@ -20,7 +20,7 @@ from chip import ChipDeviceCtrl from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, utc_time_in_matter_epoch +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, utc_time_in_matter_epoch from mobly import asserts # We don't have a good pipe between the c++ enums in CommissioningDelegate and python diff --git a/src/python_testing/TestConformanceSupport.py b/src/python_testing/TestConformanceSupport.py index 3744b6fe5e..ca41bf088e 100644 --- a/src/python_testing/TestConformanceSupport.py +++ b/src/python_testing/TestConformanceSupport.py @@ -18,11 +18,11 @@ import xml.etree.ElementTree as ElementTree from typing import Callable +from chip.testing.conformance import (Choice, Conformance, ConformanceDecision, ConformanceException, ConformanceParseParameters, + deprecated, disallowed, mandatory, optional, parse_basic_callable_from_xml, + parse_callable_from_xml, parse_device_type_callable_from_xml, provisional, zigbee) +from chip.testing.matter_testing import MatterBaseTest, default_matter_test_main from chip.tlv import uint -from conformance_support import (Choice, Conformance, ConformanceDecision, ConformanceException, ConformanceParseParameters, - deprecated, disallowed, mandatory, optional, parse_basic_callable_from_xml, - parse_callable_from_xml, parse_device_type_callable_from_xml, provisional, zigbee) -from matter_testing_support import MatterBaseTest, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TestConformanceTest.py b/src/python_testing/TestConformanceTest.py index f0ff8032ea..ddf3e421a7 100644 --- a/src/python_testing/TestConformanceTest.py +++ b/src/python_testing/TestConformanceTest.py @@ -18,12 +18,12 @@ from typing import Any import chip.clusters as Clusters -from basic_composition_support import arls_populated -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 chip.testing.basic_composition import arls_populated +from chip.testing.conformance import ConformanceDecision +from chip.testing.global_attribute_ids import GlobalAttributeIds +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.spec_parsing import build_xml_clusters, build_xml_device_types from mobly import asserts -from spec_parsing_support import build_xml_clusters, build_xml_device_types from TC_DeviceConformance import DeviceConformanceTests diff --git a/src/python_testing/TestGroupTableReports.py b/src/python_testing/TestGroupTableReports.py index 6e3980bcae..9d98a050c7 100644 --- a/src/python_testing/TestGroupTableReports.py +++ b/src/python_testing/TestGroupTableReports.py @@ -42,7 +42,7 @@ from chip.clusters import ClusterObjects as ClusterObjects from chip.clusters.Attribute import SubscriptionTransaction, TypedAttributePath from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TestIdChecks.py b/src/python_testing/TestIdChecks.py index 8969807d58..eda01ef955 100644 --- a/src/python_testing/TestIdChecks.py +++ b/src/python_testing/TestIdChecks.py @@ -15,9 +15,10 @@ # limitations under the License. # -from global_attribute_ids import (AttributeIdType, ClusterIdType, DeviceTypeIdType, attribute_id_type, cluster_id_type, - device_type_id_type, is_valid_attribute_id, is_valid_cluster_id, is_valid_device_type_id) -from matter_testing_support import MatterBaseTest, default_matter_test_main +from chip.testing.global_attribute_ids import (AttributeIdType, ClusterIdType, DeviceTypeIdType, attribute_id_type, cluster_id_type, + device_type_id_type, is_valid_attribute_id, is_valid_cluster_id, + is_valid_device_type_id) +from chip.testing.matter_testing import MatterBaseTest, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TestMatterTestingSupport.py b/src/python_testing/TestMatterTestingSupport.py index 08c3e830d2..811349b3a9 100644 --- a/src/python_testing/TestMatterTestingSupport.py +++ b/src/python_testing/TestMatterTestingSupport.py @@ -22,14 +22,15 @@ import chip.clusters as Clusters from chip.clusters.Types import Nullable, NullValue +from chip.testing.matter_testing import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, + get_wait_seconds_from_set_time, parse_matter_test_args, type_matches, + utc_time_in_matter_epoch) +from chip.testing.pics import parse_pics, parse_pics_xml +from chip.testing.taglist_and_topology_test import (TagProblem, create_device_type_list_for_root, create_device_type_lists, + find_tag_list_problems, find_tree_roots, flat_list_ok, get_all_children, + get_direct_children_of_root, parts_list_cycles, separate_endpoint_types) from chip.tlv import uint -from matter_testing_support import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, - get_wait_seconds_from_set_time, parse_matter_test_args, type_matches, utc_time_in_matter_epoch) from mobly import asserts, signals -from pics_support import parse_pics, parse_pics_xml -from taglist_and_topology_test_support import (TagProblem, create_device_type_list_for_root, create_device_type_lists, - find_tag_list_problems, find_tree_roots, flat_list_ok, get_all_children, - get_direct_children_of_root, parts_list_cycles, separate_endpoint_types) def get_raw_type_list(): diff --git a/src/python_testing/TestSpecParsingDeviceType.py b/src/python_testing/TestSpecParsingDeviceType.py index 7729ccee8a..a9ee14f12b 100644 --- a/src/python_testing/TestSpecParsingDeviceType.py +++ b/src/python_testing/TestSpecParsingDeviceType.py @@ -18,12 +18,12 @@ import chip.clusters as Clusters from chip.clusters import Attribute +from chip.testing.conformance import conformance_allowed +from chip.testing.matter_testing import MatterBaseTest, default_matter_test_main +from chip.testing.spec_parsing import build_xml_clusters, build_xml_device_types, parse_single_device_type from chip.tlv import uint -from conformance_support import conformance_allowed from jinja2 import Template -from matter_testing_support import MatterBaseTest, default_matter_test_main from mobly import asserts -from spec_parsing_support import build_xml_clusters, build_xml_device_types, parse_single_device_type from TC_DeviceConformance import DeviceConformanceTests diff --git a/src/python_testing/TestSpecParsingSupport.py b/src/python_testing/TestSpecParsingSupport.py index 4e0171b077..b4c908c232 100644 --- a/src/python_testing/TestSpecParsingSupport.py +++ b/src/python_testing/TestSpecParsingSupport.py @@ -15,17 +15,16 @@ # limitations under the License. # -import os import xml.etree.ElementTree as ElementTree import chip.clusters as Clusters import jinja2 -from global_attribute_ids import GlobalAttributeIds -from matter_testing_support import MatterBaseTest, ProblemNotice, default_matter_test_main +from chip.testing.global_attribute_ids import GlobalAttributeIds +from chip.testing.matter_testing import MatterBaseTest, ProblemNotice, default_matter_test_main +from chip.testing.spec_parsing import (ClusterParser, DataModelLevel, PrebuiltDataModelDirectory, SpecParsingException, XmlCluster, + add_cluster_data_from_xml, build_xml_clusters, check_clusters_for_unknown_commands, + combine_derived_clusters_with_base, get_data_model_directory) from mobly import asserts -from spec_parsing_support import (ClusterParser, PrebuiltDataModelDirectory, SpecParsingException, XmlCluster, - add_cluster_data_from_xml, build_xml_clusters, check_clusters_for_unknown_commands, - combine_derived_clusters_with_base) # TODO: improve the test coverage here # https://github.com/project-chip/connectedhomeip/issues/30958 @@ -272,10 +271,10 @@ def test_build_xml_override(self): asserts.assert_equal(set(one_four_clusters.keys())-set(tot_xml_clusters.keys()), set(), "There are some 1.4 clusters that are not included in the TOT spec") - str_path = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), - '..', '..', 'data_model', '1.4', 'clusters')) + str_path = get_data_model_directory(PrebuiltDataModelDirectory.k1_4, DataModelLevel.kCluster) string_override_check, problems = build_xml_clusters(str_path) - asserts.assert_equal(string_override_check.keys(), self.spec_xml_clusters.keys(), "Mismatched cluster generation") + + asserts.assert_count_equal(string_override_check.keys(), self.spec_xml_clusters.keys(), "Mismatched cluster generation") with asserts.assert_raises(SpecParsingException): build_xml_clusters("baddir") diff --git a/src/python_testing/TestTimeSyncTrustedTimeSource.py b/src/python_testing/TestTimeSyncTrustedTimeSource.py index 2f4c9a1f55..50bca6f3da 100644 --- a/src/python_testing/TestTimeSyncTrustedTimeSource.py +++ b/src/python_testing/TestTimeSyncTrustedTimeSource.py @@ -18,7 +18,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts # We don't have a good pipe between the c++ enums in CommissioningDelegate and python diff --git a/src/python_testing/TestUnitTestingErrorPath.py b/src/python_testing/TestUnitTestingErrorPath.py index 70d7b966ac..872f1fa930 100644 --- a/src/python_testing/TestUnitTestingErrorPath.py +++ b/src/python_testing/TestUnitTestingErrorPath.py @@ -38,7 +38,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts """ Integration test for error path returns via the UnitTesting cluster. diff --git a/src/python_testing/drlk_2_x_common.py b/src/python_testing/drlk_2_x_common.py index 92c0ab23ce..cdd1382292 100644 --- a/src/python_testing/drlk_2_x_common.py +++ b/src/python_testing/drlk_2_x_common.py @@ -23,7 +23,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import type_matches +from chip.testing.matter_testing import type_matches from mobly import asserts diff --git a/src/python_testing/execute_python_tests.py b/src/python_testing/execute_python_tests.py index 4e678211c5..34a391873b 100644 --- a/src/python_testing/execute_python_tests.py +++ b/src/python_testing/execute_python_tests.py @@ -53,7 +53,7 @@ def main(search_directory, env_file): # Define the base command to run tests base_command = os.path.join(chip_root, "scripts/tests/run_python_test.py") - # Define the files and patterns to exclude + # Define the test python script files and patterns to exclude excluded_patterns = { "MinimalRepresentation.py", # Code/Test not being used or not shared code for any other tests "TC_CNET_4_4.py", # It has no CI execution block, is not executed in CI @@ -84,14 +84,6 @@ def main(search_directory, env_file): "hello_test.py", # Is a template for tests "test_plan_support.py", # Shared code for TC_*, not a standalone test "test_plan_table_generator.py", # Code/Test not being used or not shared code for any other tests - "basic_composition_support.py", # Test support/shared code script, not a standalone test - "choice_conformance_support.py", # Test support/shared code script, not a standalone test - "conformance_support.py", # Test support/shared code script, not a standalone test - "global_attribute_ids.py", # Test support/shared code script, not a standalone test - "matter_testing_support.py", # Test support/shared code script, not a standalone test - "pics_support.py", # Test support/shared code script, not a standalone test - "spec_parsing_support.py", # Test support/shared code script, not a standalone test - "taglist_and_topology_test_support.py" # Test support/shared code script, not a standalone test } # Get all .py files in the directory diff --git a/src/python_testing/hello_external_runner.py b/src/python_testing/hello_external_runner.py index 5f00eeb287..64af55ce07 100755 --- a/src/python_testing/hello_external_runner.py +++ b/src/python_testing/hello_external_runner.py @@ -23,8 +23,8 @@ from multiprocessing import Process from multiprocessing.managers import BaseManager +from chip.testing.matter_testing import MatterTestConfig, get_test_info, run_tests from hello_test import HelloTest -from matter_testing_support import MatterTestConfig, get_test_info, run_tests try: from matter_yamltests.hooks import TestRunnerHooks diff --git a/src/python_testing/hello_test.py b/src/python_testing/hello_test.py index 0793ee3b10..2d910b1e52 100644 --- a/src/python_testing/hello_test.py +++ b/src/python_testing/hello_test.py @@ -38,7 +38,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/matter_testing_infrastructure/BUILD.gn b/src/python_testing/matter_testing_infrastructure/BUILD.gn index 41bbcef22b..19c7aee68d 100644 --- a/src/python_testing/matter_testing_infrastructure/BUILD.gn +++ b/src/python_testing/matter_testing_infrastructure/BUILD.gn @@ -18,7 +18,6 @@ import("//build_overrides/chip.gni") import("//build_overrides/pigweed.gni") import("$dir_pw_build/python.gni") -# Python package for CHIP testing support. pw_python_package("chip-testing") { setup = [ "setup.py", @@ -31,7 +30,15 @@ pw_python_package("chip-testing") { sources = [ "chip/testing/__init__.py", "chip/testing/apps.py", + "chip/testing/basic_composition.py", + "chip/testing/choice_conformance.py", + "chip/testing/conformance.py", + "chip/testing/global_attribute_ids.py", + "chip/testing/matter_testing.py", "chip/testing/metadata.py", + "chip/testing/pics.py", + "chip/testing/spec_parsing.py", + "chip/testing/taglist_and_topology_test.py", "chip/testing/tasks.py", ] diff --git a/src/python_testing/matter_testing_infrastructure/chip/testing/apps.py b/src/python_testing/matter_testing_infrastructure/chip/testing/apps.py index af56efc3d5..3b21a1c050 100644 --- a/src/python_testing/matter_testing_infrastructure/chip/testing/apps.py +++ b/src/python_testing/matter_testing_infrastructure/chip/testing/apps.py @@ -16,7 +16,7 @@ import signal import tempfile -from .tasks import Subprocess +from chip.testing.tasks import Subprocess class AppServerSubprocess(Subprocess): diff --git a/src/python_testing/basic_composition_support.py b/src/python_testing/matter_testing_infrastructure/chip/testing/basic_composition.py similarity index 100% rename from src/python_testing/basic_composition_support.py rename to src/python_testing/matter_testing_infrastructure/chip/testing/basic_composition.py diff --git a/src/python_testing/choice_conformance_support.py b/src/python_testing/matter_testing_infrastructure/chip/testing/choice_conformance.py similarity index 93% rename from src/python_testing/choice_conformance_support.py rename to src/python_testing/matter_testing_infrastructure/chip/testing/choice_conformance.py index 58d37bf101..7e7775d555 100644 --- a/src/python_testing/choice_conformance_support.py +++ b/src/python_testing/matter_testing_infrastructure/chip/testing/choice_conformance.py @@ -1,8 +1,8 @@ +from chip.testing.conformance import Choice, ConformanceDecisionWithChoice +from chip.testing.global_attribute_ids import GlobalAttributeIds +from chip.testing.matter_testing import AttributePathLocation, ProblemNotice, ProblemSeverity +from chip.testing.spec_parsing import XmlCluster from chip.tlv import uint -from conformance_support import Choice, ConformanceDecisionWithChoice -from global_attribute_ids import GlobalAttributeIds -from matter_testing_support import AttributePathLocation, ProblemNotice, ProblemSeverity -from spec_parsing_support import XmlCluster class ChoiceConformanceProblemNotice(ProblemNotice): diff --git a/src/python_testing/conformance_support.py b/src/python_testing/matter_testing_infrastructure/chip/testing/conformance.py similarity index 100% rename from src/python_testing/conformance_support.py rename to src/python_testing/matter_testing_infrastructure/chip/testing/conformance.py diff --git a/src/python_testing/global_attribute_ids.py b/src/python_testing/matter_testing_infrastructure/chip/testing/global_attribute_ids.py similarity index 100% rename from src/python_testing/global_attribute_ids.py rename to src/python_testing/matter_testing_infrastructure/chip/testing/global_attribute_ids.py diff --git a/src/python_testing/matter_testing_support.py b/src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py similarity index 99% rename from src/python_testing/matter_testing_support.py rename to src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py index 2e153a37de..2d23a9f84b 100644 --- a/src/python_testing/matter_testing_support.py +++ b/src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py @@ -65,12 +65,12 @@ from chip.interaction_model import InteractionModelError, Status from chip.setup_payload import SetupPayload from chip.storage import PersistentStorage +from chip.testing.global_attribute_ids import GlobalAttributeIds +from chip.testing.pics import read_pics_from_file from chip.tracing import TracingContext -from global_attribute_ids import GlobalAttributeIds from mobly import asserts, base_test, signals, utils from mobly.config_parser import ENV_MOBLY_LOGPATH, TestRunConfig from mobly.test_runner import TestRunner -from pics_support import read_pics_from_file try: from matter_yamltests.hooks import TestRunnerHooks @@ -2278,7 +2278,7 @@ def default_matter_test_main(): In this case, only one test class in a test script is allowed. To make your test script executable, add the following to your file: .. code-block:: python - from matter_testing_support.py import default_matter_test_main + from chip.testing.matter_testing.py import default_matter_test_main ... if __name__ == '__main__': default_matter_test_main.main() diff --git a/src/python_testing/pics_support.py b/src/python_testing/matter_testing_infrastructure/chip/testing/pics.py similarity index 100% rename from src/python_testing/pics_support.py rename to src/python_testing/matter_testing_infrastructure/chip/testing/pics.py diff --git a/src/python_testing/spec_parsing_support.py b/src/python_testing/matter_testing_infrastructure/chip/testing/spec_parsing.py similarity index 95% rename from src/python_testing/spec_parsing_support.py rename to src/python_testing/matter_testing_infrastructure/chip/testing/spec_parsing.py index 75ffea120f..97a13606ea 100644 --- a/src/python_testing/spec_parsing_support.py +++ b/src/python_testing/matter_testing_infrastructure/chip/testing/spec_parsing.py @@ -26,14 +26,14 @@ from typing import Callable, Optional import chip.clusters as Clusters -import conformance_support +import chip.testing.conformance as conformance_support +from chip.testing.conformance import (OPTIONAL_CONFORM, TOP_LEVEL_CONFORMANCE_TAGS, ConformanceDecision, ConformanceException, + ConformanceParseParameters, feature, is_disallowed, mandatory, optional, or_operation, + parse_callable_from_xml, parse_device_type_callable_from_xml) +from chip.testing.global_attribute_ids import GlobalAttributeIds +from chip.testing.matter_testing import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, DeviceTypePathLocation, + EventPathLocation, FeaturePathLocation, ProblemNotice, ProblemSeverity) from chip.tlv import uint -from conformance_support import (OPTIONAL_CONFORM, TOP_LEVEL_CONFORMANCE_TAGS, ConformanceDecision, ConformanceException, - ConformanceParseParameters, feature, is_disallowed, mandatory, optional, or_operation, - parse_callable_from_xml, parse_device_type_callable_from_xml) -from global_attribute_ids import GlobalAttributeIds -from matter_testing_support import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, DeviceTypePathLocation, - EventPathLocation, FeaturePathLocation, ProblemNotice, ProblemSeverity) _PRIVILEGE_STR = { None: "N/A", @@ -518,19 +518,36 @@ class DataModelLevel(str, Enum): kDeviceType = 'device_types' -def _get_data_model_directory(data_model_directory: typing.Union[PrebuiltDataModelDirectory, str], data_model_level: DataModelLevel) -> str: +def _get_data_model_root() -> str: + """Attempts to find ${CHIP_ROOT}/data_model or equivalent.""" + + # Since this class is generally in a module, we have to rely on being bootstrapped or + # we use CWD if we cannot + choices = [os.getcwd()] + + if 'PW_PROJECT_ROOT' in os.environ: + choices.insert(0, os.environ['PW_PROJECT_ROOT']) + + for c in choices: + data_model_path = os.path.join(c, 'data_model') + if os.path.exists(os.path.join(data_model_path, 'master', 'scraper_version')): + return data_model_path + raise FileNotFoundError('Cannot find a CHIP_ROOT/data_model path. Tried %r as prefixes.' % choices) + + +def get_data_model_directory(data_model_directory: typing.Union[PrebuiltDataModelDirectory, str], data_model_level: DataModelLevel) -> str: if data_model_directory == PrebuiltDataModelDirectory.k1_3: - return os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'data_model', '1.3', data_model_level) + return os.path.join(_get_data_model_root(), '1.3', data_model_level) elif data_model_directory == PrebuiltDataModelDirectory.k1_4: - return os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'data_model', '1.4', data_model_level) + return os.path.join(_get_data_model_root(), '1.4', data_model_level) elif data_model_directory == PrebuiltDataModelDirectory.kMaster: - return os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'data_model', 'master', data_model_level) + return os.path.join(_get_data_model_root(), 'master', data_model_level) else: return data_model_directory def build_xml_clusters(data_model_directory: typing.Union[PrebuiltDataModelDirectory, str] = PrebuiltDataModelDirectory.k1_4) -> tuple[dict[uint, XmlCluster], list[ProblemNotice]]: - dir = _get_data_model_directory(data_model_directory, DataModelLevel.kCluster) + dir = get_data_model_directory(data_model_directory, DataModelLevel.kCluster) clusters: dict[int, XmlCluster] = {} pure_base_clusters: dict[str, XmlCluster] = {} @@ -777,7 +794,7 @@ def parse_single_device_type(root: ElementTree.Element) -> tuple[list[ProblemNot def build_xml_device_types(data_model_directory: typing.Union[PrebuiltDataModelDirectory, str] = PrebuiltDataModelDirectory.k1_4) -> tuple[dict[int, XmlDeviceType], list[ProblemNotice]]: - dir = _get_data_model_directory(data_model_directory, DataModelLevel.kDeviceType) + dir = get_data_model_directory(data_model_directory, DataModelLevel.kDeviceType) device_types: dict[int, XmlDeviceType] = {} problems = [] for xml in glob.glob(f"{dir}/*.xml"): diff --git a/src/python_testing/taglist_and_topology_test_support.py b/src/python_testing/matter_testing_infrastructure/chip/testing/taglist_and_topology_test.py similarity index 100% rename from src/python_testing/taglist_and_topology_test_support.py rename to src/python_testing/matter_testing_infrastructure/chip/testing/taglist_and_topology_test.py diff --git a/src/python_testing/post_certification_tests/production_device_checks.py b/src/python_testing/post_certification_tests/production_device_checks.py index e4262a09e7..b8e567f76a 100644 --- a/src/python_testing/post_certification_tests/production_device_checks.py +++ b/src/python_testing/post_certification_tests/production_device_checks.py @@ -59,15 +59,15 @@ os.path.join(os.path.dirname(__file__), '..', '..', '..')) try: - from basic_composition_support import BasicCompositionTests - from matter_testing_support import (MatterBaseTest, MatterStackState, MatterTestConfig, TestStep, async_test_body, - run_tests_no_exit) + from chip.testing.basic_composition import BasicCompositionTests + from chip.testing.matter_testing import (MatterBaseTest, MatterStackState, MatterTestConfig, TestStep, async_test_body, + run_tests_no_exit) except ImportError: sys.path.append(os.path.abspath( os.path.join(os.path.dirname(__file__), '..'))) - from basic_composition_support import BasicCompositionTests - from matter_testing_support import (MatterBaseTest, MatterStackState, MatterTestConfig, TestStep, async_test_body, - run_tests_no_exit) + from chip.testing.basic_composition import BasicCompositionTests + from chip.testing.matter_testing import (MatterBaseTest, MatterStackState, MatterTestConfig, TestStep, async_test_body, + run_tests_no_exit) try: import fetch_paa_certs_from_dcl diff --git a/src/python_testing/test_plan_table_generator.py b/src/python_testing/test_plan_table_generator.py index c972116f34..b38f6f94df 100755 --- a/src/python_testing/test_plan_table_generator.py +++ b/src/python_testing/test_plan_table_generator.py @@ -22,7 +22,7 @@ from pathlib import Path import click -from matter_testing_support import MatterTestConfig, generate_mobly_test_config +from chip.testing.matter_testing import MatterTestConfig, generate_mobly_test_config def indent_multiline(multiline: str, num_spaces: int) -> str: diff --git a/src/python_testing/test_testing/MockTestRunner.py b/src/python_testing/test_testing/MockTestRunner.py index 2d0afb8a5c..6c9bc1c088 100644 --- a/src/python_testing/test_testing/MockTestRunner.py +++ b/src/python_testing/test_testing/MockTestRunner.py @@ -22,13 +22,7 @@ from unittest.mock import MagicMock from chip.clusters import Attribute - -try: - from matter_testing_support import MatterStackState, MatterTestConfig, run_tests_no_exit -except ImportError: - sys.path.append(os.path.abspath( - os.path.join(os.path.dirname(__file__), '..'))) - from matter_testing_support import MatterStackState, MatterTestConfig, run_tests_no_exit +from chip.testing.matter_testing import MatterStackState, MatterTestConfig, run_tests_no_exit class AsyncMock(MagicMock): @@ -56,7 +50,15 @@ def __init__(self, filename: str, classname: str, test: str, endpoint: int = Non def set_test(self, filename: str, classname: str, test: str): self.test = test self.config.tests = [self.test] - module = importlib.import_module(Path(os.path.basename(filename)).stem) + + module_name = Path(os.path.basename(filename)).stem + + try: + module = importlib.import_module(module_name) + except ModuleNotFoundError: + sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) + module = importlib.import_module(module_name) + self.test_class = getattr(module, classname) def set_test_config(self, test_config: MatterTestConfig = MatterTestConfig()): diff --git a/src/python_testing/test_testing/TestDecorators.py b/src/python_testing/test_testing/TestDecorators.py index 82b49eddd8..ce32518b71 100644 --- a/src/python_testing/test_testing/TestDecorators.py +++ b/src/python_testing/test_testing/TestDecorators.py @@ -25,23 +25,13 @@ # # You will get step_* calls as appropriate in between the test_start and test_stop calls if the test is not skipped. -import os import sys +from typing import Optional import chip.clusters as Clusters from chip.clusters import Attribute - -try: - from matter_testing_support import (MatterBaseTest, MatterTestConfig, async_test_body, has_attribute, has_cluster, has_feature, - run_if_endpoint_matches, run_on_singleton_matching_endpoint, should_run_test_on_endpoint) -except ImportError: - sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) - from matter_testing_support import (MatterBaseTest, MatterTestConfig, async_test_body, has_attribute, - has_cluster, has_feature, run_if_endpoint_matches, run_on_singleton_matching_endpoint, - should_run_test_on_endpoint) - -from typing import Optional - +from chip.testing.matter_testing import (MatterBaseTest, MatterTestConfig, async_test_body, has_attribute, has_cluster, has_feature, + run_if_endpoint_matches, run_on_singleton_matching_endpoint, should_run_test_on_endpoint) from mobly import asserts from MockTestRunner import MockTestRunner diff --git a/src/python_testing/test_testing/test_IDM_10_4.py b/src/python_testing/test_testing/test_IDM_10_4.py index 8634e94129..8a30609e94 100644 --- a/src/python_testing/test_testing/test_IDM_10_4.py +++ b/src/python_testing/test_testing/test_IDM_10_4.py @@ -21,13 +21,7 @@ import chip.clusters as Clusters from chip.clusters import Attribute - -try: - from pics_support import parse_pics_xml -except ImportError: - sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) - from pics_support import parse_pics_xml - +from chip.testing.pics import parse_pics_xml from MockTestRunner import MockTestRunner # Reachable attribute is off in the pics file diff --git a/src/python_testing/test_testing/test_TC_CCNTL_2_2.py b/src/python_testing/test_testing/test_TC_CCNTL_2_2.py index bd28023b8e..6a2dc48ba4 100644 --- a/src/python_testing/test_testing/test_TC_CCNTL_2_2.py +++ b/src/python_testing/test_testing/test_TC_CCNTL_2_2.py @@ -30,11 +30,11 @@ from MockTestRunner import AsyncMock, MockTestRunner try: - from matter_testing_support import MatterTestConfig, get_default_paa_trust_store, run_tests_no_exit + from chip.testing.matter_testing import MatterTestConfig, get_default_paa_trust_store, run_tests_no_exit except ImportError: sys.path.append(os.path.abspath( os.path.join(os.path.dirname(__file__), '..'))) - from matter_testing_support import MatterTestConfig, get_default_paa_trust_store, run_tests_no_exit + from chip.testing.matter_testing import MatterTestConfig, get_default_paa_trust_store, run_tests_no_exit invoke_call_count = 0 event_call_count = 0 diff --git a/src/python_testing/test_testing/test_TC_MCORE_FS_1_1.py b/src/python_testing/test_testing/test_TC_MCORE_FS_1_1.py index d79b412530..ed9f1b3531 100644 --- a/src/python_testing/test_testing/test_TC_MCORE_FS_1_1.py +++ b/src/python_testing/test_testing/test_TC_MCORE_FS_1_1.py @@ -30,11 +30,11 @@ from MockTestRunner import AsyncMock, MockTestRunner try: - from matter_testing_support import MatterTestConfig, get_default_paa_trust_store, run_tests_no_exit + from chip.testing.matter_testing import MatterTestConfig, get_default_paa_trust_store, run_tests_no_exit except ImportError: sys.path.append(os.path.abspath( os.path.join(os.path.dirname(__file__), '..'))) - from matter_testing_support import MatterTestConfig, get_default_paa_trust_store, run_tests_no_exit + from chip.testing.matter_testing import MatterTestConfig, get_default_paa_trust_store, run_tests_no_exit invoke_call_count = 0 event_call_count = 0 diff --git a/src/python_testing/test_testing/test_TC_SC_7_1.py b/src/python_testing/test_testing/test_TC_SC_7_1.py index 3b1b6a5b1c..96dced72f9 100644 --- a/src/python_testing/test_testing/test_TC_SC_7_1.py +++ b/src/python_testing/test_testing/test_TC_SC_7_1.py @@ -16,21 +16,14 @@ # limitations under the License. # -import os import sys from random import randbytes import chip.clusters as Clusters from chip.clusters import Attribute +from chip.testing.matter_testing import MatterTestConfig from MockTestRunner import MockTestRunner -try: - from matter_testing_support import MatterTestConfig -except ImportError: - sys.path.append(os.path.abspath( - os.path.join(os.path.dirname(__file__), '..'))) - from matter_testing_support import MatterTestConfig - def read_trusted_root(filled: bool) -> Attribute.AsyncReadTransaction.ReadResponse: opcreds = Clusters.OperationalCredentials diff --git a/src/tools/PICS-generator/PICSGenerator.py b/src/tools/PICS-generator/PICSGenerator.py index acdeb676ed..6cfb95803a 100644 --- a/src/tools/PICS-generator/PICSGenerator.py +++ b/src/tools/PICS-generator/PICSGenerator.py @@ -25,10 +25,10 @@ from pics_generator_support import map_cluster_name_to_pics_xml, pics_xml_file_list_loader from rich.console import Console -# Add the path to python_testing folder, in order to be able to import from matter_testing_support +# Add the path to python_testing folder, in order to be able to import from chip.testing.matter_testing sys.path.append(os.path.abspath(sys.path[0] + "/../../python_testing")) -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main # noqa: E402 -from spec_parsing_support import build_xml_clusters # noqa: E402 +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main # noqa: E402 +from chip.testing.spec_parsing import build_xml_clusters # noqa: E402 console = None xml_clusters = None diff --git a/src/tools/PICS-generator/XMLPICSValidator.py b/src/tools/PICS-generator/XMLPICSValidator.py index d728a61991..5fd170463d 100644 --- a/src/tools/PICS-generator/XMLPICSValidator.py +++ b/src/tools/PICS-generator/XMLPICSValidator.py @@ -23,7 +23,7 @@ # Add the path to python_testing folder, in order to be able to import from matter_testing_support sys.path.append(os.path.abspath(sys.path[0] + "/../../python_testing")) -from spec_parsing_support import build_xml_clusters # noqa: E402 +from chip.testing.spec_parsing import build_xml_clusters # noqa: E402 parser = argparse.ArgumentParser() parser.add_argument('--pics-template', required=True) diff --git a/src/tools/device-graph/matter-device-graph.py b/src/tools/device-graph/matter-device-graph.py index 16a2e6dbb0..597468624d 100644 --- a/src/tools/device-graph/matter-device-graph.py +++ b/src/tools/device-graph/matter-device-graph.py @@ -23,9 +23,9 @@ import graphviz from rich.console import Console -# Add the path to python_testing folder, in order to be able to import from matter_testing_support +# Add the path to python_testing folder, in order to be able to import from chip.testing.matter_testing sys.path.append(os.path.abspath(sys.path[0] + "/../../python_testing")) -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main # noqa: E402 +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main # noqa: E402 console = None maxClusterNameLength = 30 From 3e55a217367197bd47b7b2ff1c82e2a76e482e8d Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Fri, 11 Oct 2024 17:48:42 +0200 Subject: [PATCH 096/127] [darwin-framework-tool] Add missing autoreleasepool before checking for leaks (#36038) --- examples/darwin-framework-tool/debug/LeakChecker.mm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/darwin-framework-tool/debug/LeakChecker.mm b/examples/darwin-framework-tool/debug/LeakChecker.mm index 72a441420a..25f4f1eadc 100644 --- a/examples/darwin-framework-tool/debug/LeakChecker.mm +++ b/examples/darwin-framework-tool/debug/LeakChecker.mm @@ -60,9 +60,11 @@ - (BOOL)hasMemoryLeaks int ConditionalLeaksCheck(int exitCode) { #ifdef DFT_ENABLE_LEAK_CHECKING - auto * leakChecker = [[LeakChecker alloc] init]; - if ([leakChecker hasMemoryLeaks]) { - return EXIT_FAILURE; + @autoreleasepool { + auto * leakChecker = [[LeakChecker alloc] init]; + if ([leakChecker hasMemoryLeaks]) { + return EXIT_FAILURE; + } } #endif // DFT_ENABLE_LEAK_CHECKING From 8c0f11a6ea94a7b46343f56e5c9a1c729a522ce4 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Fri, 11 Oct 2024 17:48:56 +0200 Subject: [PATCH 097/127] Matter framework safe conversion for known enum (#36015) * [Matter.framework] MTRConversion.h: error: arithmetic between enumeration type 'chip::(unnamed enum at src/lib/support/TimeUtils.h:99:1)' and floating-point type 'NSTimeInterval' (aka 'double') [-Werror,-Wenum-float-conversion] * [Matter.framework] MTRConversion.mm: error: arithmetic between floating-point type 'NSTimeInterval' (aka 'double') and enumeration type 'chip::(unnamed enum at src/lib/support/TimeUtils.h:32:1)' [-Werror,-Wenum-float-conversion] * [Matter.framework] MTRBaseDevice.mm: error: arithmetic between floating-point type 'NSTimeInterval' (aka 'double') and enumeration type 'chip::(unnamed enum at lib/support/TimeUtils.h:32:1)' [-Werror,-Wenum-float-conversion --- src/darwin/Framework/CHIP/MTRBaseDevice.mm | 2 +- src/darwin/Framework/CHIP/MTRConversion.h | 3 ++- src/darwin/Framework/CHIP/MTRConversion.mm | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRBaseDevice.mm b/src/darwin/Framework/CHIP/MTRBaseDevice.mm index 89f7aab425..f21fc5bb8d 100644 --- a/src/darwin/Framework/CHIP/MTRBaseDevice.mm +++ b/src/darwin/Framework/CHIP/MTRBaseDevice.mm @@ -1894,7 +1894,7 @@ NSTimeInterval MTRTimeIntervalForEventTimestampValue(uint64_t timeValue) uint64_t eventTimestampValueSeconds = timeValue / chip::kMillisecondsPerSecond; uint64_t eventTimestampValueRemainderMilliseconds = timeValue % chip::kMillisecondsPerSecond; NSTimeInterval eventTimestampValueRemainder - = NSTimeInterval(eventTimestampValueRemainderMilliseconds) / chip::kMillisecondsPerSecond; + = NSTimeInterval(eventTimestampValueRemainderMilliseconds / static_cast(chip::kMillisecondsPerSecond)); NSTimeInterval eventTimestampValue = eventTimestampValueSeconds + eventTimestampValueRemainder; return eventTimestampValue; diff --git a/src/darwin/Framework/CHIP/MTRConversion.h b/src/darwin/Framework/CHIP/MTRConversion.h index b0cf1afea4..6f722d04d5 100644 --- a/src/darwin/Framework/CHIP/MTRConversion.h +++ b/src/darwin/Framework/CHIP/MTRConversion.h @@ -38,7 +38,8 @@ AsNumber(chip::Optional optional) inline NSDate * MatterEpochSecondsAsDate(uint32_t matterEpochSeconds) { - return [NSDate dateWithTimeIntervalSince1970:(chip::kChipEpochSecondsSinceUnixEpoch + (NSTimeInterval) matterEpochSeconds)]; + const uint64_t interval = static_cast(chip::kChipEpochSecondsSinceUnixEpoch) + matterEpochSeconds; + return [NSDate dateWithTimeIntervalSince1970:(NSTimeInterval) interval]; } template diff --git a/src/darwin/Framework/CHIP/MTRConversion.mm b/src/darwin/Framework/CHIP/MTRConversion.mm index 5e657b9330..3b0b734431 100644 --- a/src/darwin/Framework/CHIP/MTRConversion.mm +++ b/src/darwin/Framework/CHIP/MTRConversion.mm @@ -92,7 +92,7 @@ bool DateToMatterEpochMilliseconds(NSDate * date, uint64_t & matterEpochMillisec bool DateToMatterEpochMicroseconds(NSDate * date, uint64_t & matterEpochMicroseconds) { - uint64_t timeSinceUnixEpoch = static_cast(date.timeIntervalSince1970 * chip::kMicrosecondsPerSecond); + uint64_t timeSinceUnixEpoch = static_cast(date.timeIntervalSince1970 * static_cast(chip::kMicrosecondsPerSecond)); if (timeSinceUnixEpoch < chip::kChipEpochUsSinceUnixEpoch) { // This is a pre-Matter-epoch time, and cannot be represented as an epoch time value. return false; From a712f7743f1e710d7567f505c83944b43da0bcf3 Mon Sep 17 00:00:00 2001 From: mkardous-silabs <84793247+mkardous-silabs@users.noreply.github.com> Date: Fri, 11 Oct 2024 12:12:23 -0400 Subject: [PATCH 098/127] [ICD] Add subscriber request max interval getter (#36021) * Add subscriber request max interval getter * Add unit-test for the SetMaxReportingInterval * Restyled by clang-format * fix conversation error * Restyled by clang-format --------- Co-authored-by: Restyled.io --- src/app/ReadHandler.cpp | 4 +- src/app/ReadHandler.h | 28 +++++- src/app/tests/TestReadInteraction.cpp | 118 ++++++++++++++++++++++++++ 3 files changed, 145 insertions(+), 5 deletions(-) diff --git a/src/app/ReadHandler.cpp b/src/app/ReadHandler.cpp index 43dae0a99f..4794ead97e 100644 --- a/src/app/ReadHandler.cpp +++ b/src/app/ReadHandler.cpp @@ -741,7 +741,9 @@ CHIP_ERROR ReadHandler::ProcessSubscribeRequest(System::PacketBufferHandle && aP ReturnErrorOnFailure(err); ReturnErrorOnFailure(subscribeRequestParser.GetMinIntervalFloorSeconds(&mMinIntervalFloorSeconds)); - ReturnErrorOnFailure(subscribeRequestParser.GetMaxIntervalCeilingSeconds(&mMaxInterval)); + ReturnErrorOnFailure(subscribeRequestParser.GetMaxIntervalCeilingSeconds(&mSubscriberRequestedMaxInterval)); + mMaxInterval = mSubscriberRequestedMaxInterval; + VerifyOrReturnError(mMinIntervalFloorSeconds <= mMaxInterval, CHIP_ERROR_INVALID_ARGUMENT); #if CHIP_CONFIG_ENABLE_ICD_SERVER diff --git a/src/app/ReadHandler.h b/src/app/ReadHandler.h index 1ddcb4ebf0..85976ec6bc 100644 --- a/src/app/ReadHandler.h +++ b/src/app/ReadHandler.h @@ -229,12 +229,31 @@ class ReadHandler : public Messaging::ExchangeDelegate const SingleLinkedListNode * GetEventPathList() const { return mpEventPathList; } const SingleLinkedListNode * GetDataVersionFilterList() const { return mpDataVersionFilterList; } + /** + * @brief Returns the reporting intervals that will used by the ReadHandler for the subscription being requested. + * After the subscription is established, these will be the set reporting intervals and cannot be changed. + * + * @param[out] aMinInterval minimum time delta between two reports for the subscription + * @param[in] aMaxInterval maximum time delta between two reports for the subscription + */ void GetReportingIntervals(uint16_t & aMinInterval, uint16_t & aMaxInterval) const { aMinInterval = mMinIntervalFloorSeconds; aMaxInterval = mMaxInterval; } + /** + * @brief Returns the maximum reporting interval that was initially requested by the subscriber + * This is the same value as the mMaxInterval member if the max interval is not changed by the publisher. + * + * @note If the device is an ICD, the MaxInterval of a subscription is automatically set to a multiple of the IdleModeDuration. + * This function is the only way to get the requested max interval once the OnSubscriptionRequested application callback + * is called. + * + * @return uint16_t subscriber requested maximum reporting interval + */ + inline uint16_t GetSubscriberRequestedMaxInterval() const { return mSubscriberRequestedMaxInterval; } + CHIP_ERROR SetMinReportingIntervalForTests(uint16_t aMinInterval) { VerifyOrReturnError(IsIdle(), CHIP_ERROR_INCORRECT_STATE); @@ -254,7 +273,7 @@ class ReadHandler : public Messaging::ExchangeDelegate { VerifyOrReturnError(IsIdle(), CHIP_ERROR_INCORRECT_STATE); VerifyOrReturnError(mMinIntervalFloorSeconds <= aMaxInterval, CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrReturnError(aMaxInterval <= std::max(GetPublisherSelectedIntervalLimit(), mMaxInterval), + VerifyOrReturnError(aMaxInterval <= std::max(GetPublisherSelectedIntervalLimit(), mSubscriberRequestedMaxInterval), CHIP_ERROR_INVALID_ARGUMENT); mMaxInterval = aMaxInterval; return CHIP_NO_ERROR; @@ -542,9 +561,10 @@ class ReadHandler : public Messaging::ExchangeDelegate // engine, the "oldest" subscription is the subscription with the smallest generation. uint64_t mTransactionStartGeneration = 0; - SubscriptionId mSubscriptionId = 0; - uint16_t mMinIntervalFloorSeconds = 0; - uint16_t mMaxInterval = 0; + SubscriptionId mSubscriptionId = 0; + uint16_t mMinIntervalFloorSeconds = 0; + uint16_t mMaxInterval = 0; + uint16_t mSubscriberRequestedMaxInterval = 0; EventNumber mEventMin = 0; diff --git a/src/app/tests/TestReadInteraction.cpp b/src/app/tests/TestReadInteraction.cpp index f8f192d92e..5baab570f6 100644 --- a/src/app/tests/TestReadInteraction.cpp +++ b/src/app/tests/TestReadInteraction.cpp @@ -343,6 +343,7 @@ class TestReadInteraction : public chip::Test::AppContext void TestReadClient(); void TestReadUnexpectedSubscriptionId(); void TestReadHandler(); + void TestReadHandlerSetMaxReportingInterval(); void TestReadClientGenerateAttributePathList(); void TestReadClientGenerateInvalidAttributePathList(); void TestReadClientInvalidReport(); @@ -568,6 +569,115 @@ TEST_F_FROM_FIXTURE(TestReadInteraction, TestReadHandler) EXPECT_EQ(GetExchangeManager().GetNumActiveExchanges(), 0u); } +TEST_F_FROM_FIXTURE(TestReadInteraction, TestReadHandlerSetMaxReportingInterval) +{ + System::PacketBufferTLVWriter writer; + System::PacketBufferHandle subscribeRequestbuf = System::PacketBufferHandle::New(System::PacketBuffer::kMaxSize); + SubscribeRequestMessage::Builder subscribeRequestBuilder; + + auto * engine = chip::app::InteractionModelEngine::GetInstance(); + EXPECT_EQ(engine->Init(&GetExchangeManager(), &GetFabricTable(), gReportScheduler), CHIP_NO_ERROR); + + uint16_t kIntervalInfMinInterval = 119; + uint16_t kMinInterval = 120; + uint16_t kMaxIntervalCeiling = 500; + + Messaging::ExchangeContext * exchangeCtx = NewExchangeToAlice(nullptr, false); + + { + + uint16_t minInterval; + uint16_t maxInterval; + + // Configure ReadHandler + ReadHandler readHandler(*engine, exchangeCtx, chip::app::ReadHandler::InteractionType::Read, gReportScheduler, + CodegenDataModelProviderInstance()); + + writer.Init(std::move(subscribeRequestbuf)); + EXPECT_EQ(subscribeRequestBuilder.Init(&writer), CHIP_NO_ERROR); + + subscribeRequestBuilder.KeepSubscriptions(true); + EXPECT_EQ(subscribeRequestBuilder.GetError(), CHIP_NO_ERROR); + + subscribeRequestBuilder.MinIntervalFloorSeconds(kMinInterval); + EXPECT_EQ(subscribeRequestBuilder.GetError(), CHIP_NO_ERROR); + + subscribeRequestBuilder.MaxIntervalCeilingSeconds(kMaxIntervalCeiling); + EXPECT_EQ(subscribeRequestBuilder.GetError(), CHIP_NO_ERROR); + + AttributePathIBs::Builder & attributePathListBuilder = subscribeRequestBuilder.CreateAttributeRequests(); + EXPECT_EQ(attributePathListBuilder.GetError(), CHIP_NO_ERROR); + + AttributePathIB::Builder & attributePathBuilder = attributePathListBuilder.CreatePath(); + EXPECT_EQ(attributePathListBuilder.GetError(), CHIP_NO_ERROR); + + attributePathBuilder.Node(1).Endpoint(2).Cluster(3).Attribute(4).ListIndex(5).EndOfAttributePathIB(); + EXPECT_EQ(attributePathBuilder.GetError(), CHIP_NO_ERROR); + + attributePathListBuilder.EndOfAttributePathIBs(); + EXPECT_EQ(attributePathListBuilder.GetError(), CHIP_NO_ERROR); + + subscribeRequestBuilder.IsFabricFiltered(false).EndOfSubscribeRequestMessage(); + EXPECT_EQ(subscribeRequestBuilder.GetError(), CHIP_NO_ERROR); + + EXPECT_EQ(subscribeRequestBuilder.GetError(), CHIP_NO_ERROR); + EXPECT_EQ(writer.Finalize(&subscribeRequestbuf), CHIP_NO_ERROR); + + EXPECT_EQ(readHandler.ProcessSubscribeRequest(std::move(subscribeRequestbuf)), CHIP_NO_ERROR); + +#if CHIP_CONFIG_ENABLE_ICD_SERVER + // When an ICD build, the default behavior is to select the IdleModeDuration as MaxInterval + kMaxIntervalCeiling = readHandler.GetPublisherSelectedIntervalLimit(); +#endif + // Try to change the MaxInterval while ReadHandler is active + EXPECT_EQ(readHandler.SetMaxReportingInterval(340), CHIP_ERROR_INCORRECT_STATE); + + readHandler.GetReportingIntervals(minInterval, maxInterval); + EXPECT_EQ(kMaxIntervalCeiling, maxInterval); + // Set ReadHandler to Idle to allow MaxInterval changes + readHandler.MoveToState(ReadHandler::HandlerState::Idle); + + // TC1: MaxInterval < MinIntervalFloor + EXPECT_EQ(readHandler.SetMaxReportingInterval(kIntervalInfMinInterval), CHIP_ERROR_INVALID_ARGUMENT); + + readHandler.GetReportingIntervals(minInterval, maxInterval); + EXPECT_EQ(kMaxIntervalCeiling, maxInterval); + + // TC2: MaxInterval == MinIntervalFloor + EXPECT_EQ(readHandler.SetMaxReportingInterval(kMinInterval), CHIP_NO_ERROR); + + readHandler.GetReportingIntervals(minInterval, maxInterval); + EXPECT_EQ(kMinInterval, maxInterval); + + // TC3: Minterval < MaxInterval < max(GetPublisherSelectedIntervalLimit(), mSubscriberRequestedMaxInterval) + EXPECT_EQ(readHandler.SetMaxReportingInterval(kMaxIntervalCeiling), CHIP_NO_ERROR); + + readHandler.GetReportingIntervals(minInterval, maxInterval); + EXPECT_EQ(kMaxIntervalCeiling, maxInterval); + + // TC4: MaxInterval == Subscriber Requested Max Interval + EXPECT_EQ(readHandler.SetMaxReportingInterval(readHandler.GetSubscriberRequestedMaxInterval()), CHIP_NO_ERROR); + + readHandler.GetReportingIntervals(minInterval, maxInterval); + EXPECT_EQ(readHandler.GetSubscriberRequestedMaxInterval(), maxInterval); + + // TC4: MaxInterval == GetPublisherSelectedIntervalLimit() + EXPECT_EQ(readHandler.SetMaxReportingInterval(readHandler.GetPublisherSelectedIntervalLimit()), CHIP_NO_ERROR); + + readHandler.GetReportingIntervals(minInterval, maxInterval); + EXPECT_EQ(readHandler.GetPublisherSelectedIntervalLimit(), maxInterval); + + // TC5: MaxInterval > max(GetPublisherSelectedIntervalLimit(), mSubscriberRequestedMaxInterval) + EXPECT_EQ(readHandler.SetMaxReportingInterval(std::numeric_limits::max()), CHIP_ERROR_INVALID_ARGUMENT); + + readHandler.GetReportingIntervals(minInterval, maxInterval); + EXPECT_EQ(readHandler.GetPublisherSelectedIntervalLimit(), maxInterval); + } + + engine->Shutdown(); + EXPECT_EQ(GetExchangeManager().GetNumActiveExchanges(), 0u); +} + TEST_F_FROM_FIXTURE(TestReadInteraction, TestReadClientGenerateAttributePathList) { MockInteractionModelApp delegate; @@ -1517,6 +1627,7 @@ TEST_F_FROM_FIXTURE(TestReadInteraction, TestICDProcessSubscribeRequestSupMaxInt EXPECT_EQ(minInterval, kMinInterval); EXPECT_EQ(maxInterval, idleModeDuration); + EXPECT_EQ(kMaxIntervalCeiling, readHandler.GetSubscriberRequestedMaxInterval()); } engine->Shutdown(); @@ -1584,6 +1695,7 @@ TEST_F_FROM_FIXTURE(TestReadInteraction, TestICDProcessSubscribeRequestInfMaxInt EXPECT_EQ(minInterval, kMinInterval); EXPECT_EQ(maxInterval, idleModeDuration); + EXPECT_EQ(kMaxIntervalCeiling, readHandler.GetSubscriberRequestedMaxInterval()); } engine->Shutdown(); @@ -1651,6 +1763,7 @@ TEST_F_FROM_FIXTURE(TestReadInteraction, TestICDProcessSubscribeRequestSupMinInt EXPECT_EQ(minInterval, kMinInterval); EXPECT_EQ(maxInterval, (2 * idleModeDuration)); + EXPECT_EQ(kMaxIntervalCeiling, readHandler.GetSubscriberRequestedMaxInterval()); } engine->Shutdown(); @@ -1716,6 +1829,7 @@ TEST_F_FROM_FIXTURE(TestReadInteraction, TestICDProcessSubscribeRequestMaxMinInt EXPECT_EQ(minInterval, kMinInterval); EXPECT_EQ(maxInterval, kMaxIntervalCeiling); + EXPECT_EQ(kMaxIntervalCeiling, readHandler.GetSubscriberRequestedMaxInterval()); } engine->Shutdown(); @@ -1781,6 +1895,7 @@ TEST_F_FROM_FIXTURE(TestReadInteraction, TestICDProcessSubscribeRequestInvalidId EXPECT_EQ(minInterval, kMinInterval); EXPECT_EQ(maxInterval, kMaxIntervalCeiling); + EXPECT_EQ(kMaxIntervalCeiling, readHandler.GetSubscriberRequestedMaxInterval()); } engine->Shutdown(); @@ -1959,6 +2074,7 @@ TEST_F_FROM_FIXTURE(TestReadInteraction, TestSubscribeRoundtrip) uint16_t minInterval; uint16_t maxInterval; delegate.mpReadHandler->GetReportingIntervals(minInterval, maxInterval); + EXPECT_EQ(readPrepareParams.mMaxIntervalCeilingSeconds, delegate.mpReadHandler->GetSubscriberRequestedMaxInterval()); // Test empty report // Advance monotonic timestamp for min interval to elapse @@ -2028,6 +2144,7 @@ TEST_F_FROM_FIXTURE(TestReadInteraction, TestSubscribeEarlyReport) uint16_t minInterval; uint16_t maxInterval; delegate.mpReadHandler->GetReportingIntervals(minInterval, maxInterval); + EXPECT_EQ(readPrepareParams.mMaxIntervalCeilingSeconds, delegate.mpReadHandler->GetSubscriberRequestedMaxInterval()); EXPECT_EQ(engine->GetNumActiveReadHandlers(ReadHandler::InteractionType::Subscribe), 1u); @@ -2760,6 +2877,7 @@ TEST_F_FROM_FIXTURE(TestReadInteraction, TestSubscribeInvalidAttributePathRoundt uint16_t minInterval; uint16_t maxInterval; delegate.mpReadHandler->GetReportingIntervals(minInterval, maxInterval); + EXPECT_EQ(readPrepareParams.mMaxIntervalCeilingSeconds, delegate.mpReadHandler->GetSubscriberRequestedMaxInterval()); // Advance monotonic timestamp for min interval to elapse gMockClock.AdvanceMonotonic(System::Clock::Seconds16(maxInterval)); From f59864b4d86b1aef43f6d9d9233da5845829454c Mon Sep 17 00:00:00 2001 From: shgutte <102281713+shgutte@users.noreply.github.com> Date: Fri, 11 Oct 2024 22:06:42 +0530 Subject: [PATCH 099/127] [Silabs] Adds refrigerator application (#35433) * Added the refrigerator application * Added Implementation of the application * Added RefrigeratorManager * Added changes for the callback and the attribute update * Added changes fot attribute data type * added changes for the refrigrator UI * Updated the wifi args and open thread files * Added changes for refrigerator UI * Added build fixes * Fixed build errors * Added changes for new zap attributes * Added changes for the readme file * Added date and spelling mistake changes * Added changes for spelling mistake * Added updated zap matter file and removed the commented code * Removed the unwanted services from gn file * Added function header * Updated task name and removed the incorrect data * Added callbacks * Modified the datat type and the removed the callback * Removed unwated changes * Added changes for authors * Restyled by whitespace * Restyled by clang-format * Restyled by gn * Added changes according to comments * Added the WiFi boards in the board list * Update examples/refrigerator-app/silabs/include/CHIPProjectConfig.h Co-authored-by: Rohan Sahay * Update examples/refrigerator-app/silabs/README.md Co-authored-by: Junior Martinez <67972863+jmartinez-silabs@users.noreply.github.com> * Fixed the unint32_t alignment for the * Added changes according to comment * Removing warning * Replaced the SILABS_LOGS with CHIPLog * Corrected the application name * Update examples/refrigerator-app/silabs/README.md Co-authored-by: Junior Martinez <67972863+jmartinez-silabs@users.noreply.github.com> * Update examples/refrigerator-app/silabs/README.md Co-authored-by: Junior Martinez <67972863+jmartinez-silabs@users.noreply.github.com> * Update examples/refrigerator-app/silabs/src/RefrigeratorUI.cpp Co-authored-by: Rohan Sahay * Update examples/refrigerator-app/silabs/src/AppTask.cpp Co-authored-by: Rohan Sahay * Update examples/refrigerator-app/silabs/src/AppTask.cpp Co-authored-by: Rohan Sahay * Update examples/refrigerator-app/silabs/src/AppTask.cpp Co-authored-by: Rohan Sahay * Update examples/refrigerator-app/silabs/src/RefrigeratorManager.cpp Co-authored-by: Rohan Sahay * Update examples/refrigerator-app/silabs/src/AppTask.cpp Co-authored-by: Rohan Sahay * Update examples/refrigerator-app/silabs/src/RefrigeratorManager.cpp Co-authored-by: Rohan Sahay * Update examples/refrigerator-app/silabs/src/RefrigeratorManager.cpp Co-authored-by: Rohan Sahay * Update examples/refrigerator-app/silabs/include/AppTask.h Co-authored-by: Rohan Sahay * Removed commented code * Updated read me for OTA documentation for SiWx917 * Adds changes for refrigerator modes and callbacks * Added chip logs * Updated the error message * Restyled by whitespace * Restyled by clang-format * Updated refrigerator app matter file * Added the changes related to zap file and the mode supported * Restyled by whitespace * Restyled by clang-format * Added changes for Temperature Controller feature Map * Updated featureMap value for matter file * Removed the temperature level * Removed the startup and on mode from attributes * Setting min and max temperature for the controlled cabinet * Removed the Temperature level attribute from the Temperature controller * Removed the min and max temperature * Removed the attribute update for refrigerator and temperature cluster * Added changes for the zap file * Added restyle changes * Updated matter file * Added OTA requester * Added changes for the attribute * Added changes for the zap --------- Co-authored-by: Restyled.io Co-authored-by: Rohan Sahay Co-authored-by: Junior Martinez <67972863+jmartinez-silabs@users.noreply.github.com> --- examples/refrigerator-app/silabs/BUILD.gn | 243 + examples/refrigerator-app/silabs/README.md | 378 ++ .../silabs/build_for_wifi_args.gni | 21 + .../silabs/build_for_wifi_gnfile.gn | 29 + .../refrigerator-app/silabs/build_overrides | 1 + .../silabs/data_model/BUILD.gn | 26 + .../data_model/refrigerator-thread-app.matter | 2000 ++++++++ .../data_model/refrigerator-thread-app.zap | 4311 +++++++++++++++++ .../data_model/refrigerator-wifi-app.matter | 1908 ++++++++ .../data_model/refrigerator-wifi-app.zap | 4216 ++++++++++++++++ .../silabs/include/AppConfig.h | 61 + .../silabs/include/AppEvent.h | 55 + .../refrigerator-app/silabs/include/AppTask.h | 110 + .../silabs/include/CHIPProjectConfig.h | 111 + .../silabs/include/RefrigeratorIcons.h | 218 + .../silabs/include/RefrigeratorManager.h | 74 + .../silabs/include/RefrigeratorUI.h | 40 + ...-and-temperature-controlled-cabinet-mode.h | 76 + .../refrigerator-app/silabs/openthread.gn | 29 + .../refrigerator-app/silabs/openthread.gni | 26 + .../refrigerator-app/silabs/src/AppTask.cpp | 144 + .../silabs/src/RefrigeratorManager.cpp | 141 + .../silabs/src/RefrigeratorUI.cpp | 274 ++ .../silabs/src/ZclCallbacks.cpp | 87 + ...nd-temperature-controlled-cabinet-mode.cpp | 111 + .../silabs/third_party/connectedhomeip | 1 + 26 files changed, 14691 insertions(+) create mode 100644 examples/refrigerator-app/silabs/BUILD.gn create mode 100644 examples/refrigerator-app/silabs/README.md create mode 100644 examples/refrigerator-app/silabs/build_for_wifi_args.gni create mode 100644 examples/refrigerator-app/silabs/build_for_wifi_gnfile.gn create mode 120000 examples/refrigerator-app/silabs/build_overrides create mode 100644 examples/refrigerator-app/silabs/data_model/BUILD.gn create mode 100644 examples/refrigerator-app/silabs/data_model/refrigerator-thread-app.matter create mode 100644 examples/refrigerator-app/silabs/data_model/refrigerator-thread-app.zap create mode 100644 examples/refrigerator-app/silabs/data_model/refrigerator-wifi-app.matter create mode 100644 examples/refrigerator-app/silabs/data_model/refrigerator-wifi-app.zap create mode 100644 examples/refrigerator-app/silabs/include/AppConfig.h create mode 100644 examples/refrigerator-app/silabs/include/AppEvent.h create mode 100644 examples/refrigerator-app/silabs/include/AppTask.h create mode 100644 examples/refrigerator-app/silabs/include/CHIPProjectConfig.h create mode 100644 examples/refrigerator-app/silabs/include/RefrigeratorIcons.h create mode 100644 examples/refrigerator-app/silabs/include/RefrigeratorManager.h create mode 100644 examples/refrigerator-app/silabs/include/RefrigeratorUI.h create mode 100644 examples/refrigerator-app/silabs/include/refrigerator-and-temperature-controlled-cabinet-mode.h create mode 100644 examples/refrigerator-app/silabs/openthread.gn create mode 100644 examples/refrigerator-app/silabs/openthread.gni create mode 100644 examples/refrigerator-app/silabs/src/AppTask.cpp create mode 100644 examples/refrigerator-app/silabs/src/RefrigeratorManager.cpp create mode 100644 examples/refrigerator-app/silabs/src/RefrigeratorUI.cpp create mode 100644 examples/refrigerator-app/silabs/src/ZclCallbacks.cpp create mode 100644 examples/refrigerator-app/silabs/src/refrigerator-and-temperature-controlled-cabinet-mode.cpp create mode 120000 examples/refrigerator-app/silabs/third_party/connectedhomeip diff --git a/examples/refrigerator-app/silabs/BUILD.gn b/examples/refrigerator-app/silabs/BUILD.gn new file mode 100644 index 0000000000..9e63c6c10e --- /dev/null +++ b/examples/refrigerator-app/silabs/BUILD.gn @@ -0,0 +1,243 @@ +# Copyright (c) 2024 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/build.gni") +import("//build_overrides/chip.gni") +import("//build_overrides/efr32_sdk.gni") +import("//build_overrides/pigweed.gni") + +import("${build_root}/config/defaults.gni") +import("${efr32_sdk_build_root}/silabs_executable.gni") + +import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") +import("${chip_root}/src/platform/device.gni") +import("${chip_root}/third_party/silabs/silabs_board.gni") + +if (chip_enable_pw_rpc) { + import("//build_overrides/pigweed.gni") + import("$dir_pw_build/target_types.gni") +} + +assert(current_os == "freertos") + +silabs_project_dir = "${chip_root}/examples/refrigerator-app/silabs" +examples_common_plat_dir = "${chip_root}/examples/platform/silabs" + +if (wifi_soc) { + import("${chip_root}/third_party/silabs/SiWx917_sdk.gni") + examples_plat_dir = "${chip_root}/examples/platform/silabs/SiWx917" +} else { + import("${efr32_sdk_build_root}/efr32_sdk.gni") + examples_plat_dir = "${chip_root}/examples/platform/silabs/efr32" +} + +import("${examples_common_plat_dir}/args.gni") + +declare_args() { + # Dump memory usage at link time. + chip_print_memory_usage = false + + # Enable the temperature sensor + # Some boards do not have a temperature sensor + use_temp_sensor = false +} + +if (wifi_soc) { + siwx917_sdk("sdk") { + sources = [ + "${examples_common_plat_dir}/FreeRTOSConfig.h", + "${silabs_project_dir}/include/CHIPProjectConfig.h", + ] + + include_dirs = [ + "${chip_root}/src/platform/silabs/SiWx917", + "${silabs_project_dir}/include", + "${examples_plat_dir}", + "${chip_root}/src/lib", + "${examples_common_plat_dir}", + ] + + defines = [] + if (chip_enable_pw_rpc) { + defines += [ + "HAL_VCOM_ENABLE=1", + "PW_RPC_ENABLED", + ] + } + } +} else { + efr32_sdk("sdk") { + sources = [ + "${examples_common_plat_dir}/FreeRTOSConfig.h", + "${silabs_project_dir}/include/CHIPProjectConfig.h", + ] + + include_dirs = [ + "${chip_root}/src/platform/silabs/efr32", + "${silabs_project_dir}/include", + "${examples_plat_dir}", + "${chip_root}/src/lib", + "${examples_common_plat_dir}", + ] + + if (use_wf200) { + include_dirs += [ "${examples_plat_dir}/wf200" ] + } + + if (chip_enable_ble_rs911x) { + include_dirs += [ + "${chip_root}/src/platform/silabs/efr32/rs911x", + "${examples_plat_dir}/rs911x", + "${examples_plat_dir}/rs911x/hal", + ] + } + + defines = [] + if (chip_enable_pw_rpc) { + defines += [ + "HAL_VCOM_ENABLE=1", + "PW_RPC_ENABLED", + ] + } + + if (use_temp_sensor) { + include_dirs += [ + "${efr32_sdk_root}/platform/driver/i2cspm/inc", + "${efr32_sdk_root}/app/bluetooth/common/sensor_rht", + "${efr32_sdk_root}/app/bluetooth/common/sensor_rht/config", + "${efr32_sdk_root}/hardware/driver/si70xx/inc", + "${efr32_sdk_root}/app/bluetooth/common/sensor_select", + "${efr32_sdk_root}/platform/common/config", + ] + + defines += [ "USE_TEMP_SENSOR" ] + } + } +} + +silabs_executable("refrigerator_app") { + output_name = "matter-silabs-refrigerator-example.out" + defines = [] + include_dirs = [ + "include", + "${chip_root}/examples/refrigerator-app/refrigerator-common/include", + ] + + sources = [ + "${chip_root}/examples/refrigerator-app/refrigerator-common/src/static-supported-temperature-levels.cpp", + "${examples_common_plat_dir}/main.cpp", + "src/AppTask.cpp", + "src/RefrigeratorManager.cpp", + "src/ZclCallbacks.cpp", + "src/refrigerator-and-temperature-controlled-cabinet-mode.cpp", + ] + + if (use_temp_sensor) { + sources += [ + "${efr32_sdk_root}/hardware/driver/si70xx/src/sl_si70xx.c", + "${efr32_sdk_root}/platform/common/src/sl_status.c", + "${efr32_sdk_root}/platform/driver/i2cspm/src/sl_i2cspm.c", + "${efr32_sdk_root}/platform/emlib/src/em_i2c.c", + "${examples_common_plat_dir}/TemperatureSensor.cpp", + "${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}/autogen/sl_i2cspm_init.c", + ] + } + + if (!disable_lcd) { + sources += [ "src/RefrigeratorUI.cpp" ] + } + + deps = [ + ":sdk", + app_data_model, + ] + + if (wifi_soc) { + deps += [ "${examples_plat_dir}:siwx917-common" ] + } else { + deps += [ "${examples_plat_dir}:efr32-common" ] + } + + if (chip_enable_pw_rpc) { + defines += [ + "PW_RPC_ENABLED", + "PW_RPC_ATTRIBUTE_SERVICE=1", + "PW_RPC_BUTTON_SERVICE=1", + "PW_RPC_DESCRIPTOR_SERVICE=1", + "PW_RPC_DEVICE_SERVICE=1", + ] + + sources += [ + "${chip_root}/examples/common/pigweed/RpcService.cpp", + "${chip_root}/examples/common/pigweed/efr32/PigweedLoggerMutex.cpp", + "${examples_common_plat_dir}/PigweedLogger.cpp", + "${examples_common_plat_dir}/Rpc.cpp", + ] + + deps += [ + "$dir_pw_hdlc:default_addresses", + "$dir_pw_hdlc:rpc_channel_output", + "$dir_pw_stream:sys_io_stream", + "${chip_root}/config/efr32/lib/pw_rpc:pw_rpc", + "${chip_root}/examples/common/pigweed:attributes_service.nanopb_rpc", + "${chip_root}/examples/common/pigweed:button_service.nanopb_rpc", + "${chip_root}/examples/common/pigweed:descriptor_service.nanopb_rpc", + "${chip_root}/examples/common/pigweed:device_service.nanopb_rpc", + ] + + if (wifi_soc) { + deps += [ "${examples_plat_dir}/pw_sys_io:pw_sys_io_siwx917" ] + } else { + deps += [ "${examples_common_plat_dir}/pw_sys_io:pw_sys_io_silabs" ] + } + + deps += pw_build_LINK_DEPS + + include_dirs += [ + "${chip_root}/examples/common", + "${chip_root}/examples/common/pigweed/efr32", + ] + } + + ldscript = "${examples_common_plat_dir}/ldscripts/${silabs_family}.ld" + + inputs = [ ldscript ] + + ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ] + + if (chip_print_memory_usage) { + ldflags += [ + "-Wl,--print-memory-usage", + "-fstack-usage", + ] + } + + # WiFi Settings + if (chip_enable_wifi) { + ldflags += [ + "-Wl,--defsym", + "-Wl,SILABS_WIFI=1", + ] + } + + output_dir = root_out_dir +} + +group("silabs") { + deps = [ ":refrigerator_app" ] +} + +group("default") { + deps = [ ":silabs" ] +} diff --git a/examples/refrigerator-app/silabs/README.md b/examples/refrigerator-app/silabs/README.md new file mode 100644 index 0000000000..3396ee6325 --- /dev/null +++ b/examples/refrigerator-app/silabs/README.md @@ -0,0 +1,378 @@ +# Matter Refrigerator and Temperature Controlled Example + +An example showing the use of CHIP on the Silicon Labs EFR32 MG24 and SiWx917 +Wi-Fi Boards. + +
+ +- [Matter Refrigerator and Temperature Controlled + Example](#matter-refrigerator-and-Temperature -controlled-example) + - [Introduction](#introduction) + - [Building](#building) + - [Flashing the Application](#flashing-the-application) + - [Viewing Logging Output](#viewing-logging-output) + - [Running the Complete Example](#running-the-complete-example) + - [Notes](#notes) + - [OTA Software Update](#ota-software-update) + - [Building options](#building-options) + - [Disabling logging](#disabling-logging) + - [Debug build / release build](#debug-build--release-build) + - [Disabling LCD](#disabling-lcd) + - [KVS maximum entry count](#kvs-maximum-entry-count) + +
+ +> **NOTE:** Silicon Laboratories now maintains a public matter GitHub repo with +> frequent releases thoroughly tested and validated. Developers looking to +> develop matter products with silabs hardware are encouraged to use our latest +> release with added tools and documentation. +> [Silabs Matter Github](https://github.com/SiliconLabs/matter/releases) + +## Introduction + +The Refrigerator and Temperature Controlled example provides a baseline +demonstration of a Temperature Controlled Cabinet device, built using Matter and +the Silicon Labs Simplicity SDK. It can be controlled by a Chip controller over +an Openthread or Wi-Fi network. + +The Refrigerator device can be commissioned over Bluetooth Low Energy (BLE), +where the device and the Chip controller will exchange security information +using the Rendez-vous procedure. For Thread, the Thread Network credentials are +provided to the Refrigerator device, which will then join the Thread network. + +If the LCD is enabled, the LCD on the Silabs WSTK displays a QR Code containing +the needed commissioning information for the BLE connection and starting the +Rendez-vous procedure. Once the device is commissioned, the display shows a +representation of the refrigerator's temperature-controlled state. + +The Refrigerator and Temperature Controlled 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 Silicon Labs platform. + +## Building + +- Download the + [Simplicity Commander](https://www.silabs.com/mcu/programming-options) + command line tool, and ensure that `commander` is your shell search path. + (For Mac OS X, `commander` is located inside + `Commander.app/Contents/MacOS/`.) + +- Download and install a suitable ARM gcc tool chain (For most Host, the + bootstrap already installs the toolchain): + [GNU Arm Embedded Toolchain 12.2 Rel1](https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads) + +- Install some additional tools(likely already present for CHIP developers): + + # Linux + $ sudo apt-get install git ninja-build + + # Mac OS X + $ brew install ninja + +- Supported hardware: + + - > For the latest supported hardware please refer to the + > [Hardware Requirements](https://github.com/SiliconLabs/matter/blob/latest/docs/silabs/general/HARDWARE_REQUIREMENTS.md) + > in the Silicon Labs Matter Github Repo + + Silabs boards : + + - BRD2601B / SLWSTK6000B / Wireless Starter Kit / 2.4GHz@10dBm + - BRD2703A / SLWSTK6000B / Wireless Starter Kit / 2.4GHz@10dBm + - BRD4186A / SLWSTK6006A / Wireless Starter Kit / 2.4GHz@10dBm + - BRD4186C / SLWSTK6006A / Wireless Starter Kit / 2.4GHz@10dBm + - BRD4187A / SLWSTK6006A / Wireless Starter Kit / 2.4GHz@20dBm + - BRD4187C / SLWSTK6006A / Wireless Starter Kit / 2.4GHz@20dBm + - BRD4338A / SLWSTK6006A / Wireless Starter Kit / 2.4GHz@20dBm + - BRD4346A / SLWSTK6006A / Wireless Starter Kit / 2.4GHz@20dBm + +* Build the example application: + + cd ~/connectedhomeip + ./scripts/examples/gn_silabs_example.sh ./examples/refrigerator-app/silabs/ ./out/refrigerator-app BRD4187C + +- To delete generated executable, libraries and object files use: + + $ cd ~/connectedhomeip + $ rm -rf ./out/ + + OR use GN/Ninja directly + + $ cd ~/connectedhomeip/examples/refrigerator-app/silabs + $ git submodule update --init + $ source third_party/connectedhomeip/scripts/activate.sh + $ export SILABS_BOARD=BRD4187C + $ gn gen out/debug + $ ninja -C out/debug + +- To delete generated executable, libraries and object files use: + + $ cd ~/connectedhomeip/examples/refrigerator-app/silabs + $ rm -rf out/ + +* Build the example as Intermittently Connected Device (ICD) + + $ ./scripts/examples/gn_silabs_example.sh ./examples/refrigerator-app/silabs/ ./out/refrigerator-app_ICD BRD4187C --icd + + or use gn as previously mentioned but adding the following arguments: + + $ gn gen out/debug '--args=SILABS_BOARD="BRD4187C" enable_sleepy_device=true chip_openthread_ftd=false' + +* Build the example with pigweed RCP + + $ ./scripts/examples/gn_silabs_example.sh examples/refrigerator-app/silabs/ out/refrigerator_app_rpc BRD4187C 'import("//with_pw_rpc.gni")' + + or use GN/Ninja Directly + + $ cd ~/connectedhomeip/examples/refrigerator-app/silabs + $ git submodule update --init + $ source third_party/connectedhomeip/scripts/activate.sh + $ export SILABS_BOARD=BRD4187C + $ gn gen out/debug --args='import("//with_pw_rpc.gni")' + $ ninja -C out/debug + +For more build options, help is provided when running the build script without +arguments + + ./scripts/examples/gn_silabs_example.sh + +## Flashing the Application + +- On the command line: + + $ cd ~/connectedhomeip/examples/refrigerator-app/silabs + $ python3 out/debug/matter-silabs-refrigerator-example.flash.py + +- Or with the Ozone debugger, just load the .out file. + +All EFR32 boards require a bootloader, see Silicon Labs documentation for more +info. Pre-built bootloader binaries are available in the Assets section of the +Releases page on +[Silabs Matter Github](https://github.com/SiliconLabs/matter/releases) . + +## Viewing Logging Output + +The example application is built to use the SEGGER Real Time Transfer (RTT) +facility for log output. RTT is a feature built-in to the J-Link Interface MCU +on the WSTK development board. It allows bi-directional communication with an +embedded application without the need for a dedicated UART. + +Using the RTT facility requires downloading and installing the _SEGGER J-Link +Software and Documentation Pack_ +([web site](https://www.segger.com/downloads/jlink#J-LinkSoftwareAndDocumentationPack)). + +Alternatively, SEGGER Ozone J-Link debugger can be used to view RTT logs too +after flashing the .out file. + +- Download the J-Link installer by navigating to the appropriate URL and + agreeing to the license agreement. + +- [JLink_Linux_x86_64.deb](https://www.segger.com/downloads/jlink/JLink_Linux_x86_64.deb) +- [JLink_MacOSX.pkg](https://www.segger.com/downloads/jlink/JLink_MacOSX.pkg) + +* Install the J-Link software + + $ cd ~/Downloads + $ sudo dpkg -i JLink_Linux_V*_x86_64.deb + +* In Linux, grant the logged in user the ability to talk to the development + hardware via the linux tty device (/dev/ttyACMx) by adding them to the + dialout group. + + $ sudo usermod -a -G dialout ${USER} + +Once the above is complete, log output can be viewed using the JLinkExe tool in +combination with JLinkRTTClient as follows: + +- Run the JLinkExe tool with arguments to autoconnect to the WSTK board: + + For MG24 use: + + ``` + $ JLinkExe -device EFR32MG24AXXXF1536 -if SWD -speed 4000 -autoconnect 1 + ``` + +- In a second terminal, run the JLinkRTTClient to view logs: + + $ JLinkRTTClient + +## Running the Complete Example + +- It is assumed here that you already have an OpenThread border router + configured and running. If not see the following guide + [Openthread_border_router](https://github.com/project-chip/connectedhomeip/blob/master/docs/guides/openthread_border_router_pi.md) + for more information on how to setup a border router on a raspberryPi. + + Take note that the RCP code is available directly through + [Simplicity Studio 5](https://www.silabs.com/products/development-tools/software/simplicity-studio/simplicity-studio-5) + under File->New->Project Wizard->Examples->Thread : ot-rcp + +- User interface : **LCD** The LCD on Silabs WSTK shows a QR Code. This QR + Code is be scanned by the CHIP Tool app For the Rendez-vous procedure over + BLE + + * On devices that do not have or support the LCD Display like the BRD4166A Thunderboard Sense 2, + a URL can be found in the RTT logs. + + [SVR] Copy/paste the below URL in a browser to see the QR Code: + [SVR] https://project-chip.github.io/connectedhomeip/qrcode.html?data=CH%3AI34NM%20-00%200C9SS0 + + **LED 0** shows the overall state of the device and its connectivity. The + following states are possible: + + - _Short Flash On (50 ms on/950 ms off)_ ; The device is in the + unprovisioned (unpaired) state and is waiting for a commissioning + application to connect. + + - _Rapid Even Flashing_ ; (100 ms on/100 ms off)_ — The device is in the + unprovisioned state and a commissioning application is connected through + Bluetooth LE. + + - _Short Flash Off_ ; (950ms on/50ms off)_ — The device is fully + provisioned, but does not yet have full Thread network or service + connectivity. + + - _Solid On_ ; The device is fully provisioned and has full Thread + network and service connectivity. + + **LED 1** Shows the state of the refrigerator and temperature controlled + cabinet + + - temperature ; No implementation is present. this feature will be available in a future update. + - _Off_ ; No implementation is present. this feature will be available in a future update. + - _Blinking slowly_ ; No implementation is present. this feature will be available in a future update. + - _Blinking quickly_ ; No implementation is present. this feature will be available in a future update. + + **Push Button 0** Function button and factory reset + + - Pressed and release: No implementation is present. this feature will be available in a future update. + + - Pressed and hold for 6 s: Initiates the factory reset of the device. + Releasing the button within the 6-second window cancels the factory reset + procedure. **LEDs** blink in unison when the factory reset procedure is + initiated. + + **Push Button 1** Application button + + - Pressed and release: No implementation is present. this feature will be available in a future update. + + - Press and hold for 3 s: No implementation is present. this feature will be available in a future update. + +* Once the device is provisioned, it will join the Thread network is + established, look for the RTT log + + ``` + [DL] Device Role: CHILD + [DL] Partition Id:0x6A7491B7 + [DL] \_OnPlatformEvent default: event->Type = 32778 + [DL] OpenThread State Changed (Flags: 0x00000001) + [DL] Thread Unicast Addresses: + [DL] 2001:DB8::E1A2:87F1:7D5D:FECA/64 valid preferred + [DL] FDDE:AD00:BEEF::FF:FE00:2402/64 valid preferred rloc + [DL] FDDE:AD00:BEEF:0:383F:5E81:A05A:B168/64 valid preferred + [DL] FE80::D8F2:592E:C109:CF00/64 valid preferred + [DL] LwIP Thread interface addresses updated + [DL] FE80::D8F2:592E:C109:CF00 IPv6 link-local address, preferred) + [DL] FDDE:AD00:BEEF:0:383F:5E81:A05A:B168 Thread mesh-local address, preferred) + [DL] 2001:DB8::E1A2:87F1:7D5D:FECA IPv6 global unicast address, preferred) + ``` + + (you can verify that the device is on the thread network with the command + `router table` using a serial terminal (screen / minicom etc.) on the board + running the refrigerator-app example. You can also get the address list with + the command ipaddr again in the serial terminal ) + + You can provision the Chip device using Chip tool Android or iOS app or + through CLI commands on your OT BR + + The + [CHIPTool](https://github.com/project-chip/connectedhomeip/blob/master/examples/chip-tool/README.md) + can now be used to send ZCL commands to the refrigerator device. For + instance, to set the refrigerator covering lift by percentage: + + ``` + chip-tool pairing ble-thread 1 hex: 20202021 3840 + + ./chip-tool refrigeratoralarm read state 1 1 + + Refrigerator Endpoint Id 1 + + This enpoint support the refrigerator alarm cluster + + ./chip-tool temperaturecontrol read temperature-setpoint 1 2 + + Enpoint for temperaturecontrol is 2 and 3 + + Cold Cabinet Endpoint Id 2 + Freeze Cabinet Endpoint Id 3 + + This enpoint support Temperature control cluster + ``` + + To see the supported refrigerator cluster commands, use: + + ``` + chip-tool refrigeratorandtemperaturecontrolledcabinetmode + chip-tool temperaturecontrol + chip-tool refrigeratoralarm + + ``` + +### Notes + +- Depending on your network settings your router might not provide native ipv6 + addresses to your devices (Border router / PC). If this is the case, you + need to add a static ipv6 addresses on both device and then an ipv6 route to + the border router on your PC + + # On Border Router : + $ sudo ip addr add dev 2002::2/64 + + # On PC (Linux) : + $ sudo ip addr add dev 2002::1/64 + + # Add Ipv6 route on PC (Linux) + $ sudo ip route add /64 via 2002::2 + +## OTA Software Update + +For the description of Software Update process with EFR32 example applications +see +[EFR32 OTA Software Update](../../../docs/guides/silabs_efr32_software_update.md) + +For the description of Software Update process with SiWx917 example applications +see +[SiWx917 OTA Software Update](https://docs.silabs.com/matter/latest/matter-ota/04-ota-software-update-soc) + +## Building options + +All of Silabs's examples within the Matter repo have all the features enabled by +default, as to provide the best end user experience. However some of those +features can easily be toggled on or off. Here is a short list of options : + +### Disabling logging + +chip_progress_logging, chip_detail_logging, chip_automation_logging + + $ ./scripts/examples/gn_silabs_example.sh ./examples/refrigerator-app/silabs ./out/refrigerator-app BRD4164A "chip_detail_logging=false chip_automation_logging=false chip_progress_logging=false" + +### Debug build / release build + +is_debug + + $ ./scripts/examples/gn_silabs_example.sh ./examples/refrigerator-app/silabs ./out/refrigerator-app BRD4164A "is_debug=false" + +### Disabling LCD + +show_qr_code + + $ ./scripts/examples/gn_silabs_example.sh ./examples/refrigerator-app/silabs ./out/refrigerator-app BRD4164A "show_qr_code=false" + +### KVS maximum entry count + +kvs_max_entries + + Set the maximum Kvs entries that can be stored in NVM (Default 75) + Thresholds: 30 <= kvs_max_entries <= 255 + + $ ./scripts/examples/gn_silabs_example.sh ./examples/refrigerator-app/silabs ./out/refrigerator-app BRD4164A kvs_max_entries=50 diff --git a/examples/refrigerator-app/silabs/build_for_wifi_args.gni b/examples/refrigerator-app/silabs/build_for_wifi_args.gni new file mode 100644 index 0000000000..e82cf8be12 --- /dev/null +++ b/examples/refrigerator-app/silabs/build_for_wifi_args.gni @@ -0,0 +1,21 @@ +# Copyright (c) 2024 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import("//build_overrides/chip.gni") +import("${chip_root}/config/standalone/args.gni") + +silabs_sdk_target = get_label_info(":sdk", "label_no_toolchain") +import("${chip_root}/src/platform/silabs/wifi_args.gni") +chip_enable_wifi = true +chip_enable_ota_requestor = true +app_data_model = "${chip_root}/examples/refrigerator-app/silabs/data_model:silabs-refrigerator" diff --git a/examples/refrigerator-app/silabs/build_for_wifi_gnfile.gn b/examples/refrigerator-app/silabs/build_for_wifi_gnfile.gn new file mode 100644 index 0000000000..c3b7b1f036 --- /dev/null +++ b/examples/refrigerator-app/silabs/build_for_wifi_gnfile.gn @@ -0,0 +1,29 @@ +# Copyright (c) 2024 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/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" + chip_device_platform = "SiWx917" + chip_enable_wifi = true + import("//build_for_wifi_args.gni") +} diff --git a/examples/refrigerator-app/silabs/build_overrides b/examples/refrigerator-app/silabs/build_overrides new file mode 120000 index 0000000000..e578e73312 --- /dev/null +++ b/examples/refrigerator-app/silabs/build_overrides @@ -0,0 +1 @@ +../../build_overrides \ No newline at end of file diff --git a/examples/refrigerator-app/silabs/data_model/BUILD.gn b/examples/refrigerator-app/silabs/data_model/BUILD.gn new file mode 100644 index 0000000000..da519c005a --- /dev/null +++ b/examples/refrigerator-app/silabs/data_model/BUILD.gn @@ -0,0 +1,26 @@ +# Copyright (c) 2024 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/chip.gni") +import("${chip_root}/src/app/chip_data_model.gni") +import("${chip_root}/src/platform/device.gni") + +chip_data_model("silabs-refrigerator") { + if (chip_enable_wifi) { + zap_file = "refrigerator-wifi-app.zap" + } else { + zap_file = "refrigerator-thread-app.zap" + } + is_server = true +} diff --git a/examples/refrigerator-app/silabs/data_model/refrigerator-thread-app.matter b/examples/refrigerator-app/silabs/data_model/refrigerator-thread-app.matter new file mode 100644 index 0000000000..96d392547f --- /dev/null +++ b/examples/refrigerator-app/silabs/data_model/refrigerator-thread-app.matter @@ -0,0 +1,2000 @@ +// This IDL was generated automatically by ZAP. +// It is for view/code review purposes only. + +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum AtomicRequestTypeEnum : enum8 { + kBeginWrite = 0; + kCommitWrite = 1; + kRollbackWrite = 2; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; +} + +enum RelativePositionTag : enum8 { + kUnder = 0; + kNextTo = 1; + kAround = 2; + kOn = 3; + kAbove = 4; + kFrontOf = 5; + kBehind = 6; +} + +enum TestGlobalEnum : enum8 { + kSomeValue = 0; + kSomeOtherValue = 1; + kFinalValue = 2; +} + +enum ThreeLevelAutoEnum : enum8 { + kLow = 0; + kMedium = 1; + kHigh = 2; + kAutomatic = 3; +} + +bitmap TestGlobalBitmap : bitmap32 { + kFirstBit = 0x1; + kSecondBit = 0x2; +} + +struct TestGlobalStruct { + char_string<128> name = 0; + nullable TestGlobalBitmap myBitmap = 1; + optional nullable TestGlobalEnum myEnum = 2; +} + +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + +struct AtomicAttributeStatusStruct { + attrib_id attributeID = 0; + status statusCode = 1; +} + +/** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ +cluster Descriptor = 29 { + revision 2; + + bitmap Feature : bitmap32 { + kTagList = 0x1; + } + + struct DeviceTypeStruct { + devtype_id deviceType = 0; + int16u revision = 1; + } + + struct SemanticTagStruct { + nullable vendor_id mfgCode = 0; + enum8 namespaceID = 1; + enum8 tag = 2; + optional nullable char_string label = 3; + } + + readonly attribute DeviceTypeStruct deviceTypeList[] = 0; + readonly attribute cluster_id serverList[] = 1; + readonly attribute cluster_id clientList[] = 2; + readonly attribute endpoint_no partsList[] = 3; + readonly attribute optional SemanticTagStruct tagList[] = 4; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** The Access Control Cluster exposes a data model view of a + Node's Access Control List (ACL), which codifies the rules used to manage + and enforce Access Control for the Node's endpoints and their associated + cluster instances. */ +cluster AccessControl = 31 { + revision 2; + + enum AccessControlEntryAuthModeEnum : enum8 { + kPASE = 1; + kCASE = 2; + kGroup = 3; + } + + enum AccessControlEntryPrivilegeEnum : enum8 { + kView = 1; + kProxyView = 2; + kOperate = 3; + kManage = 4; + kAdminister = 5; + } + + enum AccessRestrictionTypeEnum : enum8 { + kAttributeAccessForbidden = 0; + kAttributeWriteForbidden = 1; + kCommandForbidden = 2; + kEventForbidden = 3; + } + + enum ChangeTypeEnum : enum8 { + kChanged = 0; + kAdded = 1; + kRemoved = 2; + } + + bitmap Feature : bitmap32 { + kExtension = 0x1; + kManagedDevice = 0x2; + } + + struct AccessRestrictionStruct { + AccessRestrictionTypeEnum type = 0; + nullable int32u id = 1; + } + + struct CommissioningAccessRestrictionEntryStruct { + endpoint_no endpoint = 0; + cluster_id cluster = 1; + AccessRestrictionStruct restrictions[] = 2; + } + + fabric_scoped struct AccessRestrictionEntryStruct { + fabric_sensitive endpoint_no endpoint = 0; + fabric_sensitive cluster_id cluster = 1; + fabric_sensitive AccessRestrictionStruct restrictions[] = 2; + fabric_idx fabricIndex = 254; + } + + struct AccessControlTargetStruct { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + + fabric_scoped struct AccessControlEntryStruct { + fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; + fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; + nullable fabric_sensitive int64u subjects[] = 3; + nullable fabric_sensitive AccessControlTargetStruct targets[] = 4; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct AccessControlExtensionStruct { + fabric_sensitive octet_string<128> data = 1; + fabric_idx fabricIndex = 254; + } + + fabric_sensitive info event access(read: administer) AccessControlEntryChanged = 0 { + nullable node_id adminNodeID = 1; + nullable int16u adminPasscodeID = 2; + ChangeTypeEnum changeType = 3; + nullable AccessControlEntryStruct latestValue = 4; + fabric_idx fabricIndex = 254; + } + + fabric_sensitive info event access(read: administer) AccessControlExtensionChanged = 1 { + nullable node_id adminNodeID = 1; + nullable int16u adminPasscodeID = 2; + ChangeTypeEnum changeType = 3; + nullable AccessControlExtensionStruct latestValue = 4; + fabric_idx fabricIndex = 254; + } + + fabric_sensitive info event access(read: administer) FabricRestrictionReviewUpdate = 2 { + int64u token = 0; + optional long_char_string instruction = 1; + optional long_char_string ARLRequestFlowUrl = 2; + fabric_idx fabricIndex = 254; + } + + attribute access(read: administer, write: administer) AccessControlEntryStruct acl[] = 0; + attribute access(read: administer, write: administer) optional AccessControlExtensionStruct extension[] = 1; + readonly attribute int16u subjectsPerAccessControlEntry = 2; + readonly attribute int16u targetsPerAccessControlEntry = 3; + readonly attribute int16u accessControlEntriesPerFabric = 4; + readonly attribute optional CommissioningAccessRestrictionEntryStruct commissioningARL[] = 5; + readonly attribute optional AccessRestrictionEntryStruct arl[] = 6; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ReviewFabricRestrictionsRequest { + CommissioningAccessRestrictionEntryStruct arl[] = 0; + } + + response struct ReviewFabricRestrictionsResponse = 1 { + int64u token = 0; + } + + /** This command signals to the service associated with the device vendor that the fabric administrator would like a review of the current restrictions on the accessing fabric. */ + fabric command access(invoke: administer) ReviewFabricRestrictions(ReviewFabricRestrictionsRequest): ReviewFabricRestrictionsResponse = 0; +} + +/** This cluster provides attributes and events for determining basic information about Nodes, which supports both + Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, + which apply to the whole Node. Also allows setting user device information such as location. */ +cluster BasicInformation = 40 { + revision 3; + + enum ColorEnum : enum8 { + kBlack = 0; + kNavy = 1; + kGreen = 2; + kTeal = 3; + kMaroon = 4; + kPurple = 5; + kOlive = 6; + kGray = 7; + kBlue = 8; + kLime = 9; + kAqua = 10; + kRed = 11; + kFuchsia = 12; + kYellow = 13; + kWhite = 14; + kNickel = 15; + kChrome = 16; + kBrass = 17; + kCopper = 18; + kSilver = 19; + kGold = 20; + } + + enum ProductFinishEnum : enum8 { + kOther = 0; + kMatte = 1; + kSatin = 2; + kPolished = 3; + kRugged = 4; + kFabric = 5; + } + + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + + struct ProductAppearanceStruct { + ProductFinishEnum finish = 0; + nullable ColorEnum primaryColor = 1; + } + + critical event StartUp = 0 { + int32u softwareVersion = 0; + } + + critical event ShutDown = 1 { + } + + info event Leave = 2 { + fabric_idx fabricIndex = 0; + } + + info event ReachableChanged = 3 { + boolean reachableNewValue = 0; + } + + readonly attribute int16u dataModelRevision = 0; + readonly attribute char_string<32> vendorName = 1; + readonly attribute vendor_id vendorID = 2; + readonly attribute char_string<32> productName = 3; + readonly attribute int16u productID = 4; + attribute access(write: manage) char_string<32> nodeLabel = 5; + attribute access(write: administer) char_string<2> location = 6; + readonly attribute int16u hardwareVersion = 7; + readonly attribute char_string<64> hardwareVersionString = 8; + readonly attribute int32u softwareVersion = 9; + readonly attribute char_string<64> softwareVersionString = 10; + readonly attribute optional char_string<16> manufacturingDate = 11; + readonly attribute optional char_string<32> partNumber = 12; + readonly attribute optional long_char_string<256> productURL = 13; + readonly attribute optional char_string<64> productLabel = 14; + readonly attribute optional char_string<32> serialNumber = 15; + attribute access(write: manage) optional boolean localConfigDisabled = 16; + readonly attribute optional boolean reachable = 17; + readonly attribute char_string<32> uniqueID = 18; + readonly attribute CapabilityMinimaStruct capabilityMinima = 19; + readonly attribute optional ProductAppearanceStruct productAppearance = 20; + readonly attribute int32u specificationVersion = 21; + readonly attribute int16u maxPathsPerInvoke = 22; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + command MfgSpecificPing(): DefaultSuccess = 0; +} + +/** Provides an interface for providing OTA software updates */ +cluster OtaSoftwareUpdateProvider = 41 { + revision 1; // NOTE: Default/not specifically set + + enum ApplyUpdateActionEnum : enum8 { + kProceed = 0; + kAwaitNextAction = 1; + kDiscontinue = 2; + } + + enum DownloadProtocolEnum : enum8 { + kBDXSynchronous = 0; + kBDXAsynchronous = 1; + kHTTPS = 2; + kVendorSpecific = 3; + } + + enum StatusEnum : enum8 { + kUpdateAvailable = 0; + kBusy = 1; + kNotAvailable = 2; + kDownloadProtocolNotSupported = 3; + } + + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct QueryImageRequest { + vendor_id vendorID = 0; + int16u productID = 1; + int32u softwareVersion = 2; + DownloadProtocolEnum protocolsSupported[] = 3; + optional int16u hardwareVersion = 4; + optional char_string<2> location = 5; + optional boolean requestorCanConsent = 6; + optional octet_string<512> metadataForProvider = 7; + } + + response struct QueryImageResponse = 1 { + StatusEnum status = 0; + optional int32u delayedActionTime = 1; + optional char_string<256> imageURI = 2; + optional int32u softwareVersion = 3; + optional char_string<64> softwareVersionString = 4; + optional octet_string<32> updateToken = 5; + optional boolean userConsentNeeded = 6; + optional octet_string<512> metadataForRequestor = 7; + } + + request struct ApplyUpdateRequestRequest { + octet_string<32> updateToken = 0; + int32u newVersion = 1; + } + + response struct ApplyUpdateResponse = 3 { + ApplyUpdateActionEnum action = 0; + int32u delayedActionTime = 1; + } + + request struct NotifyUpdateAppliedRequest { + octet_string<32> updateToken = 0; + int32u softwareVersion = 1; + } + + /** Determine availability of a new Software Image */ + command QueryImage(QueryImageRequest): QueryImageResponse = 0; + /** Determine next action to take for a downloaded Software Image */ + command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; + /** Notify OTA Provider that an update was applied */ + command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; +} + +/** Provides an interface for downloading and applying OTA software updates */ +cluster OtaSoftwareUpdateRequestor = 42 { + revision 1; // NOTE: Default/not specifically set + + enum AnnouncementReasonEnum : enum8 { + kSimpleAnnouncement = 0; + kUpdateAvailable = 1; + kUrgentUpdateAvailable = 2; + } + + enum ChangeReasonEnum : enum8 { + kUnknown = 0; + kSuccess = 1; + kFailure = 2; + kTimeOut = 3; + kDelayByProvider = 4; + } + + enum UpdateStateEnum : enum8 { + kUnknown = 0; + kIdle = 1; + kQuerying = 2; + kDelayedOnQuery = 3; + kDownloading = 4; + kApplying = 5; + kDelayedOnApply = 6; + kRollingBack = 7; + kDelayedOnUserConsent = 8; + } + + fabric_scoped struct ProviderLocation { + node_id providerNodeID = 1; + endpoint_no endpoint = 2; + fabric_idx fabricIndex = 254; + } + + info event StateTransition = 0 { + UpdateStateEnum previousState = 0; + UpdateStateEnum newState = 1; + ChangeReasonEnum reason = 2; + nullable int32u targetSoftwareVersion = 3; + } + + critical event VersionApplied = 1 { + int32u softwareVersion = 0; + int16u productID = 1; + } + + info event DownloadError = 2 { + int32u softwareVersion = 0; + int64u bytesDownloaded = 1; + nullable int8u progressPercent = 2; + nullable int64s platformCode = 3; + } + + attribute access(write: administer) ProviderLocation defaultOTAProviders[] = 0; + readonly attribute boolean updatePossible = 1; + readonly attribute UpdateStateEnum updateState = 2; + readonly attribute nullable int8u updateStateProgress = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AnnounceOTAProviderRequest { + node_id providerNodeID = 0; + vendor_id vendorID = 1; + AnnouncementReasonEnum announcementReason = 2; + optional octet_string<512> metadataForNode = 3; + endpoint_no endpoint = 4; + } + + /** Announce the presence of an OTA Provider */ + command AnnounceOTAProvider(AnnounceOTAProviderRequest): DefaultSuccess = 0; +} + +/** This cluster is used to manage global aspects of the Commissioning flow. */ +cluster GeneralCommissioning = 48 { + revision 1; // NOTE: Default/not specifically set + + enum CommissioningErrorEnum : enum8 { + kOK = 0; + kValueOutsideRange = 1; + kInvalidAuthentication = 2; + kNoFailSafe = 3; + kBusyWithOtherAdmin = 4; + kRequiredTCNotAccepted = 5; + kTCAcknowledgementsNotReceived = 6; + kTCMinVersionNotMet = 7; + } + + enum RegulatoryLocationTypeEnum : enum8 { + kIndoor = 0; + kOutdoor = 1; + kIndoorOutdoor = 2; + } + + bitmap Feature : bitmap32 { + kTermsAndConditions = 0x1; + } + + struct BasicCommissioningInfo { + int16u failSafeExpiryLengthSeconds = 0; + int16u maxCumulativeFailsafeSeconds = 1; + } + + attribute access(write: administer) int64u breadcrumb = 0; + readonly attribute BasicCommissioningInfo basicCommissioningInfo = 1; + readonly attribute RegulatoryLocationTypeEnum regulatoryConfig = 2; + readonly attribute RegulatoryLocationTypeEnum locationCapability = 3; + readonly attribute boolean supportsConcurrentConnection = 4; + provisional readonly attribute access(read: administer) optional int16u TCAcceptedVersion = 5; + provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; + provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; + provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ArmFailSafeRequest { + int16u expiryLengthSeconds = 0; + int64u breadcrumb = 1; + } + + response struct ArmFailSafeResponse = 1 { + CommissioningErrorEnum errorCode = 0; + char_string<128> debugText = 1; + } + + request struct SetRegulatoryConfigRequest { + RegulatoryLocationTypeEnum newRegulatoryConfig = 0; + char_string<2> countryCode = 1; + int64u breadcrumb = 2; + } + + response struct SetRegulatoryConfigResponse = 3 { + CommissioningErrorEnum errorCode = 0; + char_string debugText = 1; + } + + response struct CommissioningCompleteResponse = 5 { + CommissioningErrorEnum errorCode = 0; + char_string debugText = 1; + } + + request struct SetTCAcknowledgementsRequest { + int16u TCVersion = 0; + bitmap16 TCUserResponse = 1; + } + + response struct SetTCAcknowledgementsResponse = 7 { + CommissioningErrorEnum errorCode = 0; + } + + /** Arm the persistent fail-safe timer with an expiry time of now + ExpiryLengthSeconds using device clock */ + command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; + /** Set the regulatory configuration to be used during commissioning */ + command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; + /** Signals the Server that the Client has successfully completed all steps of Commissioning/Recofiguration needed during fail-safe period. */ + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + /** This command sets the user acknowledgements received in the Enhanced Setup Flow Terms and Conditions into the node. */ + command access(invoke: administer) SetTCAcknowledgements(SetTCAcknowledgementsRequest): SetTCAcknowledgementsResponse = 6; +} + +/** Functionality to configure, enable, disable network credentials and access on a Matter device. */ +cluster NetworkCommissioning = 49 { + revision 1; // NOTE: Default/not specifically set + + enum NetworkCommissioningStatusEnum : enum8 { + kSuccess = 0; + kOutOfRange = 1; + kBoundsExceeded = 2; + kNetworkIDNotFound = 3; + kDuplicateNetworkID = 4; + kNetworkNotFound = 5; + kRegulatoryError = 6; + kAuthFailure = 7; + kUnsupportedSecurity = 8; + kOtherConnectionFailure = 9; + kIPV6Failed = 10; + kIPBindFailed = 11; + kUnknownError = 12; + } + + enum WiFiBandEnum : enum8 { + k2G4 = 0; + k3G65 = 1; + k5G = 2; + k6G = 3; + k60G = 4; + k1G = 5; + } + + bitmap Feature : bitmap32 { + kWiFiNetworkInterface = 0x1; + kThreadNetworkInterface = 0x2; + kEthernetNetworkInterface = 0x4; + kPerDeviceCredentials = 0x8; + } + + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { + kUnencrypted = 0x1; + kWEP = 0x2; + kWPAPersonal = 0x4; + kWPA2Personal = 0x8; + kWPA3Personal = 0x10; + kWPA3MatterPDC = 0x20; + } + + struct NetworkInfoStruct { + octet_string<32> networkID = 0; + boolean connected = 1; + optional nullable octet_string<20> networkIdentifier = 2; + optional nullable octet_string<20> clientIdentifier = 3; + } + + struct ThreadInterfaceScanResultStruct { + int16u panId = 0; + int64u extendedPanId = 1; + char_string<16> networkName = 2; + int16u channel = 3; + int8u version = 4; + octet_string<8> extendedAddress = 5; + int8s rssi = 6; + int8u lqi = 7; + } + + struct WiFiInterfaceScanResultStruct { + WiFiSecurityBitmap security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBandEnum wiFiBand = 4; + int8s rssi = 5; + } + + readonly attribute access(read: administer) int8u maxNetworks = 0; + readonly attribute access(read: administer) NetworkInfoStruct networks[] = 1; + readonly attribute optional int8u scanMaxTimeSeconds = 2; + readonly attribute optional int8u connectMaxTimeSeconds = 3; + attribute access(write: administer) boolean interfaceEnabled = 4; + readonly attribute access(read: administer) nullable NetworkCommissioningStatusEnum lastNetworkingStatus = 5; + readonly attribute access(read: administer) nullable octet_string<32> lastNetworkID = 6; + readonly attribute access(read: administer) nullable int32s lastConnectErrorValue = 7; + provisional readonly attribute optional WiFiBandEnum supportedWiFiBands[] = 8; + provisional readonly attribute optional ThreadCapabilitiesBitmap supportedThreadFeatures = 9; + provisional readonly attribute optional int16u threadVersion = 10; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ScanNetworksRequest { + optional nullable octet_string<32> ssid = 0; + optional int64u breadcrumb = 1; + } + + response struct ScanNetworksResponse = 1 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional char_string debugText = 1; + optional WiFiInterfaceScanResultStruct wiFiScanResults[] = 2; + optional ThreadInterfaceScanResultStruct threadScanResults[] = 3; + } + + request struct AddOrUpdateWiFiNetworkRequest { + octet_string<32> ssid = 0; + octet_string<64> credentials = 1; + optional int64u breadcrumb = 2; + optional octet_string<140> networkIdentity = 3; + optional octet_string<20> clientIdentifier = 4; + optional octet_string<32> possessionNonce = 5; + } + + request struct AddOrUpdateThreadNetworkRequest { + octet_string<254> operationalDataset = 0; + optional int64u breadcrumb = 1; + } + + request struct RemoveNetworkRequest { + octet_string<32> networkID = 0; + optional int64u breadcrumb = 1; + } + + response struct NetworkConfigResponse = 5 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional char_string<512> debugText = 1; + optional int8u networkIndex = 2; + optional octet_string<140> clientIdentity = 3; + optional octet_string<64> possessionSignature = 4; + } + + request struct ConnectNetworkRequest { + octet_string<32> networkID = 0; + optional int64u breadcrumb = 1; + } + + response struct ConnectNetworkResponse = 7 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional char_string debugText = 1; + nullable int32s errorValue = 2; + } + + request struct ReorderNetworkRequest { + octet_string<32> networkID = 0; + int8u networkIndex = 1; + optional int64u breadcrumb = 2; + } + + request struct QueryIdentityRequest { + octet_string<20> keyIdentifier = 0; + optional octet_string<32> possessionNonce = 1; + } + + response struct QueryIdentityResponse = 10 { + octet_string<140> identity = 0; + optional octet_string<64> possessionSignature = 1; + } + + /** Detemine the set of networks the device sees as available. */ + command access(invoke: administer) ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; + /** Add or update the credentials for a given Wi-Fi network. */ + command access(invoke: administer) AddOrUpdateWiFiNetwork(AddOrUpdateWiFiNetworkRequest): NetworkConfigResponse = 2; + /** Add or update the credentials for a given Thread network. */ + command access(invoke: administer) AddOrUpdateThreadNetwork(AddOrUpdateThreadNetworkRequest): NetworkConfigResponse = 3; + /** Remove the definition of a given network (including its credentials). */ + command access(invoke: administer) RemoveNetwork(RemoveNetworkRequest): NetworkConfigResponse = 4; + /** Connect to the specified network, using previously-defined credentials. */ + command access(invoke: administer) ConnectNetwork(ConnectNetworkRequest): ConnectNetworkResponse = 6; + /** Modify the order in which networks will be presented in the Networks attribute. */ + command access(invoke: administer) ReorderNetwork(ReorderNetworkRequest): NetworkConfigResponse = 8; + /** Retrieve details about and optionally proof of possession of a network client identity. */ + command access(invoke: administer) QueryIdentity(QueryIdentityRequest): QueryIdentityResponse = 9; +} + +/** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ +cluster DiagnosticLogs = 50 { + revision 1; // NOTE: Default/not specifically set + + enum IntentEnum : enum8 { + kEndUserSupport = 0; + kNetworkDiag = 1; + kCrashLogs = 2; + } + + enum StatusEnum : enum8 { + kSuccess = 0; + kExhausted = 1; + kNoLogs = 2; + kBusy = 3; + kDenied = 4; + } + + enum TransferProtocolEnum : enum8 { + kResponsePayload = 0; + kBDX = 1; + } + + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct RetrieveLogsRequestRequest { + IntentEnum intent = 0; + TransferProtocolEnum requestedProtocol = 1; + optional char_string<32> transferFileDesignator = 2; + } + + response struct RetrieveLogsResponse = 1 { + StatusEnum status = 0; + long_octet_string logContent = 1; + optional epoch_us UTCTimeStamp = 2; + optional systime_us timeSinceBoot = 3; + } + + /** Retrieving diagnostic logs from a Node */ + command RetrieveLogsRequest(RetrieveLogsRequestRequest): RetrieveLogsResponse = 0; +} + +/** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ +cluster GeneralDiagnostics = 51 { + revision 2; + + enum BootReasonEnum : enum8 { + kUnspecified = 0; + kPowerOnReboot = 1; + kBrownOutReset = 2; + kSoftwareWatchdogReset = 3; + kHardwareWatchdogReset = 4; + kSoftwareUpdateCompleted = 5; + kSoftwareReset = 6; + } + + enum HardwareFaultEnum : enum8 { + kUnspecified = 0; + kRadio = 1; + kSensor = 2; + kResettableOverTemp = 3; + kNonResettableOverTemp = 4; + kPowerSource = 5; + kVisualDisplayFault = 6; + kAudioOutputFault = 7; + kUserInterfaceFault = 8; + kNonVolatileMemoryError = 9; + kTamperDetected = 10; + } + + enum InterfaceTypeEnum : enum8 { + kUnspecified = 0; + kWiFi = 1; + kEthernet = 2; + kCellular = 3; + kThread = 4; + } + + enum NetworkFaultEnum : enum8 { + kUnspecified = 0; + kHardwareFailure = 1; + kNetworkJammed = 2; + kConnectionFailed = 3; + } + + enum RadioFaultEnum : enum8 { + kUnspecified = 0; + kWiFiFault = 1; + kCellularFault = 2; + kThreadFault = 3; + kNFCFault = 4; + kBLEFault = 5; + kEthernetFault = 6; + } + + bitmap Feature : bitmap32 { + kDataModelTest = 0x1; + } + + struct NetworkInterface { + char_string<32> name = 0; + boolean isOperational = 1; + nullable boolean offPremiseServicesReachableIPv4 = 2; + nullable boolean offPremiseServicesReachableIPv6 = 3; + octet_string<8> hardwareAddress = 4; + octet_string IPv4Addresses[] = 5; + octet_string IPv6Addresses[] = 6; + InterfaceTypeEnum type = 7; + } + + critical event HardwareFaultChange = 0 { + HardwareFaultEnum current[] = 0; + HardwareFaultEnum previous[] = 1; + } + + critical event RadioFaultChange = 1 { + RadioFaultEnum current[] = 0; + RadioFaultEnum previous[] = 1; + } + + critical event NetworkFaultChange = 2 { + NetworkFaultEnum current[] = 0; + NetworkFaultEnum previous[] = 1; + } + + critical event BootReason = 3 { + BootReasonEnum bootReason = 0; + } + + readonly attribute NetworkInterface networkInterfaces[] = 0; + readonly attribute int16u rebootCount = 1; + readonly attribute optional int64u upTime = 2; + readonly attribute optional int32u totalOperationalHours = 3; + readonly attribute optional BootReasonEnum bootReason = 4; + readonly attribute optional HardwareFaultEnum activeHardwareFaults[] = 5; + readonly attribute optional RadioFaultEnum activeRadioFaults[] = 6; + readonly attribute optional NetworkFaultEnum activeNetworkFaults[] = 7; + readonly attribute boolean testEventTriggersEnabled = 8; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct TestEventTriggerRequest { + octet_string<16> enableKey = 0; + int64u eventTrigger = 1; + } + + response struct TimeSnapshotResponse = 2 { + systime_ms systemTimeMs = 0; + nullable posix_ms posixTimeMs = 1; + } + + request struct PayloadTestRequestRequest { + octet_string<16> enableKey = 0; + int8u value = 1; + int16u count = 2; + } + + response struct PayloadTestResponse = 4 { + octet_string payload = 0; + } + + /** Provide a means for certification tests to trigger some test-plan-specific events */ + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + /** Take a snapshot of system time and epoch time. */ + command TimeSnapshot(): TimeSnapshotResponse = 1; + /** Request a variable length payload response. */ + command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3; +} + +/** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ +cluster ThreadNetworkDiagnostics = 53 { + revision 2; + + enum ConnectionStatusEnum : enum8 { + kConnected = 0; + kNotConnected = 1; + } + + enum NetworkFaultEnum : enum8 { + kUnspecified = 0; + kLinkDown = 1; + kHardwareFailure = 2; + kNetworkJammed = 3; + } + + enum RoutingRoleEnum : enum8 { + kUnspecified = 0; + kUnassigned = 1; + kSleepyEndDevice = 2; + kEndDevice = 3; + kREED = 4; + kRouter = 5; + kLeader = 6; + } + + bitmap Feature : bitmap32 { + kPacketCounts = 0x1; + kErrorCounts = 0x2; + kMLECounts = 0x4; + kMACCounts = 0x8; + } + + struct NeighborTableStruct { + int64u extAddress = 0; + int32u age = 1; + int16u rloc16 = 2; + int32u linkFrameCounter = 3; + int32u mleFrameCounter = 4; + int8u lqi = 5; + nullable int8s averageRssi = 6; + nullable int8s lastRssi = 7; + int8u frameErrorRate = 8; + int8u messageErrorRate = 9; + boolean rxOnWhenIdle = 10; + boolean fullThreadDevice = 11; + boolean fullNetworkData = 12; + boolean isChild = 13; + } + + struct OperationalDatasetComponents { + boolean activeTimestampPresent = 0; + boolean pendingTimestampPresent = 1; + boolean masterKeyPresent = 2; + boolean networkNamePresent = 3; + boolean extendedPanIdPresent = 4; + boolean meshLocalPrefixPresent = 5; + boolean delayPresent = 6; + boolean panIdPresent = 7; + boolean channelPresent = 8; + boolean pskcPresent = 9; + boolean securityPolicyPresent = 10; + boolean channelMaskPresent = 11; + } + + struct RouteTableStruct { + int64u extAddress = 0; + int16u rloc16 = 1; + int8u routerId = 2; + int8u nextHop = 3; + int8u pathCost = 4; + int8u LQIIn = 5; + int8u LQIOut = 6; + int8u age = 7; + boolean allocated = 8; + boolean linkEstablished = 9; + } + + struct SecurityPolicy { + int16u rotationTime = 0; + int16u flags = 1; + } + + info event ConnectionStatus = 0 { + ConnectionStatusEnum connectionStatus = 0; + } + + info event NetworkFaultChange = 1 { + NetworkFaultEnum current[] = 0; + NetworkFaultEnum previous[] = 1; + } + + readonly attribute nullable int16u channel = 0; + readonly attribute nullable RoutingRoleEnum routingRole = 1; + readonly attribute nullable char_string<16> networkName = 2; + readonly attribute nullable int16u panId = 3; + readonly attribute nullable int64u extendedPanId = 4; + readonly attribute nullable octet_string<17> meshLocalPrefix = 5; + readonly attribute optional int64u overrunCount = 6; + readonly attribute NeighborTableStruct neighborTable[] = 7; + readonly attribute RouteTableStruct routeTable[] = 8; + readonly attribute nullable int32u partitionId = 9; + readonly attribute nullable int16u weighting = 10; + readonly attribute nullable int16u dataVersion = 11; + readonly attribute nullable int16u stableDataVersion = 12; + readonly attribute nullable int8u leaderRouterId = 13; + readonly attribute optional int16u detachedRoleCount = 14; + readonly attribute optional int16u childRoleCount = 15; + readonly attribute optional int16u routerRoleCount = 16; + readonly attribute optional int16u leaderRoleCount = 17; + readonly attribute optional int16u attachAttemptCount = 18; + readonly attribute optional int16u partitionIdChangeCount = 19; + readonly attribute optional int16u betterPartitionAttachAttemptCount = 20; + readonly attribute optional int16u parentChangeCount = 21; + readonly attribute optional int32u txTotalCount = 22; + readonly attribute optional int32u txUnicastCount = 23; + readonly attribute optional int32u txBroadcastCount = 24; + readonly attribute optional int32u txAckRequestedCount = 25; + readonly attribute optional int32u txAckedCount = 26; + readonly attribute optional int32u txNoAckRequestedCount = 27; + readonly attribute optional int32u txDataCount = 28; + readonly attribute optional int32u txDataPollCount = 29; + readonly attribute optional int32u txBeaconCount = 30; + readonly attribute optional int32u txBeaconRequestCount = 31; + readonly attribute optional int32u txOtherCount = 32; + readonly attribute optional int32u txRetryCount = 33; + readonly attribute optional int32u txDirectMaxRetryExpiryCount = 34; + readonly attribute optional int32u txIndirectMaxRetryExpiryCount = 35; + readonly attribute optional int32u txErrCcaCount = 36; + readonly attribute optional int32u txErrAbortCount = 37; + readonly attribute optional int32u txErrBusyChannelCount = 38; + readonly attribute optional int32u rxTotalCount = 39; + readonly attribute optional int32u rxUnicastCount = 40; + readonly attribute optional int32u rxBroadcastCount = 41; + readonly attribute optional int32u rxDataCount = 42; + readonly attribute optional int32u rxDataPollCount = 43; + readonly attribute optional int32u rxBeaconCount = 44; + readonly attribute optional int32u rxBeaconRequestCount = 45; + readonly attribute optional int32u rxOtherCount = 46; + readonly attribute optional int32u rxAddressFilteredCount = 47; + readonly attribute optional int32u rxDestAddrFilteredCount = 48; + readonly attribute optional int32u rxDuplicatedCount = 49; + readonly attribute optional int32u rxErrNoFrameCount = 50; + readonly attribute optional int32u rxErrUnknownNeighborCount = 51; + readonly attribute optional int32u rxErrInvalidSrcAddrCount = 52; + readonly attribute optional int32u rxErrSecCount = 53; + readonly attribute optional int32u rxErrFcsCount = 54; + readonly attribute optional int32u rxErrOtherCount = 55; + readonly attribute optional nullable int64u activeTimestamp = 56; + readonly attribute optional nullable int64u pendingTimestamp = 57; + readonly attribute optional nullable int32u delay = 58; + readonly attribute nullable SecurityPolicy securityPolicy = 59; + readonly attribute nullable octet_string<4> channelPage0Mask = 60; + readonly attribute nullable OperationalDatasetComponents operationalDatasetComponents = 61; + readonly attribute NetworkFaultEnum activeNetworkFaultsList[] = 62; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + /** Reception of this command SHALL reset the OverrunCount attributes to 0 */ + command access(invoke: manage) ResetCounts(): DefaultSuccess = 0; +} + +/** Commands to trigger a Node to allow a new Administrator to commission it. */ +cluster AdministratorCommissioning = 60 { + revision 1; // NOTE: Default/not specifically set + + enum CommissioningWindowStatusEnum : enum8 { + kWindowNotOpen = 0; + kEnhancedWindowOpen = 1; + kBasicWindowOpen = 2; + } + + enum StatusCode : enum8 { + kBusy = 2; + kPAKEParameterError = 3; + kWindowNotOpen = 4; + } + + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable vendor_id adminVendorId = 2; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct OpenCommissioningWindowRequest { + int16u commissioningTimeout = 0; + octet_string PAKEPasscodeVerifier = 1; + int16u discriminator = 2; + int32u iterations = 3; + octet_string<32> salt = 4; + } + + request struct OpenBasicCommissioningWindowRequest { + int16u commissioningTimeout = 0; + } + + /** This command is used by a current Administrator to instruct a Node to go into commissioning mode using enhanced commissioning method. */ + timed command access(invoke: administer) OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0; + /** This command is used by a current Administrator to instruct a Node to go into commissioning mode using basic commissioning method, if the node supports it. */ + timed command access(invoke: administer) OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1; + /** This command is used by a current Administrator to instruct a Node to revoke any active Open Commissioning Window or Open Basic Commissioning Window command. */ + timed command access(invoke: administer) RevokeCommissioning(): DefaultSuccess = 2; +} + +/** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ +cluster OperationalCredentials = 62 { + revision 1; // NOTE: Default/not specifically set + + enum CertificateChainTypeEnum : enum8 { + kDACCertificate = 1; + kPAICertificate = 2; + } + + enum NodeOperationalCertStatusEnum : enum8 { + kOK = 0; + kInvalidPublicKey = 1; + kInvalidNodeOpId = 2; + kInvalidNOC = 3; + kMissingCsr = 4; + kTableFull = 5; + kInvalidAdminSubject = 6; + kFabricConflict = 9; + kLabelConflict = 10; + kInvalidFabricIndex = 11; + } + + fabric_scoped struct FabricDescriptorStruct { + octet_string<65> rootPublicKey = 1; + vendor_id vendorID = 2; + fabric_id fabricID = 3; + node_id nodeID = 4; + char_string<32> label = 5; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; + readonly attribute FabricDescriptorStruct fabrics[] = 1; + readonly attribute int8u supportedFabrics = 2; + readonly attribute int8u commissionedFabrics = 3; + readonly attribute octet_string trustedRootCertificates[] = 4; + readonly attribute int8u currentFabricIndex = 5; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AttestationRequestRequest { + octet_string<32> attestationNonce = 0; + } + + response struct AttestationResponse = 1 { + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; + } + + request struct CertificateChainRequestRequest { + CertificateChainTypeEnum certificateType = 0; + } + + response struct CertificateChainResponse = 3 { + octet_string<600> certificate = 0; + } + + request struct CSRRequestRequest { + octet_string<32> CSRNonce = 0; + optional boolean isForUpdateNOC = 1; + } + + response struct CSRResponse = 5 { + octet_string NOCSRElements = 0; + octet_string attestationSignature = 1; + } + + request struct AddNOCRequest { + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; + int64u caseAdminSubject = 3; + vendor_id adminVendorId = 4; + } + + request struct UpdateNOCRequest { + octet_string NOCValue = 0; + optional octet_string ICACValue = 1; + } + + response struct NOCResponse = 8 { + NodeOperationalCertStatusEnum statusCode = 0; + optional fabric_idx fabricIndex = 1; + optional char_string<128> debugText = 2; + } + + request struct UpdateFabricLabelRequest { + char_string<32> label = 0; + } + + request struct RemoveFabricRequest { + fabric_idx fabricIndex = 0; + } + + request struct AddTrustedRootCertificateRequest { + octet_string rootCACertificate = 0; + } + + /** Sender is requesting attestation information from the receiver. */ + command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; + /** Sender is requesting a device attestation certificate from the receiver. */ + command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; + /** Sender is requesting a certificate signing request (CSR) from the receiver. */ + command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; + /** Sender is requesting to add the new node operational certificates. */ + command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; + /** Sender is requesting to update the node operational certificates. */ + fabric command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; + /** This command SHALL be used by an Administrative Node to set the user-visible Label field for a given Fabric, as reflected by entries in the Fabrics attribute. */ + fabric command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + /** This command is used by Administrative Nodes to remove a given fabric index and delete all associated fabric-scoped data. */ + command access(invoke: administer) RemoveFabric(RemoveFabricRequest): NOCResponse = 10; + /** This command SHALL add a Trusted Root CA Certificate, provided as its CHIP Certificate representation. */ + command access(invoke: administer) AddTrustedRootCertificate(AddTrustedRootCertificateRequest): DefaultSuccess = 11; +} + +/** The Group Key Management Cluster is the mechanism by which group keys are managed. */ +cluster GroupKeyManagement = 63 { + revision 1; // NOTE: Default/not specifically set + + enum GroupKeySecurityPolicyEnum : enum8 { + kTrustFirst = 0; + kCacheAndSync = 1; + } + + bitmap Feature : bitmap32 { + kCacheAndSync = 0x1; + } + + fabric_scoped struct GroupInfoMapStruct { + group_id groupId = 1; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct GroupKeyMapStruct { + group_id groupId = 1; + int16u groupKeySetID = 2; + fabric_idx fabricIndex = 254; + } + + struct GroupKeySetStruct { + int16u groupKeySetID = 0; + GroupKeySecurityPolicyEnum groupKeySecurityPolicy = 1; + nullable octet_string<16> epochKey0 = 2; + nullable epoch_us epochStartTime0 = 3; + nullable octet_string<16> epochKey1 = 4; + nullable epoch_us epochStartTime1 = 5; + nullable octet_string<16> epochKey2 = 6; + nullable epoch_us epochStartTime2 = 7; + } + + attribute access(write: manage) GroupKeyMapStruct groupKeyMap[] = 0; + readonly attribute GroupInfoMapStruct groupTable[] = 1; + readonly attribute int16u maxGroupsPerFabric = 2; + readonly attribute int16u maxGroupKeysPerFabric = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct KeySetWriteRequest { + GroupKeySetStruct groupKeySet = 0; + } + + request struct KeySetReadRequest { + int16u groupKeySetID = 0; + } + + response struct KeySetReadResponse = 2 { + GroupKeySetStruct groupKeySet = 0; + } + + request struct KeySetRemoveRequest { + int16u groupKeySetID = 0; + } + + response struct KeySetReadAllIndicesResponse = 5 { + int16u groupKeySetIDs[] = 0; + } + + /** Write a new set of keys for the given key set id. */ + fabric command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; + /** Read the keys for a given key set id. */ + fabric command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; + /** Revoke a Root Key from a Group */ + fabric command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; + /** Return the list of Group Key Sets associated with the accessing fabric */ + fabric command access(invoke: administer) KeySetReadAllIndices(): KeySetReadAllIndicesResponse = 4; +} + +/** Attributes and commands for selecting a mode from a list of supported options. */ +cluster RefrigeratorAndTemperatureControlledCabinetMode = 82 { + revision 2; + + enum ModeTag : enum16 { + kAuto = 0; + kQuick = 1; + kQuiet = 2; + kLowNoise = 3; + kLowEnergy = 4; + kVacation = 5; + kMin = 6; + kMax = 7; + kNight = 8; + kDay = 9; + kRapidCool = 16384; + kRapidFreeze = 16385; + } + + bitmap Feature : bitmap32 { + kOnOff = 0x1; + } + + struct ModeTagStruct { + optional vendor_id mfgCode = 0; + enum16 value = 1; + } + + struct ModeOptionStruct { + char_string<64> label = 0; + int8u mode = 1; + ModeTagStruct modeTags[] = 2; + } + + readonly attribute ModeOptionStruct supportedModes[] = 0; + readonly attribute int8u currentMode = 1; + attribute optional nullable int8u startUpMode = 2; + attribute optional nullable int8u onMode = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ChangeToModeRequest { + int8u newMode = 0; + } + + response struct ChangeToModeResponse = 1 { + enum8 status = 0; + optional char_string statusText = 1; + } + + /** This command is used to change device modes. + On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */ + command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0; +} + +/** Attributes and commands for configuring the temperature control, and reporting temperature. */ +cluster TemperatureControl = 86 { + revision 1; // NOTE: Default/not specifically set + + bitmap Feature : bitmap32 { + kTemperatureNumber = 0x1; + kTemperatureLevel = 0x2; + kTemperatureStep = 0x4; + } + + readonly attribute optional temperature temperatureSetpoint = 0; + readonly attribute optional temperature minTemperature = 1; + readonly attribute optional temperature maxTemperature = 2; + readonly attribute optional temperature step = 3; + readonly attribute optional int8u selectedTemperatureLevel = 4; + readonly attribute optional char_string supportedTemperatureLevels[] = 5; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct SetTemperatureRequest { + optional temperature targetTemperature = 0; + optional int8u targetTemperatureLevel = 1; + } + + /** Set Temperature */ + command SetTemperature(SetTemperatureRequest): DefaultSuccess = 0; +} + +/** Attributes and commands for configuring the Refrigerator alarm. */ +cluster RefrigeratorAlarm = 87 { + revision 1; // NOTE: Default/not specifically set + + bitmap AlarmBitmap : bitmap32 { + kDoorOpen = 0x1; + } + + info event Notify = 0 { + AlarmBitmap active = 0; + AlarmBitmap inactive = 1; + AlarmBitmap state = 2; + AlarmBitmap mask = 3; + } + + readonly attribute AlarmBitmap mask = 0; + readonly attribute AlarmBitmap state = 2; + readonly attribute AlarmBitmap supported = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +endpoint 0 { + device type ma_rootdevice = 22, version 1; + + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + callback attribute featureMap; + callback attribute clusterRevision; + } + + server cluster AccessControl { + emits event AccessControlEntryChanged; + emits event AccessControlExtensionChanged; + callback attribute acl; + callback attribute extension; + callback attribute subjectsPerAccessControlEntry; + callback attribute targetsPerAccessControlEntry; + callback attribute accessControlEntriesPerFabric; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + callback attribute clusterRevision; + } + + server cluster BasicInformation { + emits event StartUp; + emits event ShutDown; + emits event Leave; + callback attribute dataModelRevision; + callback attribute vendorName; + callback attribute vendorID; + callback attribute productName; + callback attribute productID; + persist attribute nodeLabel; + callback attribute location; + callback attribute hardwareVersion; + callback attribute hardwareVersionString; + callback attribute softwareVersion; + callback attribute softwareVersionString; + callback attribute manufacturingDate; + callback attribute partNumber; + callback attribute productURL; + callback attribute productLabel; + callback attribute serialNumber; + persist attribute localConfigDisabled default = 0; + ram attribute reachable default = 1; + callback attribute uniqueID; + callback attribute capabilityMinima; + callback attribute specificationVersion; + callback attribute maxPathsPerInvoke; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 3; + } + + server cluster OtaSoftwareUpdateProvider { + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command QueryImage; + handle command QueryImageResponse; + handle command ApplyUpdateRequest; + handle command ApplyUpdateResponse; + handle command NotifyUpdateApplied; + } + + server cluster OtaSoftwareUpdateRequestor { + callback attribute defaultOTAProviders; + ram attribute updatePossible default = true; + ram attribute updateState default = 0; + ram attribute updateStateProgress; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster GeneralCommissioning { + ram attribute breadcrumb default = 0x0000000000000000; + callback attribute basicCommissioningInfo; + callback attribute regulatoryConfig; + callback attribute locationCapability; + callback attribute supportsConcurrentConnection; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command ArmFailSafe; + handle command ArmFailSafeResponse; + handle command SetRegulatoryConfig; + handle command SetRegulatoryConfigResponse; + handle command CommissioningComplete; + handle command CommissioningCompleteResponse; + } + + server cluster NetworkCommissioning { + ram attribute maxNetworks; + callback attribute networks; + ram attribute scanMaxTimeSeconds; + ram attribute connectMaxTimeSeconds; + ram attribute interfaceEnabled; + ram attribute lastNetworkingStatus; + ram attribute lastNetworkID; + ram attribute lastConnectErrorValue; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 2; + ram attribute clusterRevision default = 1; + + handle command ScanNetworks; + handle command ScanNetworksResponse; + handle command AddOrUpdateWiFiNetwork; + handle command RemoveNetwork; + handle command NetworkConfigResponse; + handle command ConnectNetwork; + handle command ConnectNetworkResponse; + handle command ReorderNetwork; + } + + server cluster DiagnosticLogs { + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command RetrieveLogsRequest; + handle command RetrieveLogsResponse; + } + + server cluster GeneralDiagnostics { + emits event HardwareFaultChange; + emits event RadioFaultChange; + emits event NetworkFaultChange; + emits event BootReason; + callback attribute networkInterfaces; + callback attribute rebootCount; + callback attribute upTime; + callback attribute totalOperationalHours; + callback attribute bootReason; + callback attribute activeHardwareFaults; + callback attribute activeRadioFaults; + callback attribute activeNetworkFaults; + callback attribute testEventTriggersEnabled default = false; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + callback attribute featureMap; + callback attribute clusterRevision; + + handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; + } + + server cluster ThreadNetworkDiagnostics { + callback attribute channel; + callback attribute routingRole; + callback attribute networkName; + callback attribute panId; + callback attribute extendedPanId; + callback attribute meshLocalPrefix; + callback attribute neighborTable; + callback attribute routeTable; + callback attribute partitionId; + callback attribute weighting; + callback attribute dataVersion; + callback attribute stableDataVersion; + callback attribute leaderRouterId; + callback attribute securityPolicy; + callback attribute channelPage0Mask; + callback attribute operationalDatasetComponents; + callback attribute activeNetworkFaultsList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 2; + } + + server cluster AdministratorCommissioning { + callback attribute windowStatus; + callback attribute adminFabricIndex; + callback attribute adminVendorId; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command OpenCommissioningWindow; + handle command RevokeCommissioning; + } + + server cluster OperationalCredentials { + callback attribute NOCs; + callback attribute fabrics; + callback attribute supportedFabrics; + callback attribute commissionedFabrics; + callback attribute trustedRootCertificates; + callback attribute currentFabricIndex; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command AttestationRequest; + handle command AttestationResponse; + handle command CertificateChainRequest; + handle command CertificateChainResponse; + handle command CSRRequest; + handle command CSRResponse; + handle command AddNOC; + handle command UpdateNOC; + handle command NOCResponse; + handle command UpdateFabricLabel; + handle command RemoveFabric; + handle command AddTrustedRootCertificate; + } + + server cluster GroupKeyManagement { + callback attribute groupKeyMap; + callback attribute groupTable; + callback attribute maxGroupsPerFabric; + callback attribute maxGroupKeysPerFabric; + callback attribute featureMap; + callback attribute clusterRevision; + + handle command KeySetWrite; + handle command KeySetRead; + handle command KeySetReadResponse; + handle command KeySetRemove; + handle command KeySetReadAllIndices; + handle command KeySetReadAllIndicesResponse; + } +} +endpoint 1 { + device type ma_refrigerator = 112, version 1; + + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + callback attribute featureMap; + callback attribute clusterRevision; + } + + server cluster RefrigeratorAndTemperatureControlledCabinetMode { + callback attribute supportedModes; + callback attribute currentMode; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap; + ram attribute clusterRevision default = 2; + + handle command ChangeToMode; + handle command ChangeToModeResponse; + } + + server cluster RefrigeratorAlarm { + ram attribute mask default = 0; + ram attribute state default = 0; + ram attribute supported default = 0; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } +} +endpoint 2 { + device type ma_temperature_controlled_cabinet = 113, version 1; + + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + callback attribute featureMap; + callback attribute clusterRevision; + } + + server cluster TemperatureControl { + ram attribute temperatureSetpoint; + ram attribute minTemperature; + ram attribute maxTemperature; + ram attribute step; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 1; + ram attribute clusterRevision default = 1; + + handle command SetTemperature; + } +} +endpoint 3 { + device type ma_temperature_controlled_cabinet = 113, version 1; + + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + callback attribute featureMap; + callback attribute clusterRevision; + } + + server cluster TemperatureControl { + ram attribute temperatureSetpoint; + ram attribute minTemperature; + ram attribute maxTemperature; + ram attribute step; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 1; + ram attribute clusterRevision default = 1; + + handle command SetTemperature; + } +} + + diff --git a/examples/refrigerator-app/silabs/data_model/refrigerator-thread-app.zap b/examples/refrigerator-app/silabs/data_model/refrigerator-thread-app.zap new file mode 100644 index 0000000000..57785bd3ad --- /dev/null +++ b/examples/refrigerator-app/silabs/data_model/refrigerator-thread-app.zap @@ -0,0 +1,4311 @@ +{ + "fileFormat": 2, + "featureLevel": 103, + "creator": "zap", + "keyValuePairs": [ + { + "key": "commandDiscovery", + "value": "1" + }, + { + "key": "defaultResponsePolicy", + "value": "always" + }, + { + "key": "manufacturerCodes", + "value": "0x1002" + } + ], + "package": [ + { + "pathRelativity": "relativeToZap", + "path": "../../../../src/app/zap-templates/zcl/zcl.json", + "type": "zcl-properties", + "category": "matter", + "version": 1, + "description": "Matter SDK ZCL data" + }, + { + "pathRelativity": "relativeToZap", + "path": "../../../../src/app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "category": "matter", + "version": "chip-v1" + } + ], + "endpointTypes": [ + { + "id": 1, + "name": "MA-rootdevice", + "deviceTypeRef": { + "code": 22, + "profileId": 259, + "label": "MA-rootdevice", + "name": "MA-rootdevice", + "deviceTypeOrder": 0 + }, + "deviceTypes": [ + { + "code": 22, + "profileId": 259, + "label": "MA-rootdevice", + "name": "MA-rootdevice", + "deviceTypeOrder": 0 + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 22 + ], + "deviceTypeName": "MA-rootdevice", + "deviceTypeCode": 22, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Access Control", + "code": 31, + "mfgCode": null, + "define": "ACCESS_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "ACL", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Extension", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SubjectsPerAccessControlEntry", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TargetsPerAccessControlEntry", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AccessControlEntriesPerFabric", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "AccessControlEntryChanged", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "AccessControlExtensionChanged", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Basic Information", + "code": 40, + "mfgCode": null, + "define": "BASIC_INFORMATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DataModelRevision", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorName", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorID", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "vendor_id", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductName", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductID", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NodeLabel", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Location", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersion", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersionString", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersion", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersionString", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ManufacturingDate", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartNumber", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductURL", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "long_char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductLabel", + "code": 14, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SerialNumber", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LocalConfigDisabled", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Reachable", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UniqueID", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CapabilityMinima", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "CapabilityMinimaStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SpecificationVersion", + "code": 21, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxPathsPerInvoke", + "code": 22, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "StartUp", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "ShutDown", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "Leave", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "OTA Software Update Provider", + "code": 41, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "QueryImage", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "QueryImageResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ApplyUpdateRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ApplyUpdateResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "NotifyUpdateApplied", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "OTA Software Update Requestor", + "code": 42, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DefaultOTAProviders", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UpdatePossible", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "true", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UpdateState", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "UpdateStateEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UpdateStateProgress", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "General Commissioning", + "code": 48, + "mfgCode": null, + "define": "GENERAL_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ArmFailSafe", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ArmFailSafeResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "SetRegulatoryConfig", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "SetRegulatoryConfigResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "CommissioningComplete", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CommissioningCompleteResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "Breadcrumb", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BasicCommissioningInfo", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "BasicCommissioningInfo", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RegulatoryConfig", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LocationCapability", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportsConcurrentConnection", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Network Commissioning", + "code": 49, + "mfgCode": null, + "define": "NETWORK_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ScanNetworks", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ScanNetworksResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "AddOrUpdateWiFiNetwork", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RemoveNetwork", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "NetworkConfigResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ConnectNetwork", + "code": 6, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ConnectNetworkResponse", + "code": 7, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ReorderNetwork", + "code": 8, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "MaxNetworks", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Networks", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ScanMaxTimeSeconds", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ConnectMaxTimeSeconds", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "InterfaceEnabled", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkingStatus", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "NetworkCommissioningStatusEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkID", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastConnectErrorValue", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int32s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Diagnostic Logs", + "code": 50, + "mfgCode": null, + "define": "DIAGNOSTIC_LOGS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "RetrieveLogsRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RetrieveLogsResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "General Diagnostics", + "code": 51, + "mfgCode": null, + "define": "GENERAL_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "TestEventTrigger", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "NetworkInterfaces", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RebootCount", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TotalOperationalHours", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BootReason", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "BootReasonEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveHardwareFaults", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveRadioFaults", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveNetworkFaults", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TestEventTriggersEnabled", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "false", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "HardwareFaultChange", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "RadioFaultChange", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "NetworkFaultChange", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "BootReason", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Thread Network Diagnostics", + "code": 53, + "mfgCode": null, + "define": "THREAD_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "Channel", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "RoutingRole", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "RoutingRoleEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NetworkName", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PanId", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ExtendedPanId", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MeshLocalPrefix", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NeighborTable", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "RouteTable", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartitionId", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Weighting", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "DataVersion", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "StableDataVersion", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LeaderRouterId", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SecurityPolicy", + "code": 59, + "mfgCode": null, + "side": "server", + "type": "SecurityPolicy", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ChannelPage0Mask", + "code": 60, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OperationalDatasetComponents", + "code": 61, + "mfgCode": null, + "side": "server", + "type": "OperationalDatasetComponents", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveNetworkFaultsList", + "code": 62, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Administrator Commissioning", + "code": 60, + "mfgCode": null, + "define": "ADMINISTRATOR_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "OpenCommissioningWindow", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RevokeCommissioning", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "WindowStatus", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "CommissioningWindowStatusEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AdminFabricIndex", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "fabric_idx", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AdminVendorId", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "vendor_id", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Operational Credentials", + "code": 62, + "mfgCode": null, + "define": "OPERATIONAL_CREDENTIALS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "AttestationRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "AttestationResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "CertificateChainRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CertificateChainResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "CSRRequest", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CSRResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "AddNOC", + "code": 6, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "UpdateNOC", + "code": 7, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "NOCResponse", + "code": 8, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "UpdateFabricLabel", + "code": 9, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RemoveFabric", + "code": 10, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "AddTrustedRootCertificate", + "code": 11, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "NOCs", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Fabrics", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SupportedFabrics", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CommissionedFabrics", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TrustedRootCertificates", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentFabricIndex", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Group Key Management", + "code": 63, + "mfgCode": null, + "define": "GROUP_KEY_MANAGEMENT_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "KeySetWrite", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetRead", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetReadResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "KeySetRemove", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetReadAllIndices", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetReadAllIndicesResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "GroupKeyMap", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GroupTable", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxGroupsPerFabric", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxGroupKeysPerFabric", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + }, + { + "id": 2, + "name": "MA-refrigerator", + "deviceTypeRef": { + "code": 112, + "profileId": 259, + "label": "MA-refrigerator", + "name": "MA-refrigerator", + "deviceTypeOrder": 0 + }, + "deviceTypes": [ + { + "code": 112, + "profileId": 259, + "label": "MA-refrigerator", + "name": "MA-refrigerator", + "deviceTypeOrder": 0 + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 112 + ], + "deviceTypeName": "MA-refrigerator", + "deviceTypeCode": 112, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Refrigerator And Temperature Controlled Cabinet Mode", + "code": 82, + "mfgCode": null, + "define": "REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ChangeToMode", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ChangeToModeResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "SupportedModes", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentMode", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Refrigerator Alarm", + "code": 87, + "mfgCode": null, + "define": "REFRIGERATOR_ALARM_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "Mask", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "AlarmBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "State", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "AlarmBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Supported", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "AlarmBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + }, + { + "id": 3, + "name": "Anonymous Endpoint Type", + "deviceTypeRef": { + "code": 113, + "profileId": 259, + "label": "MA-temperature-controlled-cabinet", + "name": "MA-temperature-controlled-cabinet", + "deviceTypeOrder": 0 + }, + "deviceTypes": [ + { + "code": 113, + "profileId": 259, + "label": "MA-temperature-controlled-cabinet", + "name": "MA-temperature-controlled-cabinet", + "deviceTypeOrder": 0 + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 113 + ], + "deviceTypeName": "MA-temperature-controlled-cabinet", + "deviceTypeCode": 113, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Temperature Control", + "code": 86, + "mfgCode": null, + "define": "TEMPERATURE_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "SetTemperature", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "TemperatureSetpoint", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinTemperature", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxTemperature", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Step", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + }, + { + "id": 4, + "name": "Anonymous Endpoint Type", + "deviceTypeRef": { + "code": 113, + "profileId": 259, + "label": "MA-temperature-controlled-cabinet", + "name": "MA-temperature-controlled-cabinet", + "deviceTypeOrder": 0 + }, + "deviceTypes": [ + { + "code": 113, + "profileId": 259, + "label": "MA-temperature-controlled-cabinet", + "name": "MA-temperature-controlled-cabinet", + "deviceTypeOrder": 0 + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 113 + ], + "deviceTypeName": "MA-temperature-controlled-cabinet", + "deviceTypeCode": 113, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Temperature Control", + "code": 86, + "mfgCode": null, + "define": "TEMPERATURE_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "SetTemperature", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "TemperatureSetpoint", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinTemperature", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxTemperature", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Step", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + } + ], + "endpoints": [ + { + "endpointTypeName": "MA-rootdevice", + "endpointTypeIndex": 0, + "profileId": 259, + "endpointId": 0, + "networkId": 0, + "parentEndpointIdentifier": null + }, + { + "endpointTypeName": "MA-refrigerator", + "endpointTypeIndex": 1, + "profileId": 259, + "endpointId": 1, + "networkId": 0, + "parentEndpointIdentifier": null + }, + { + "endpointTypeName": "Anonymous Endpoint Type", + "endpointTypeIndex": 2, + "profileId": 259, + "endpointId": 2, + "networkId": 0, + "parentEndpointIdentifier": null + }, + { + "endpointTypeName": "Anonymous Endpoint Type", + "endpointTypeIndex": 3, + "profileId": 259, + "endpointId": 3, + "networkId": 0, + "parentEndpointIdentifier": null + } + ] +} \ No newline at end of file diff --git a/examples/refrigerator-app/silabs/data_model/refrigerator-wifi-app.matter b/examples/refrigerator-app/silabs/data_model/refrigerator-wifi-app.matter new file mode 100644 index 0000000000..346471b31b --- /dev/null +++ b/examples/refrigerator-app/silabs/data_model/refrigerator-wifi-app.matter @@ -0,0 +1,1908 @@ +// This IDL was generated automatically by ZAP. +// It is for view/code review purposes only. + +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum AtomicRequestTypeEnum : enum8 { + kBeginWrite = 0; + kCommitWrite = 1; + kRollbackWrite = 2; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; +} + +enum RelativePositionTag : enum8 { + kUnder = 0; + kNextTo = 1; + kAround = 2; + kOn = 3; + kAbove = 4; + kFrontOf = 5; + kBehind = 6; +} + +enum TestGlobalEnum : enum8 { + kSomeValue = 0; + kSomeOtherValue = 1; + kFinalValue = 2; +} + +enum ThreeLevelAutoEnum : enum8 { + kLow = 0; + kMedium = 1; + kHigh = 2; + kAutomatic = 3; +} + +bitmap TestGlobalBitmap : bitmap32 { + kFirstBit = 0x1; + kSecondBit = 0x2; +} + +struct TestGlobalStruct { + char_string<128> name = 0; + nullable TestGlobalBitmap myBitmap = 1; + optional nullable TestGlobalEnum myEnum = 2; +} + +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + +struct AtomicAttributeStatusStruct { + attrib_id attributeID = 0; + status statusCode = 1; +} + +/** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ +cluster Descriptor = 29 { + revision 2; + + bitmap Feature : bitmap32 { + kTagList = 0x1; + } + + struct DeviceTypeStruct { + devtype_id deviceType = 0; + int16u revision = 1; + } + + struct SemanticTagStruct { + nullable vendor_id mfgCode = 0; + enum8 namespaceID = 1; + enum8 tag = 2; + optional nullable char_string label = 3; + } + + readonly attribute DeviceTypeStruct deviceTypeList[] = 0; + readonly attribute cluster_id serverList[] = 1; + readonly attribute cluster_id clientList[] = 2; + readonly attribute endpoint_no partsList[] = 3; + readonly attribute optional SemanticTagStruct tagList[] = 4; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** The Access Control Cluster exposes a data model view of a + Node's Access Control List (ACL), which codifies the rules used to manage + and enforce Access Control for the Node's endpoints and their associated + cluster instances. */ +cluster AccessControl = 31 { + revision 2; + + enum AccessControlEntryAuthModeEnum : enum8 { + kPASE = 1; + kCASE = 2; + kGroup = 3; + } + + enum AccessControlEntryPrivilegeEnum : enum8 { + kView = 1; + kProxyView = 2; + kOperate = 3; + kManage = 4; + kAdminister = 5; + } + + enum AccessRestrictionTypeEnum : enum8 { + kAttributeAccessForbidden = 0; + kAttributeWriteForbidden = 1; + kCommandForbidden = 2; + kEventForbidden = 3; + } + + enum ChangeTypeEnum : enum8 { + kChanged = 0; + kAdded = 1; + kRemoved = 2; + } + + bitmap Feature : bitmap32 { + kExtension = 0x1; + kManagedDevice = 0x2; + } + + struct AccessRestrictionStruct { + AccessRestrictionTypeEnum type = 0; + nullable int32u id = 1; + } + + struct CommissioningAccessRestrictionEntryStruct { + endpoint_no endpoint = 0; + cluster_id cluster = 1; + AccessRestrictionStruct restrictions[] = 2; + } + + fabric_scoped struct AccessRestrictionEntryStruct { + fabric_sensitive endpoint_no endpoint = 0; + fabric_sensitive cluster_id cluster = 1; + fabric_sensitive AccessRestrictionStruct restrictions[] = 2; + fabric_idx fabricIndex = 254; + } + + struct AccessControlTargetStruct { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + + fabric_scoped struct AccessControlEntryStruct { + fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; + fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; + nullable fabric_sensitive int64u subjects[] = 3; + nullable fabric_sensitive AccessControlTargetStruct targets[] = 4; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct AccessControlExtensionStruct { + fabric_sensitive octet_string<128> data = 1; + fabric_idx fabricIndex = 254; + } + + fabric_sensitive info event access(read: administer) AccessControlEntryChanged = 0 { + nullable node_id adminNodeID = 1; + nullable int16u adminPasscodeID = 2; + ChangeTypeEnum changeType = 3; + nullable AccessControlEntryStruct latestValue = 4; + fabric_idx fabricIndex = 254; + } + + fabric_sensitive info event access(read: administer) AccessControlExtensionChanged = 1 { + nullable node_id adminNodeID = 1; + nullable int16u adminPasscodeID = 2; + ChangeTypeEnum changeType = 3; + nullable AccessControlExtensionStruct latestValue = 4; + fabric_idx fabricIndex = 254; + } + + fabric_sensitive info event access(read: administer) FabricRestrictionReviewUpdate = 2 { + int64u token = 0; + optional long_char_string instruction = 1; + optional long_char_string ARLRequestFlowUrl = 2; + fabric_idx fabricIndex = 254; + } + + attribute access(read: administer, write: administer) AccessControlEntryStruct acl[] = 0; + attribute access(read: administer, write: administer) optional AccessControlExtensionStruct extension[] = 1; + readonly attribute int16u subjectsPerAccessControlEntry = 2; + readonly attribute int16u targetsPerAccessControlEntry = 3; + readonly attribute int16u accessControlEntriesPerFabric = 4; + readonly attribute optional CommissioningAccessRestrictionEntryStruct commissioningARL[] = 5; + readonly attribute optional AccessRestrictionEntryStruct arl[] = 6; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ReviewFabricRestrictionsRequest { + CommissioningAccessRestrictionEntryStruct arl[] = 0; + } + + response struct ReviewFabricRestrictionsResponse = 1 { + int64u token = 0; + } + + /** This command signals to the service associated with the device vendor that the fabric administrator would like a review of the current restrictions on the accessing fabric. */ + fabric command access(invoke: administer) ReviewFabricRestrictions(ReviewFabricRestrictionsRequest): ReviewFabricRestrictionsResponse = 0; +} + +/** This cluster provides attributes and events for determining basic information about Nodes, which supports both + Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, + which apply to the whole Node. Also allows setting user device information such as location. */ +cluster BasicInformation = 40 { + revision 3; + + enum ColorEnum : enum8 { + kBlack = 0; + kNavy = 1; + kGreen = 2; + kTeal = 3; + kMaroon = 4; + kPurple = 5; + kOlive = 6; + kGray = 7; + kBlue = 8; + kLime = 9; + kAqua = 10; + kRed = 11; + kFuchsia = 12; + kYellow = 13; + kWhite = 14; + kNickel = 15; + kChrome = 16; + kBrass = 17; + kCopper = 18; + kSilver = 19; + kGold = 20; + } + + enum ProductFinishEnum : enum8 { + kOther = 0; + kMatte = 1; + kSatin = 2; + kPolished = 3; + kRugged = 4; + kFabric = 5; + } + + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + + struct ProductAppearanceStruct { + ProductFinishEnum finish = 0; + nullable ColorEnum primaryColor = 1; + } + + critical event StartUp = 0 { + int32u softwareVersion = 0; + } + + critical event ShutDown = 1 { + } + + info event Leave = 2 { + fabric_idx fabricIndex = 0; + } + + info event ReachableChanged = 3 { + boolean reachableNewValue = 0; + } + + readonly attribute int16u dataModelRevision = 0; + readonly attribute char_string<32> vendorName = 1; + readonly attribute vendor_id vendorID = 2; + readonly attribute char_string<32> productName = 3; + readonly attribute int16u productID = 4; + attribute access(write: manage) char_string<32> nodeLabel = 5; + attribute access(write: administer) char_string<2> location = 6; + readonly attribute int16u hardwareVersion = 7; + readonly attribute char_string<64> hardwareVersionString = 8; + readonly attribute int32u softwareVersion = 9; + readonly attribute char_string<64> softwareVersionString = 10; + readonly attribute optional char_string<16> manufacturingDate = 11; + readonly attribute optional char_string<32> partNumber = 12; + readonly attribute optional long_char_string<256> productURL = 13; + readonly attribute optional char_string<64> productLabel = 14; + readonly attribute optional char_string<32> serialNumber = 15; + attribute access(write: manage) optional boolean localConfigDisabled = 16; + readonly attribute optional boolean reachable = 17; + readonly attribute char_string<32> uniqueID = 18; + readonly attribute CapabilityMinimaStruct capabilityMinima = 19; + readonly attribute optional ProductAppearanceStruct productAppearance = 20; + readonly attribute int32u specificationVersion = 21; + readonly attribute int16u maxPathsPerInvoke = 22; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + command MfgSpecificPing(): DefaultSuccess = 0; +} + +/** Provides an interface for providing OTA software updates */ +cluster OtaSoftwareUpdateProvider = 41 { + revision 1; // NOTE: Default/not specifically set + + enum ApplyUpdateActionEnum : enum8 { + kProceed = 0; + kAwaitNextAction = 1; + kDiscontinue = 2; + } + + enum DownloadProtocolEnum : enum8 { + kBDXSynchronous = 0; + kBDXAsynchronous = 1; + kHTTPS = 2; + kVendorSpecific = 3; + } + + enum StatusEnum : enum8 { + kUpdateAvailable = 0; + kBusy = 1; + kNotAvailable = 2; + kDownloadProtocolNotSupported = 3; + } + + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct QueryImageRequest { + vendor_id vendorID = 0; + int16u productID = 1; + int32u softwareVersion = 2; + DownloadProtocolEnum protocolsSupported[] = 3; + optional int16u hardwareVersion = 4; + optional char_string<2> location = 5; + optional boolean requestorCanConsent = 6; + optional octet_string<512> metadataForProvider = 7; + } + + response struct QueryImageResponse = 1 { + StatusEnum status = 0; + optional int32u delayedActionTime = 1; + optional char_string<256> imageURI = 2; + optional int32u softwareVersion = 3; + optional char_string<64> softwareVersionString = 4; + optional octet_string<32> updateToken = 5; + optional boolean userConsentNeeded = 6; + optional octet_string<512> metadataForRequestor = 7; + } + + request struct ApplyUpdateRequestRequest { + octet_string<32> updateToken = 0; + int32u newVersion = 1; + } + + response struct ApplyUpdateResponse = 3 { + ApplyUpdateActionEnum action = 0; + int32u delayedActionTime = 1; + } + + request struct NotifyUpdateAppliedRequest { + octet_string<32> updateToken = 0; + int32u softwareVersion = 1; + } + + /** Determine availability of a new Software Image */ + command QueryImage(QueryImageRequest): QueryImageResponse = 0; + /** Determine next action to take for a downloaded Software Image */ + command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; + /** Notify OTA Provider that an update was applied */ + command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; +} + +/** Provides an interface for downloading and applying OTA software updates */ +cluster OtaSoftwareUpdateRequestor = 42 { + revision 1; // NOTE: Default/not specifically set + + enum AnnouncementReasonEnum : enum8 { + kSimpleAnnouncement = 0; + kUpdateAvailable = 1; + kUrgentUpdateAvailable = 2; + } + + enum ChangeReasonEnum : enum8 { + kUnknown = 0; + kSuccess = 1; + kFailure = 2; + kTimeOut = 3; + kDelayByProvider = 4; + } + + enum UpdateStateEnum : enum8 { + kUnknown = 0; + kIdle = 1; + kQuerying = 2; + kDelayedOnQuery = 3; + kDownloading = 4; + kApplying = 5; + kDelayedOnApply = 6; + kRollingBack = 7; + kDelayedOnUserConsent = 8; + } + + fabric_scoped struct ProviderLocation { + node_id providerNodeID = 1; + endpoint_no endpoint = 2; + fabric_idx fabricIndex = 254; + } + + info event StateTransition = 0 { + UpdateStateEnum previousState = 0; + UpdateStateEnum newState = 1; + ChangeReasonEnum reason = 2; + nullable int32u targetSoftwareVersion = 3; + } + + critical event VersionApplied = 1 { + int32u softwareVersion = 0; + int16u productID = 1; + } + + info event DownloadError = 2 { + int32u softwareVersion = 0; + int64u bytesDownloaded = 1; + nullable int8u progressPercent = 2; + nullable int64s platformCode = 3; + } + + attribute access(write: administer) ProviderLocation defaultOTAProviders[] = 0; + readonly attribute boolean updatePossible = 1; + readonly attribute UpdateStateEnum updateState = 2; + readonly attribute nullable int8u updateStateProgress = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AnnounceOTAProviderRequest { + node_id providerNodeID = 0; + vendor_id vendorID = 1; + AnnouncementReasonEnum announcementReason = 2; + optional octet_string<512> metadataForNode = 3; + endpoint_no endpoint = 4; + } + + /** Announce the presence of an OTA Provider */ + command AnnounceOTAProvider(AnnounceOTAProviderRequest): DefaultSuccess = 0; +} + +/** This cluster is used to manage global aspects of the Commissioning flow. */ +cluster GeneralCommissioning = 48 { + revision 1; // NOTE: Default/not specifically set + + enum CommissioningErrorEnum : enum8 { + kOK = 0; + kValueOutsideRange = 1; + kInvalidAuthentication = 2; + kNoFailSafe = 3; + kBusyWithOtherAdmin = 4; + kRequiredTCNotAccepted = 5; + kTCAcknowledgementsNotReceived = 6; + kTCMinVersionNotMet = 7; + } + + enum RegulatoryLocationTypeEnum : enum8 { + kIndoor = 0; + kOutdoor = 1; + kIndoorOutdoor = 2; + } + + bitmap Feature : bitmap32 { + kTermsAndConditions = 0x1; + } + + struct BasicCommissioningInfo { + int16u failSafeExpiryLengthSeconds = 0; + int16u maxCumulativeFailsafeSeconds = 1; + } + + attribute access(write: administer) int64u breadcrumb = 0; + readonly attribute BasicCommissioningInfo basicCommissioningInfo = 1; + readonly attribute RegulatoryLocationTypeEnum regulatoryConfig = 2; + readonly attribute RegulatoryLocationTypeEnum locationCapability = 3; + readonly attribute boolean supportsConcurrentConnection = 4; + provisional readonly attribute access(read: administer) optional int16u TCAcceptedVersion = 5; + provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; + provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; + provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ArmFailSafeRequest { + int16u expiryLengthSeconds = 0; + int64u breadcrumb = 1; + } + + response struct ArmFailSafeResponse = 1 { + CommissioningErrorEnum errorCode = 0; + char_string<128> debugText = 1; + } + + request struct SetRegulatoryConfigRequest { + RegulatoryLocationTypeEnum newRegulatoryConfig = 0; + char_string<2> countryCode = 1; + int64u breadcrumb = 2; + } + + response struct SetRegulatoryConfigResponse = 3 { + CommissioningErrorEnum errorCode = 0; + char_string debugText = 1; + } + + response struct CommissioningCompleteResponse = 5 { + CommissioningErrorEnum errorCode = 0; + char_string debugText = 1; + } + + request struct SetTCAcknowledgementsRequest { + int16u TCVersion = 0; + bitmap16 TCUserResponse = 1; + } + + response struct SetTCAcknowledgementsResponse = 7 { + CommissioningErrorEnum errorCode = 0; + } + + /** Arm the persistent fail-safe timer with an expiry time of now + ExpiryLengthSeconds using device clock */ + command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; + /** Set the regulatory configuration to be used during commissioning */ + command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; + /** Signals the Server that the Client has successfully completed all steps of Commissioning/Recofiguration needed during fail-safe period. */ + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + /** This command sets the user acknowledgements received in the Enhanced Setup Flow Terms and Conditions into the node. */ + command access(invoke: administer) SetTCAcknowledgements(SetTCAcknowledgementsRequest): SetTCAcknowledgementsResponse = 6; +} + +/** Functionality to configure, enable, disable network credentials and access on a Matter device. */ +cluster NetworkCommissioning = 49 { + revision 1; // NOTE: Default/not specifically set + + enum NetworkCommissioningStatusEnum : enum8 { + kSuccess = 0; + kOutOfRange = 1; + kBoundsExceeded = 2; + kNetworkIDNotFound = 3; + kDuplicateNetworkID = 4; + kNetworkNotFound = 5; + kRegulatoryError = 6; + kAuthFailure = 7; + kUnsupportedSecurity = 8; + kOtherConnectionFailure = 9; + kIPV6Failed = 10; + kIPBindFailed = 11; + kUnknownError = 12; + } + + enum WiFiBandEnum : enum8 { + k2G4 = 0; + k3G65 = 1; + k5G = 2; + k6G = 3; + k60G = 4; + k1G = 5; + } + + bitmap Feature : bitmap32 { + kWiFiNetworkInterface = 0x1; + kThreadNetworkInterface = 0x2; + kEthernetNetworkInterface = 0x4; + kPerDeviceCredentials = 0x8; + } + + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { + kUnencrypted = 0x1; + kWEP = 0x2; + kWPAPersonal = 0x4; + kWPA2Personal = 0x8; + kWPA3Personal = 0x10; + kWPA3MatterPDC = 0x20; + } + + struct NetworkInfoStruct { + octet_string<32> networkID = 0; + boolean connected = 1; + optional nullable octet_string<20> networkIdentifier = 2; + optional nullable octet_string<20> clientIdentifier = 3; + } + + struct ThreadInterfaceScanResultStruct { + int16u panId = 0; + int64u extendedPanId = 1; + char_string<16> networkName = 2; + int16u channel = 3; + int8u version = 4; + octet_string<8> extendedAddress = 5; + int8s rssi = 6; + int8u lqi = 7; + } + + struct WiFiInterfaceScanResultStruct { + WiFiSecurityBitmap security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBandEnum wiFiBand = 4; + int8s rssi = 5; + } + + readonly attribute access(read: administer) int8u maxNetworks = 0; + readonly attribute access(read: administer) NetworkInfoStruct networks[] = 1; + readonly attribute optional int8u scanMaxTimeSeconds = 2; + readonly attribute optional int8u connectMaxTimeSeconds = 3; + attribute access(write: administer) boolean interfaceEnabled = 4; + readonly attribute access(read: administer) nullable NetworkCommissioningStatusEnum lastNetworkingStatus = 5; + readonly attribute access(read: administer) nullable octet_string<32> lastNetworkID = 6; + readonly attribute access(read: administer) nullable int32s lastConnectErrorValue = 7; + provisional readonly attribute optional WiFiBandEnum supportedWiFiBands[] = 8; + provisional readonly attribute optional ThreadCapabilitiesBitmap supportedThreadFeatures = 9; + provisional readonly attribute optional int16u threadVersion = 10; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ScanNetworksRequest { + optional nullable octet_string<32> ssid = 0; + optional int64u breadcrumb = 1; + } + + response struct ScanNetworksResponse = 1 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional char_string debugText = 1; + optional WiFiInterfaceScanResultStruct wiFiScanResults[] = 2; + optional ThreadInterfaceScanResultStruct threadScanResults[] = 3; + } + + request struct AddOrUpdateWiFiNetworkRequest { + octet_string<32> ssid = 0; + octet_string<64> credentials = 1; + optional int64u breadcrumb = 2; + optional octet_string<140> networkIdentity = 3; + optional octet_string<20> clientIdentifier = 4; + optional octet_string<32> possessionNonce = 5; + } + + request struct AddOrUpdateThreadNetworkRequest { + octet_string<254> operationalDataset = 0; + optional int64u breadcrumb = 1; + } + + request struct RemoveNetworkRequest { + octet_string<32> networkID = 0; + optional int64u breadcrumb = 1; + } + + response struct NetworkConfigResponse = 5 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional char_string<512> debugText = 1; + optional int8u networkIndex = 2; + optional octet_string<140> clientIdentity = 3; + optional octet_string<64> possessionSignature = 4; + } + + request struct ConnectNetworkRequest { + octet_string<32> networkID = 0; + optional int64u breadcrumb = 1; + } + + response struct ConnectNetworkResponse = 7 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional char_string debugText = 1; + nullable int32s errorValue = 2; + } + + request struct ReorderNetworkRequest { + octet_string<32> networkID = 0; + int8u networkIndex = 1; + optional int64u breadcrumb = 2; + } + + request struct QueryIdentityRequest { + octet_string<20> keyIdentifier = 0; + optional octet_string<32> possessionNonce = 1; + } + + response struct QueryIdentityResponse = 10 { + octet_string<140> identity = 0; + optional octet_string<64> possessionSignature = 1; + } + + /** Detemine the set of networks the device sees as available. */ + command access(invoke: administer) ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; + /** Add or update the credentials for a given Wi-Fi network. */ + command access(invoke: administer) AddOrUpdateWiFiNetwork(AddOrUpdateWiFiNetworkRequest): NetworkConfigResponse = 2; + /** Add or update the credentials for a given Thread network. */ + command access(invoke: administer) AddOrUpdateThreadNetwork(AddOrUpdateThreadNetworkRequest): NetworkConfigResponse = 3; + /** Remove the definition of a given network (including its credentials). */ + command access(invoke: administer) RemoveNetwork(RemoveNetworkRequest): NetworkConfigResponse = 4; + /** Connect to the specified network, using previously-defined credentials. */ + command access(invoke: administer) ConnectNetwork(ConnectNetworkRequest): ConnectNetworkResponse = 6; + /** Modify the order in which networks will be presented in the Networks attribute. */ + command access(invoke: administer) ReorderNetwork(ReorderNetworkRequest): NetworkConfigResponse = 8; + /** Retrieve details about and optionally proof of possession of a network client identity. */ + command access(invoke: administer) QueryIdentity(QueryIdentityRequest): QueryIdentityResponse = 9; +} + +/** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ +cluster DiagnosticLogs = 50 { + revision 1; // NOTE: Default/not specifically set + + enum IntentEnum : enum8 { + kEndUserSupport = 0; + kNetworkDiag = 1; + kCrashLogs = 2; + } + + enum StatusEnum : enum8 { + kSuccess = 0; + kExhausted = 1; + kNoLogs = 2; + kBusy = 3; + kDenied = 4; + } + + enum TransferProtocolEnum : enum8 { + kResponsePayload = 0; + kBDX = 1; + } + + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct RetrieveLogsRequestRequest { + IntentEnum intent = 0; + TransferProtocolEnum requestedProtocol = 1; + optional char_string<32> transferFileDesignator = 2; + } + + response struct RetrieveLogsResponse = 1 { + StatusEnum status = 0; + long_octet_string logContent = 1; + optional epoch_us UTCTimeStamp = 2; + optional systime_us timeSinceBoot = 3; + } + + /** Retrieving diagnostic logs from a Node */ + command RetrieveLogsRequest(RetrieveLogsRequestRequest): RetrieveLogsResponse = 0; +} + +/** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ +cluster GeneralDiagnostics = 51 { + revision 2; + + enum BootReasonEnum : enum8 { + kUnspecified = 0; + kPowerOnReboot = 1; + kBrownOutReset = 2; + kSoftwareWatchdogReset = 3; + kHardwareWatchdogReset = 4; + kSoftwareUpdateCompleted = 5; + kSoftwareReset = 6; + } + + enum HardwareFaultEnum : enum8 { + kUnspecified = 0; + kRadio = 1; + kSensor = 2; + kResettableOverTemp = 3; + kNonResettableOverTemp = 4; + kPowerSource = 5; + kVisualDisplayFault = 6; + kAudioOutputFault = 7; + kUserInterfaceFault = 8; + kNonVolatileMemoryError = 9; + kTamperDetected = 10; + } + + enum InterfaceTypeEnum : enum8 { + kUnspecified = 0; + kWiFi = 1; + kEthernet = 2; + kCellular = 3; + kThread = 4; + } + + enum NetworkFaultEnum : enum8 { + kUnspecified = 0; + kHardwareFailure = 1; + kNetworkJammed = 2; + kConnectionFailed = 3; + } + + enum RadioFaultEnum : enum8 { + kUnspecified = 0; + kWiFiFault = 1; + kCellularFault = 2; + kThreadFault = 3; + kNFCFault = 4; + kBLEFault = 5; + kEthernetFault = 6; + } + + bitmap Feature : bitmap32 { + kDataModelTest = 0x1; + } + + struct NetworkInterface { + char_string<32> name = 0; + boolean isOperational = 1; + nullable boolean offPremiseServicesReachableIPv4 = 2; + nullable boolean offPremiseServicesReachableIPv6 = 3; + octet_string<8> hardwareAddress = 4; + octet_string IPv4Addresses[] = 5; + octet_string IPv6Addresses[] = 6; + InterfaceTypeEnum type = 7; + } + + critical event HardwareFaultChange = 0 { + HardwareFaultEnum current[] = 0; + HardwareFaultEnum previous[] = 1; + } + + critical event RadioFaultChange = 1 { + RadioFaultEnum current[] = 0; + RadioFaultEnum previous[] = 1; + } + + critical event NetworkFaultChange = 2 { + NetworkFaultEnum current[] = 0; + NetworkFaultEnum previous[] = 1; + } + + critical event BootReason = 3 { + BootReasonEnum bootReason = 0; + } + + readonly attribute NetworkInterface networkInterfaces[] = 0; + readonly attribute int16u rebootCount = 1; + readonly attribute optional int64u upTime = 2; + readonly attribute optional int32u totalOperationalHours = 3; + readonly attribute optional BootReasonEnum bootReason = 4; + readonly attribute optional HardwareFaultEnum activeHardwareFaults[] = 5; + readonly attribute optional RadioFaultEnum activeRadioFaults[] = 6; + readonly attribute optional NetworkFaultEnum activeNetworkFaults[] = 7; + readonly attribute boolean testEventTriggersEnabled = 8; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct TestEventTriggerRequest { + octet_string<16> enableKey = 0; + int64u eventTrigger = 1; + } + + response struct TimeSnapshotResponse = 2 { + systime_ms systemTimeMs = 0; + nullable posix_ms posixTimeMs = 1; + } + + request struct PayloadTestRequestRequest { + octet_string<16> enableKey = 0; + int8u value = 1; + int16u count = 2; + } + + response struct PayloadTestResponse = 4 { + octet_string payload = 0; + } + + /** Provide a means for certification tests to trigger some test-plan-specific events */ + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + /** Take a snapshot of system time and epoch time. */ + command TimeSnapshot(): TimeSnapshotResponse = 1; + /** Request a variable length payload response. */ + command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3; +} + +/** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ +cluster WiFiNetworkDiagnostics = 54 { + revision 1; // NOTE: Default/not specifically set + + enum AssociationFailureCauseEnum : enum8 { + kUnknown = 0; + kAssociationFailed = 1; + kAuthenticationFailed = 2; + kSsidNotFound = 3; + } + + enum ConnectionStatusEnum : enum8 { + kConnected = 0; + kNotConnected = 1; + } + + enum SecurityTypeEnum : enum8 { + kUnspecified = 0; + kNone = 1; + kWEP = 2; + kWPA = 3; + kWPA2 = 4; + kWPA3 = 5; + } + + enum WiFiVersionEnum : enum8 { + kA = 0; + kB = 1; + kG = 2; + kN = 3; + kAc = 4; + kAx = 5; + kAh = 6; + } + + bitmap Feature : bitmap32 { + kPacketCounts = 0x1; + kErrorCounts = 0x2; + } + + info event Disconnection = 0 { + int16u reasonCode = 0; + } + + info event AssociationFailure = 1 { + AssociationFailureCauseEnum associationFailureCause = 0; + int16u status = 1; + } + + info event ConnectionStatus = 2 { + ConnectionStatusEnum connectionStatus = 0; + } + + readonly attribute nullable octet_string<6> bssid = 0; + readonly attribute nullable SecurityTypeEnum securityType = 1; + readonly attribute nullable WiFiVersionEnum wiFiVersion = 2; + readonly attribute nullable int16u channelNumber = 3; + readonly attribute nullable int8s rssi = 4; + readonly attribute optional nullable int32u beaconLostCount = 5; + readonly attribute optional nullable int32u beaconRxCount = 6; + readonly attribute optional nullable int32u packetMulticastRxCount = 7; + readonly attribute optional nullable int32u packetMulticastTxCount = 8; + readonly attribute optional nullable int32u packetUnicastRxCount = 9; + readonly attribute optional nullable int32u packetUnicastTxCount = 10; + readonly attribute optional nullable int64u currentMaxRate = 11; + readonly attribute optional nullable int64u overrunCount = 12; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + /** Reception of this command SHALL reset the Breacon and Packet related count attributes to 0 */ + command ResetCounts(): DefaultSuccess = 0; +} + +/** Commands to trigger a Node to allow a new Administrator to commission it. */ +cluster AdministratorCommissioning = 60 { + revision 1; // NOTE: Default/not specifically set + + enum CommissioningWindowStatusEnum : enum8 { + kWindowNotOpen = 0; + kEnhancedWindowOpen = 1; + kBasicWindowOpen = 2; + } + + enum StatusCode : enum8 { + kBusy = 2; + kPAKEParameterError = 3; + kWindowNotOpen = 4; + } + + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable vendor_id adminVendorId = 2; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct OpenCommissioningWindowRequest { + int16u commissioningTimeout = 0; + octet_string PAKEPasscodeVerifier = 1; + int16u discriminator = 2; + int32u iterations = 3; + octet_string<32> salt = 4; + } + + request struct OpenBasicCommissioningWindowRequest { + int16u commissioningTimeout = 0; + } + + /** This command is used by a current Administrator to instruct a Node to go into commissioning mode using enhanced commissioning method. */ + timed command access(invoke: administer) OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0; + /** This command is used by a current Administrator to instruct a Node to go into commissioning mode using basic commissioning method, if the node supports it. */ + timed command access(invoke: administer) OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1; + /** This command is used by a current Administrator to instruct a Node to revoke any active Open Commissioning Window or Open Basic Commissioning Window command. */ + timed command access(invoke: administer) RevokeCommissioning(): DefaultSuccess = 2; +} + +/** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ +cluster OperationalCredentials = 62 { + revision 1; // NOTE: Default/not specifically set + + enum CertificateChainTypeEnum : enum8 { + kDACCertificate = 1; + kPAICertificate = 2; + } + + enum NodeOperationalCertStatusEnum : enum8 { + kOK = 0; + kInvalidPublicKey = 1; + kInvalidNodeOpId = 2; + kInvalidNOC = 3; + kMissingCsr = 4; + kTableFull = 5; + kInvalidAdminSubject = 6; + kFabricConflict = 9; + kLabelConflict = 10; + kInvalidFabricIndex = 11; + } + + fabric_scoped struct FabricDescriptorStruct { + octet_string<65> rootPublicKey = 1; + vendor_id vendorID = 2; + fabric_id fabricID = 3; + node_id nodeID = 4; + char_string<32> label = 5; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; + readonly attribute FabricDescriptorStruct fabrics[] = 1; + readonly attribute int8u supportedFabrics = 2; + readonly attribute int8u commissionedFabrics = 3; + readonly attribute octet_string trustedRootCertificates[] = 4; + readonly attribute int8u currentFabricIndex = 5; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AttestationRequestRequest { + octet_string<32> attestationNonce = 0; + } + + response struct AttestationResponse = 1 { + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; + } + + request struct CertificateChainRequestRequest { + CertificateChainTypeEnum certificateType = 0; + } + + response struct CertificateChainResponse = 3 { + octet_string<600> certificate = 0; + } + + request struct CSRRequestRequest { + octet_string<32> CSRNonce = 0; + optional boolean isForUpdateNOC = 1; + } + + response struct CSRResponse = 5 { + octet_string NOCSRElements = 0; + octet_string attestationSignature = 1; + } + + request struct AddNOCRequest { + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; + int64u caseAdminSubject = 3; + vendor_id adminVendorId = 4; + } + + request struct UpdateNOCRequest { + octet_string NOCValue = 0; + optional octet_string ICACValue = 1; + } + + response struct NOCResponse = 8 { + NodeOperationalCertStatusEnum statusCode = 0; + optional fabric_idx fabricIndex = 1; + optional char_string<128> debugText = 2; + } + + request struct UpdateFabricLabelRequest { + char_string<32> label = 0; + } + + request struct RemoveFabricRequest { + fabric_idx fabricIndex = 0; + } + + request struct AddTrustedRootCertificateRequest { + octet_string rootCACertificate = 0; + } + + /** Sender is requesting attestation information from the receiver. */ + command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; + /** Sender is requesting a device attestation certificate from the receiver. */ + command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; + /** Sender is requesting a certificate signing request (CSR) from the receiver. */ + command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; + /** Sender is requesting to add the new node operational certificates. */ + command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; + /** Sender is requesting to update the node operational certificates. */ + fabric command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; + /** This command SHALL be used by an Administrative Node to set the user-visible Label field for a given Fabric, as reflected by entries in the Fabrics attribute. */ + fabric command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + /** This command is used by Administrative Nodes to remove a given fabric index and delete all associated fabric-scoped data. */ + command access(invoke: administer) RemoveFabric(RemoveFabricRequest): NOCResponse = 10; + /** This command SHALL add a Trusted Root CA Certificate, provided as its CHIP Certificate representation. */ + command access(invoke: administer) AddTrustedRootCertificate(AddTrustedRootCertificateRequest): DefaultSuccess = 11; +} + +/** The Group Key Management Cluster is the mechanism by which group keys are managed. */ +cluster GroupKeyManagement = 63 { + revision 1; // NOTE: Default/not specifically set + + enum GroupKeySecurityPolicyEnum : enum8 { + kTrustFirst = 0; + kCacheAndSync = 1; + } + + bitmap Feature : bitmap32 { + kCacheAndSync = 0x1; + } + + fabric_scoped struct GroupInfoMapStruct { + group_id groupId = 1; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct GroupKeyMapStruct { + group_id groupId = 1; + int16u groupKeySetID = 2; + fabric_idx fabricIndex = 254; + } + + struct GroupKeySetStruct { + int16u groupKeySetID = 0; + GroupKeySecurityPolicyEnum groupKeySecurityPolicy = 1; + nullable octet_string<16> epochKey0 = 2; + nullable epoch_us epochStartTime0 = 3; + nullable octet_string<16> epochKey1 = 4; + nullable epoch_us epochStartTime1 = 5; + nullable octet_string<16> epochKey2 = 6; + nullable epoch_us epochStartTime2 = 7; + } + + attribute access(write: manage) GroupKeyMapStruct groupKeyMap[] = 0; + readonly attribute GroupInfoMapStruct groupTable[] = 1; + readonly attribute int16u maxGroupsPerFabric = 2; + readonly attribute int16u maxGroupKeysPerFabric = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct KeySetWriteRequest { + GroupKeySetStruct groupKeySet = 0; + } + + request struct KeySetReadRequest { + int16u groupKeySetID = 0; + } + + response struct KeySetReadResponse = 2 { + GroupKeySetStruct groupKeySet = 0; + } + + request struct KeySetRemoveRequest { + int16u groupKeySetID = 0; + } + + response struct KeySetReadAllIndicesResponse = 5 { + int16u groupKeySetIDs[] = 0; + } + + /** Write a new set of keys for the given key set id. */ + fabric command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; + /** Read the keys for a given key set id. */ + fabric command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; + /** Revoke a Root Key from a Group */ + fabric command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; + /** Return the list of Group Key Sets associated with the accessing fabric */ + fabric command access(invoke: administer) KeySetReadAllIndices(): KeySetReadAllIndicesResponse = 4; +} + +/** Attributes and commands for selecting a mode from a list of supported options. */ +cluster RefrigeratorAndTemperatureControlledCabinetMode = 82 { + revision 2; + + enum ModeTag : enum16 { + kAuto = 0; + kQuick = 1; + kQuiet = 2; + kLowNoise = 3; + kLowEnergy = 4; + kVacation = 5; + kMin = 6; + kMax = 7; + kNight = 8; + kDay = 9; + kRapidCool = 16384; + kRapidFreeze = 16385; + } + + bitmap Feature : bitmap32 { + kOnOff = 0x1; + } + + struct ModeTagStruct { + optional vendor_id mfgCode = 0; + enum16 value = 1; + } + + struct ModeOptionStruct { + char_string<64> label = 0; + int8u mode = 1; + ModeTagStruct modeTags[] = 2; + } + + readonly attribute ModeOptionStruct supportedModes[] = 0; + readonly attribute int8u currentMode = 1; + attribute optional nullable int8u startUpMode = 2; + attribute optional nullable int8u onMode = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ChangeToModeRequest { + int8u newMode = 0; + } + + response struct ChangeToModeResponse = 1 { + enum8 status = 0; + optional char_string statusText = 1; + } + + /** This command is used to change device modes. + On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */ + command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0; +} + +/** Attributes and commands for configuring the temperature control, and reporting temperature. */ +cluster TemperatureControl = 86 { + revision 1; // NOTE: Default/not specifically set + + bitmap Feature : bitmap32 { + kTemperatureNumber = 0x1; + kTemperatureLevel = 0x2; + kTemperatureStep = 0x4; + } + + readonly attribute optional temperature temperatureSetpoint = 0; + readonly attribute optional temperature minTemperature = 1; + readonly attribute optional temperature maxTemperature = 2; + readonly attribute optional temperature step = 3; + readonly attribute optional int8u selectedTemperatureLevel = 4; + readonly attribute optional char_string supportedTemperatureLevels[] = 5; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct SetTemperatureRequest { + optional temperature targetTemperature = 0; + optional int8u targetTemperatureLevel = 1; + } + + /** Set Temperature */ + command SetTemperature(SetTemperatureRequest): DefaultSuccess = 0; +} + +/** Attributes and commands for configuring the Refrigerator alarm. */ +cluster RefrigeratorAlarm = 87 { + revision 1; // NOTE: Default/not specifically set + + bitmap AlarmBitmap : bitmap32 { + kDoorOpen = 0x1; + } + + info event Notify = 0 { + AlarmBitmap active = 0; + AlarmBitmap inactive = 1; + AlarmBitmap state = 2; + AlarmBitmap mask = 3; + } + + readonly attribute AlarmBitmap mask = 0; + readonly attribute AlarmBitmap state = 2; + readonly attribute AlarmBitmap supported = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +endpoint 0 { + device type ma_rootdevice = 22, version 1; + + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + callback attribute featureMap; + callback attribute clusterRevision; + } + + server cluster AccessControl { + emits event AccessControlEntryChanged; + emits event AccessControlExtensionChanged; + callback attribute acl; + callback attribute extension; + callback attribute subjectsPerAccessControlEntry; + callback attribute targetsPerAccessControlEntry; + callback attribute accessControlEntriesPerFabric; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + callback attribute clusterRevision; + } + + server cluster BasicInformation { + emits event StartUp; + emits event ShutDown; + emits event Leave; + callback attribute dataModelRevision; + callback attribute vendorName; + callback attribute vendorID; + callback attribute productName; + callback attribute productID; + persist attribute nodeLabel; + callback attribute location; + callback attribute hardwareVersion; + callback attribute hardwareVersionString; + callback attribute softwareVersion; + callback attribute softwareVersionString; + callback attribute manufacturingDate; + callback attribute partNumber; + callback attribute productURL; + callback attribute productLabel; + callback attribute serialNumber; + persist attribute localConfigDisabled default = 0; + ram attribute reachable default = 1; + callback attribute uniqueID; + callback attribute capabilityMinima; + callback attribute specificationVersion; + callback attribute maxPathsPerInvoke; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 3; + } + + server cluster OtaSoftwareUpdateProvider { + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command QueryImage; + handle command QueryImageResponse; + handle command ApplyUpdateRequest; + handle command ApplyUpdateResponse; + handle command NotifyUpdateApplied; + } + + server cluster OtaSoftwareUpdateRequestor { + callback attribute defaultOTAProviders; + ram attribute updatePossible default = true; + ram attribute updateState default = 0; + ram attribute updateStateProgress; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster GeneralCommissioning { + ram attribute breadcrumb default = 0x0000000000000000; + callback attribute basicCommissioningInfo; + callback attribute regulatoryConfig; + callback attribute locationCapability; + callback attribute supportsConcurrentConnection; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command ArmFailSafe; + handle command ArmFailSafeResponse; + handle command SetRegulatoryConfig; + handle command SetRegulatoryConfigResponse; + handle command CommissioningComplete; + handle command CommissioningCompleteResponse; + } + + server cluster NetworkCommissioning { + ram attribute maxNetworks; + callback attribute networks; + ram attribute scanMaxTimeSeconds; + ram attribute connectMaxTimeSeconds; + ram attribute interfaceEnabled; + ram attribute lastNetworkingStatus; + ram attribute lastNetworkID; + ram attribute lastConnectErrorValue; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 2; + ram attribute clusterRevision default = 1; + + handle command ScanNetworks; + handle command ScanNetworksResponse; + handle command AddOrUpdateWiFiNetwork; + handle command RemoveNetwork; + handle command NetworkConfigResponse; + handle command ConnectNetwork; + handle command ConnectNetworkResponse; + handle command ReorderNetwork; + } + + server cluster DiagnosticLogs { + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command RetrieveLogsRequest; + handle command RetrieveLogsResponse; + } + + server cluster GeneralDiagnostics { + emits event HardwareFaultChange; + emits event RadioFaultChange; + emits event NetworkFaultChange; + emits event BootReason; + callback attribute networkInterfaces; + callback attribute rebootCount; + callback attribute upTime; + callback attribute totalOperationalHours; + callback attribute bootReason; + callback attribute activeHardwareFaults; + callback attribute activeRadioFaults; + callback attribute activeNetworkFaults; + callback attribute testEventTriggersEnabled default = false; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + callback attribute featureMap; + callback attribute clusterRevision; + + handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; + } + + server cluster WiFiNetworkDiagnostics { + emits event Disconnection; + emits event AssociationFailure; + emits event ConnectionStatus; + callback attribute bssid; + callback attribute securityType; + callback attribute wiFiVersion; + callback attribute channelNumber; + callback attribute rssi; + callback attribute beaconLostCount; + callback attribute beaconRxCount; + callback attribute packetMulticastRxCount; + callback attribute packetMulticastTxCount; + callback attribute packetUnicastRxCount; + callback attribute packetUnicastTxCount; + callback attribute currentMaxRate; + callback attribute overrunCount; + ram attribute featureMap default = 3; + ram attribute clusterRevision default = 1; + + handle command ResetCounts; + } + + server cluster AdministratorCommissioning { + callback attribute windowStatus; + callback attribute adminFabricIndex; + callback attribute adminVendorId; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command OpenCommissioningWindow; + handle command RevokeCommissioning; + } + + server cluster OperationalCredentials { + callback attribute NOCs; + callback attribute fabrics; + callback attribute supportedFabrics; + callback attribute commissionedFabrics; + callback attribute trustedRootCertificates; + callback attribute currentFabricIndex; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command AttestationRequest; + handle command AttestationResponse; + handle command CertificateChainRequest; + handle command CertificateChainResponse; + handle command CSRRequest; + handle command CSRResponse; + handle command AddNOC; + handle command UpdateNOC; + handle command NOCResponse; + handle command UpdateFabricLabel; + handle command RemoveFabric; + handle command AddTrustedRootCertificate; + } + + server cluster GroupKeyManagement { + callback attribute groupKeyMap; + callback attribute groupTable; + callback attribute maxGroupsPerFabric; + callback attribute maxGroupKeysPerFabric; + callback attribute featureMap; + callback attribute clusterRevision; + + handle command KeySetWrite; + handle command KeySetRead; + handle command KeySetReadResponse; + handle command KeySetRemove; + handle command KeySetReadAllIndices; + handle command KeySetReadAllIndicesResponse; + } +} +endpoint 1 { + device type ma_refrigerator = 112, version 1; + + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + callback attribute featureMap; + callback attribute clusterRevision; + } + + server cluster RefrigeratorAndTemperatureControlledCabinetMode { + callback attribute supportedModes; + callback attribute currentMode; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap; + ram attribute clusterRevision default = 2; + + handle command ChangeToMode; + handle command ChangeToModeResponse; + } + + server cluster RefrigeratorAlarm { + ram attribute mask default = 0; + ram attribute state default = 0; + ram attribute supported default = 0; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } +} +endpoint 2 { + device type ma_temperature_controlled_cabinet = 113, version 1; + + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + callback attribute featureMap; + callback attribute clusterRevision; + } + + server cluster TemperatureControl { + ram attribute temperatureSetpoint; + ram attribute minTemperature; + ram attribute maxTemperature; + ram attribute step; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 1; + ram attribute clusterRevision default = 1; + + handle command SetTemperature; + } +} +endpoint 3 { + device type ma_temperature_controlled_cabinet = 113, version 1; + + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + callback attribute featureMap; + callback attribute clusterRevision; + } + + server cluster TemperatureControl { + ram attribute temperatureSetpoint; + ram attribute minTemperature; + ram attribute maxTemperature; + ram attribute step; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 1; + ram attribute clusterRevision default = 1; + + handle command SetTemperature; + } +} + + diff --git a/examples/refrigerator-app/silabs/data_model/refrigerator-wifi-app.zap b/examples/refrigerator-app/silabs/data_model/refrigerator-wifi-app.zap new file mode 100644 index 0000000000..edc35aa7a3 --- /dev/null +++ b/examples/refrigerator-app/silabs/data_model/refrigerator-wifi-app.zap @@ -0,0 +1,4216 @@ +{ + "fileFormat": 2, + "featureLevel": 103, + "creator": "zap", + "keyValuePairs": [ + { + "key": "commandDiscovery", + "value": "1" + }, + { + "key": "defaultResponsePolicy", + "value": "always" + }, + { + "key": "manufacturerCodes", + "value": "0x1002" + } + ], + "package": [ + { + "pathRelativity": "relativeToZap", + "path": "../../../../src/app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "category": "matter", + "version": "chip-v1" + }, + { + "pathRelativity": "relativeToZap", + "path": "../../../../src/app/zap-templates/zcl/zcl.json", + "type": "zcl-properties", + "category": "matter", + "version": 1, + "description": "Matter SDK ZCL data" + } + ], + "endpointTypes": [ + { + "id": 1, + "name": "MA-rootdevice", + "deviceTypeRef": { + "code": 22, + "profileId": 259, + "label": "MA-rootdevice", + "name": "MA-rootdevice", + "deviceTypeOrder": 0 + }, + "deviceTypes": [ + { + "code": 22, + "profileId": 259, + "label": "MA-rootdevice", + "name": "MA-rootdevice", + "deviceTypeOrder": 0 + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 22 + ], + "deviceTypeName": "MA-rootdevice", + "deviceTypeCode": 22, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Access Control", + "code": 31, + "mfgCode": null, + "define": "ACCESS_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "ACL", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Extension", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SubjectsPerAccessControlEntry", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TargetsPerAccessControlEntry", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AccessControlEntriesPerFabric", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "AccessControlEntryChanged", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "AccessControlExtensionChanged", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Basic Information", + "code": 40, + "mfgCode": null, + "define": "BASIC_INFORMATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DataModelRevision", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorName", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorID", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "vendor_id", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductName", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductID", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NodeLabel", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Location", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersion", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersionString", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersion", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersionString", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ManufacturingDate", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartNumber", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductURL", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "long_char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductLabel", + "code": 14, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SerialNumber", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LocalConfigDisabled", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Reachable", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UniqueID", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CapabilityMinima", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "CapabilityMinimaStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SpecificationVersion", + "code": 21, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxPathsPerInvoke", + "code": 22, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "StartUp", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "ShutDown", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "Leave", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "OTA Software Update Provider", + "code": 41, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "QueryImage", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "QueryImageResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ApplyUpdateRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ApplyUpdateResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "NotifyUpdateApplied", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "OTA Software Update Requestor", + "code": 42, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DefaultOTAProviders", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UpdatePossible", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "true", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UpdateState", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "UpdateStateEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UpdateStateProgress", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "General Commissioning", + "code": 48, + "mfgCode": null, + "define": "GENERAL_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ArmFailSafe", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ArmFailSafeResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "SetRegulatoryConfig", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "SetRegulatoryConfigResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "CommissioningComplete", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CommissioningCompleteResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "Breadcrumb", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BasicCommissioningInfo", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "BasicCommissioningInfo", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RegulatoryConfig", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LocationCapability", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportsConcurrentConnection", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Network Commissioning", + "code": 49, + "mfgCode": null, + "define": "NETWORK_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ScanNetworks", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ScanNetworksResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "AddOrUpdateWiFiNetwork", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RemoveNetwork", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "NetworkConfigResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ConnectNetwork", + "code": 6, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ConnectNetworkResponse", + "code": 7, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ReorderNetwork", + "code": 8, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "MaxNetworks", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Networks", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ScanMaxTimeSeconds", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ConnectMaxTimeSeconds", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "InterfaceEnabled", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkingStatus", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "NetworkCommissioningStatusEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkID", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastConnectErrorValue", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int32s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Diagnostic Logs", + "code": 50, + "mfgCode": null, + "define": "DIAGNOSTIC_LOGS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "RetrieveLogsRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RetrieveLogsResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "General Diagnostics", + "code": 51, + "mfgCode": null, + "define": "GENERAL_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "TestEventTrigger", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "NetworkInterfaces", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RebootCount", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TotalOperationalHours", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BootReason", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "BootReasonEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveHardwareFaults", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveRadioFaults", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveNetworkFaults", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TestEventTriggersEnabled", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "false", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "HardwareFaultChange", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "RadioFaultChange", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "NetworkFaultChange", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "BootReason", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Wi-Fi Network Diagnostics", + "code": 54, + "mfgCode": null, + "define": "WIFI_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ResetCounts", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "BSSID", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SecurityType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "SecurityTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "WiFiVersion", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "WiFiVersionEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ChannelNumber", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RSSI", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int8s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BeaconLostCount", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BeaconRxCount", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketMulticastRxCount", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketMulticastTxCount", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketUnicastRxCount", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketUnicastTxCount", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentMaxRate", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OverrunCount", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "Disconnection", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "AssociationFailure", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "ConnectionStatus", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Administrator Commissioning", + "code": 60, + "mfgCode": null, + "define": "ADMINISTRATOR_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "OpenCommissioningWindow", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RevokeCommissioning", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "WindowStatus", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "CommissioningWindowStatusEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AdminFabricIndex", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "fabric_idx", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AdminVendorId", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "vendor_id", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Operational Credentials", + "code": 62, + "mfgCode": null, + "define": "OPERATIONAL_CREDENTIALS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "AttestationRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "AttestationResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "CertificateChainRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CertificateChainResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "CSRRequest", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CSRResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "AddNOC", + "code": 6, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "UpdateNOC", + "code": 7, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "NOCResponse", + "code": 8, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "UpdateFabricLabel", + "code": 9, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RemoveFabric", + "code": 10, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "AddTrustedRootCertificate", + "code": 11, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "NOCs", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Fabrics", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SupportedFabrics", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CommissionedFabrics", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TrustedRootCertificates", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentFabricIndex", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Group Key Management", + "code": 63, + "mfgCode": null, + "define": "GROUP_KEY_MANAGEMENT_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "KeySetWrite", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetRead", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetReadResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "KeySetRemove", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetReadAllIndices", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetReadAllIndicesResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "GroupKeyMap", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GroupTable", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxGroupsPerFabric", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxGroupKeysPerFabric", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + }, + { + "id": 2, + "name": "MA-refrigerator", + "deviceTypeRef": { + "code": 112, + "profileId": 259, + "label": "MA-refrigerator", + "name": "MA-refrigerator", + "deviceTypeOrder": 0 + }, + "deviceTypes": [ + { + "code": 112, + "profileId": 259, + "label": "MA-refrigerator", + "name": "MA-refrigerator", + "deviceTypeOrder": 0 + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 112 + ], + "deviceTypeName": "MA-refrigerator", + "deviceTypeCode": 112, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Refrigerator And Temperature Controlled Cabinet Mode", + "code": 82, + "mfgCode": null, + "define": "REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ChangeToMode", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ChangeToModeResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "SupportedModes", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentMode", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Refrigerator Alarm", + "code": 87, + "mfgCode": null, + "define": "REFRIGERATOR_ALARM_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "Mask", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "AlarmBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "State", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "AlarmBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Supported", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "AlarmBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + }, + { + "id": 3, + "name": "Anonymous Endpoint Type", + "deviceTypeRef": { + "code": 113, + "profileId": 259, + "label": "MA-temperature-controlled-cabinet", + "name": "MA-temperature-controlled-cabinet", + "deviceTypeOrder": 0 + }, + "deviceTypes": [ + { + "code": 113, + "profileId": 259, + "label": "MA-temperature-controlled-cabinet", + "name": "MA-temperature-controlled-cabinet", + "deviceTypeOrder": 0 + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 113 + ], + "deviceTypeName": "MA-temperature-controlled-cabinet", + "deviceTypeCode": 113, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Temperature Control", + "code": 86, + "mfgCode": null, + "define": "TEMPERATURE_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "SetTemperature", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "TemperatureSetpoint", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinTemperature", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxTemperature", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Step", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + }, + { + "id": 4, + "name": "Anonymous Endpoint Type", + "deviceTypeRef": { + "code": 113, + "profileId": 259, + "label": "MA-temperature-controlled-cabinet", + "name": "MA-temperature-controlled-cabinet", + "deviceTypeOrder": 0 + }, + "deviceTypes": [ + { + "code": 113, + "profileId": 259, + "label": "MA-temperature-controlled-cabinet", + "name": "MA-temperature-controlled-cabinet", + "deviceTypeOrder": 0 + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 113 + ], + "deviceTypeName": "MA-temperature-controlled-cabinet", + "deviceTypeCode": 113, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Temperature Control", + "code": 86, + "mfgCode": null, + "define": "TEMPERATURE_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "SetTemperature", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "TemperatureSetpoint", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinTemperature", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxTemperature", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Step", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + } + ], + "endpoints": [ + { + "endpointTypeName": "MA-rootdevice", + "endpointTypeIndex": 0, + "profileId": 259, + "endpointId": 0, + "networkId": 0, + "parentEndpointIdentifier": null + }, + { + "endpointTypeName": "MA-refrigerator", + "endpointTypeIndex": 1, + "profileId": 259, + "endpointId": 1, + "networkId": 0, + "parentEndpointIdentifier": null + }, + { + "endpointTypeName": "Anonymous Endpoint Type", + "endpointTypeIndex": 2, + "profileId": 259, + "endpointId": 2, + "networkId": 0, + "parentEndpointIdentifier": null + }, + { + "endpointTypeName": "Anonymous Endpoint Type", + "endpointTypeIndex": 3, + "profileId": 259, + "endpointId": 3, + "networkId": 0, + "parentEndpointIdentifier": null + } + ] +} \ No newline at end of file diff --git a/examples/refrigerator-app/silabs/include/AppConfig.h b/examples/refrigerator-app/silabs/include/AppConfig.h new file mode 100644 index 0000000000..3c9472f8d3 --- /dev/null +++ b/examples/refrigerator-app/silabs/include/AppConfig.h @@ -0,0 +1,61 @@ +/* + * + * 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 "silabs_utils.h" + +// ---- Refrigerator Example App Config ---- + +#define APP_TASK_NAME "Refr" + +#define BLE_DEV_NAME "SiLabs-Refrigerator" + +// Time it takes in ms for the simulated actuator to move from one +// state to another. +#define ACTUATOR_MOVEMENT_PERIOS_MS 10 + +// APP Logo, boolean only. must be 64x64 +#define ON_DEMO_BITMAP \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0xE0, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0xC0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x80, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0x81, 0x81, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC1, 0x83, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x07, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xE0, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x07, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xE0, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0x00, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00, \ + 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0xF0, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0x0F, 0x00, 0x00, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, \ + 0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0x07, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, \ + 0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0xF0, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0x0F, 0x00, 0x00, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x00, 0x00, \ + 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x80, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0xE0, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF +#define OFF_DEMO_BITMAP ON_DEMO_BITMAP diff --git a/examples/refrigerator-app/silabs/include/AppEvent.h b/examples/refrigerator-app/silabs/include/AppEvent.h new file mode 100644 index 0000000000..59d49c5002 --- /dev/null +++ b/examples/refrigerator-app/silabs/include/AppEvent.h @@ -0,0 +1,55 @@ +/* + * + * 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 + +struct AppEvent; +typedef void (*EventHandler)(AppEvent *); + +struct AppEvent +{ + enum AppEventTypes + { + kEventType_Button = 0, + kEventType_Timer, + kEventType_Refrigerator, + kEventType_Install, + }; + + uint16_t Type; + + union + { + struct + { + uint8_t Action; + } ButtonEvent; + struct + { + void * Context; + } TimerEvent; + struct + { + uint8_t Action; + int32_t Actor; + } RefrigeratorEvent; + }; + + EventHandler Handler; +}; diff --git a/examples/refrigerator-app/silabs/include/AppTask.h b/examples/refrigerator-app/silabs/include/AppTask.h new file mode 100644 index 0000000000..36c4581b29 --- /dev/null +++ b/examples/refrigerator-app/silabs/include/AppTask.h @@ -0,0 +1,110 @@ +/* + * + * 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 + +/********************************************************** + * Includes + *********************************************************/ + +#include +#include + +#ifdef DISPLAY_ENABLED +#include "RefrigeratorUI.h" +#endif + +#include "AppEvent.h" +#include "BaseApplication.h" +#include "RefrigeratorManager.h" +#include +#include +#include +#include + +/********************************************************** + * Defines + *********************************************************/ + +// 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) + +/********************************************************** + * AppTask Declaration + *********************************************************/ + +class AppTask : public BaseApplication +{ + +public: + AppTask() = default; + + static AppTask & GetAppTask() { return sAppTask; } + + /** + * @brief AppTask task main loop function + * + * @param pvParameter FreeRTOS task parameter + */ + static void AppTaskMain(void * pvParameter); + + CHIP_ERROR StartAppTask(); + + /** + * @brief Event handler when a button is pressed + * Function posts an event for button processing + * + * @param buttonHandle APP_CONTROL_BUTTON or APP_FUNCTION_BUTTON + * @param btnAction button action - SL_SIMPLE_BUTTON_PRESSED, + * SL_SIMPLE_BUTTON_RELEASED or SL_SIMPLE_BUTTON_DISABLED + */ + static void ButtonEventHandler(uint8_t button, uint8_t btnAction); + +private: + static AppTask sAppTask; + + /** + * @brief AppTask initialisation function + * + * @return CHIP_ERROR + */ + CHIP_ERROR Init(); + + /** + * @brief PB0 Button event processing function + * Press and hold will trigger a factory reset timer start + * Press and release will restart BLEAdvertising if not commisionned + * + * @param aEvent button event being processed + */ + static void ButtonHandler(AppEvent * aEvent); + + /** + * @brief PB1 Button event processing function + * Function triggers an action sent to the CHIP task + // TODO: Action for refrigerator is not decided yet + * + * @param aEvent button event being processed + */ + static void RefrigeratorActionEventHandler(AppEvent * aEvent); +}; diff --git a/examples/refrigerator-app/silabs/include/CHIPProjectConfig.h b/examples/refrigerator-app/silabs/include/CHIPProjectConfig.h new file mode 100644 index 0000000000..dfaca5d760 --- /dev/null +++ b/examples/refrigerator-app/silabs/include/CHIPProjectConfig.h @@ -0,0 +1,111 @@ +/* + * + * 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. + */ + +/** + * @file + * Example project configuration file for CHIP. + * + * This is a place to put application or project-specific overrides + * to the default configuration values for general CHIP features. + * + */ + +#pragma once + +// Use a default pairing code if one hasn't been provisioned in flash. +#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE +#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 +#endif + +#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR +#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 +#endif + +// For convenience, Chip Security Test Mode can be enabled and the +// requirement for authentication in various protocols can be disabled. +// +// WARNING: These options make it possible to circumvent basic Chip security functionality, +// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS. +// +#define CHIP_CONFIG_SECURITY_TEST_MODE 0 + +/** + * CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID + * + * 0xFFF1: Test vendor + */ +#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID 0xFFF1 + +/** + * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID + * + * 0x800E: example refrigerator app + */ +#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x800E + +/** + * CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE + * + * Enable support for Chip-over-BLE (CHIPoBLE). + */ +#define CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE 1 + +/** + * CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC + * + * Enables synchronizing the device's real time clock with a remote Chip Time service + * using the Chip Time Sync protocol. + */ +#define CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC 0 + +/** + * CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER + * + * Enables the use of a hard-coded default serial number if none + * is found in Chip NV storage. + */ +#define CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER "TEST_SN" + +/** + * CHIP_DEVICE_CONFIG_EVENT_LOGGING_UTC_TIMESTAMPS + * + * Enable recording UTC timestamps. + */ +#define CHIP_DEVICE_CONFIG_EVENT_LOGGING_UTC_TIMESTAMPS 1 + +/** + * CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE + * + * A size, in bytes, of the individual debug event logging buffer. + */ +#define CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE (512) + +/** + * @def CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL + * + * @brief + * Active retransmit interval, or time to wait before retransmission after + * subsequent failures in milliseconds. + * + * This is the default value, that might be adjusted by end device depending on its + * needs (e.g. sleeping period) using Service Discovery TXT record CRA key. + * + */ +#define CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL (2000_ms32) + +#define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 diff --git a/examples/refrigerator-app/silabs/include/RefrigeratorIcons.h b/examples/refrigerator-app/silabs/include/RefrigeratorIcons.h new file mode 100644 index 0000000000..094775fa9f --- /dev/null +++ b/examples/refrigerator-app/silabs/include/RefrigeratorIcons.h @@ -0,0 +1,218 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#define SILABS_LOGO_WIDTH 47 +#define SILABS_LOGO_HEIGHT 18 +#define BLUETOOTH_ICON_SIZE 18 + +// Status Icon defines +#define STATUS_ICON_LINE 0 +#define SILABS_ICON_POSITION_X 0 +#define BLE_ICON_POSITION_X 72 +#define NETWORK_ICON_POSITION_X 90 +#define MATTER_ICON_POSITION_X 108 + +// Heating/Cooling position +#define HEATING_COOLING_X 90 +#define HEATING_COOLING_Y 40 + +#define BLUETOOTH_ICON_SMALL \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0x7F, 0xFE, 0xEF, 0xF1, 0x7F, 0x9F, 0xFF, 0x7B, 0xFF, 0x1F, 0xFE, 0xFF, 0xFC, 0xFF, \ + 0xF3, 0xFF, 0x87, 0xFF, 0xEF, 0xFD, 0xDF, 0xE7, 0xBF, 0xC7, 0xFF, 0x9F, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F + +#define SILABS_LOGO_SMALL \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, \ + 0xC0, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x80, 0x3F, 0xFF, 0xFF, 0xFF, 0x00, 0xE0, 0x9F, 0xFF, 0xE7, 0x3F, 0xE0, 0xF1, 0x83, \ + 0xFF, 0xF9, 0xEF, 0xFF, 0x3F, 0xE0, 0x3F, 0xFC, 0xFF, 0xFF, 0x7F, 0xF8, 0x0F, 0xFC, 0xFF, 0xFF, 0x3F, 0xFE, 0x03, 0xFC, \ + 0xFF, 0xF7, 0x9F, 0xFF, 0x81, 0x07, 0x02, 0xF8, 0xFF, 0xFF, 0xE0, 0x07, 0x00, 0xFE, 0xFF, 0xFF, 0xF8, 0x03, 0xC0, 0xFF, \ + 0xFF, 0xFF, 0xFE, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0x3F + +#define HEATING_BITMAP \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFE, 0xFF, 0xFF, \ + 0x3F, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0xFE, 0x7F, 0xFC, 0x1F, \ + 0x1F, 0xF8, 0xF8, 0x3F, 0x07, 0xE0, 0xFC, 0xBF, 0xC7, 0xE3, 0xFD, 0xFF, 0xE3, 0xC7, 0xFF, 0xFF, 0xF3, 0xCF, 0xFF, 0xFF, \ + 0xF3, 0xCF, 0xFF, 0xFF, 0xF3, 0xCF, 0xFF, 0xFF, 0xF3, 0xCF, 0xFF, 0xFF, 0xE3, 0xC7, 0xFF, 0xBF, 0xC7, 0xE3, 0xFD, 0x3F, \ + 0x07, 0xE0, 0xFC, 0x1F, 0x1F, 0xF8, 0xF8, 0x3F, 0xFE, 0x7F, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xBF, 0xFD, 0xFF, 0xFF, 0x3F, 0xFC, 0xFF, 0xFF, 0x7F, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF + +#define HEATING_WIDTH 32 +#define HEATING_HEIGHT 32 + +#define COOLING_BITMAP \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFD, 0xFF, 0xFF, 0x1F, 0xF8, 0xFF, 0xFF, \ + 0x3F, 0xFC, 0xFF, 0xFF, 0x7F, 0xFE, 0xFF, 0xFF, 0x7F, 0xFE, 0xFF, 0x3F, 0x7F, 0xFE, 0xFC, 0x3F, 0x7F, 0xFE, 0xFC, 0x3F, \ + 0x3E, 0x7C, 0xFC, 0x0F, 0x0C, 0x30, 0xF0, 0xCF, 0x80, 0x01, 0xF3, 0xFF, 0xE3, 0xC7, 0xFF, 0xFF, 0xF3, 0xCF, 0xFF, 0xFF, \ + 0xF3, 0xCF, 0xFF, 0xFF, 0xF3, 0xCF, 0xFF, 0xFF, 0xF3, 0xCF, 0xFF, 0xFF, 0xE3, 0xC7, 0xFF, 0xCF, 0x80, 0x01, 0xF3, 0x0F, \ + 0x0C, 0x30, 0xF0, 0x3F, 0x3E, 0x7C, 0xFC, 0x3F, 0x7F, 0xFE, 0xFC, 0x3F, 0x7F, 0xFE, 0xFC, 0xFF, 0x7F, 0xFE, 0xFF, 0xFF, \ + 0x7F, 0xFE, 0xFF, 0xFF, 0x3F, 0xFC, 0xFF, 0xFF, 0x1F, 0xF8, 0xFF, 0xFF, 0xBF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF + +#define HEATING_COOLING_BITMAP \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFC, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, \ + 0xFC, 0xE0, 0xFF, 0xFF, 0xFC, 0xF9, 0xF7, 0x7F, 0xFC, 0xF8, 0xF3, 0x1F, 0xFC, 0xFC, 0xF9, 0x1F, 0x78, 0xFC, 0xFC, 0xFF, \ + 0x01, 0x7C, 0xFE, 0xFF, 0x03, 0x3C, 0xFF, 0xFF, 0xE3, 0x9F, 0xFF, 0xFF, 0xF3, 0x8F, 0xF3, 0xFF, 0xF3, 0x87, 0xE3, 0xFF, \ + 0xF3, 0x83, 0xF7, 0xC7, 0xF0, 0x01, 0xF7, 0x07, 0xF0, 0x00, 0xFF, 0x0F, 0x7F, 0x00, 0xFF, 0xCF, 0x3F, 0x80, 0xFF, 0xCF, \ + 0x1F, 0x80, 0xFF, 0xFF, 0x0F, 0xC0, 0xFF, 0xFF, 0x07, 0xE0, 0xFD, 0xFF, 0xF3, 0xF8, 0xFD, 0xFF, 0xF9, 0xFF, 0xFC, 0xFF, \ + 0xFC, 0x3F, 0xFC, 0x7F, 0xDE, 0xFF, 0xFF, 0x3F, 0x1F, 0xFE, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF + +#define COOLING_WIDTH 32 +#define COOLING_HEIGHT 32 + +// Font for temperature +#define CELSIUS_INDEX 2320 +#define FAHRENHEIT_INDEX 2370 +#define DEGREE_INDEX 2420 + +#define MONACO_FONT_WIDTH 29 +#define MONACO_FONT_NB_LENGTH 232 +#define MONACO_FONT_CH_LENGTH 50 + +#define MONACO_48PT \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0xFC, 0xFF, 0xFF, \ + 0x00, 0xF0, 0xFF, 0x7F, 0x00, 0xC0, 0xFF, 0x3F, 0x00, 0x80, 0xFF, 0x1F, 0x60, 0x00, 0xFF, 0x1F, 0xF8, 0x03, 0xFF, 0x0F, \ + 0xFC, 0x07, 0xFE, 0x07, 0xFE, 0x07, 0xFE, 0x07, 0xFE, 0x07, 0xFC, 0x07, 0xFF, 0x03, 0xFC, 0x03, 0xFF, 0x03, 0xFC, 0x03, \ + 0xFF, 0x01, 0xF8, 0x83, 0xFF, 0x00, 0xF8, 0x83, 0xFF, 0x00, 0xF8, 0x83, 0x7F, 0x30, 0xF8, 0x83, 0x3F, 0x30, 0xF8, 0x83, \ + 0x3F, 0x38, 0xF8, 0x81, 0x1F, 0x3C, 0xF8, 0x81, 0x0F, 0x3C, 0xF8, 0x81, 0x0F, 0x3E, 0xF8, 0x81, 0x07, 0x3E, 0xF8, 0x81, \ + 0x07, 0x3F, 0xF8, 0x83, 0x83, 0x3F, 0xF8, 0x83, 0x81, 0x3F, 0xF8, 0x83, 0xC1, 0x3F, 0xF8, 0x83, 0xE0, 0x1F, 0xF8, 0x03, \ + 0xE0, 0x1F, 0xF8, 0x03, 0xF0, 0x1F, 0xF8, 0x03, 0xF8, 0x1F, 0xFC, 0x07, 0xF8, 0x0F, 0xFC, 0x07, 0xFC, 0x0F, 0xFC, 0x07, \ + 0xFC, 0x07, 0xFE, 0x0F, 0xFC, 0x07, 0xFE, 0x0F, 0xF8, 0x03, 0xFF, 0x1F, 0xE0, 0x00, 0xFF, 0x3F, 0x00, 0x80, 0xFF, 0x7F, \ + 0x00, 0xC0, 0xFF, 0xFF, 0x00, 0xE0, 0xFF, 0xFF, 0x03, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* Character 0x30 (48: '0')*/ \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0x0F, 0xFC, 0xFF, 0xFF, 0x07, 0xFC, 0xFF, 0xFF, 0x03, 0xFC, 0xFF, 0xFF, 0x00, 0xFC, 0xFF, 0x3F, 0x00, 0xFC, 0xFF, \ + 0x1F, 0x00, 0xFC, 0xFF, 0x0F, 0x10, 0xFC, 0xFF, 0x0F, 0x1C, 0xFC, 0xFF, 0x0F, 0x1E, 0xFC, 0xFF, 0xCF, 0x1F, 0xFC, 0xFF, \ + 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, \ + 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, \ + 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, \ + 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, \ + 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, 0x0F, 0x00, 0x00, 0xF8, 0x0F, 0x00, 0x00, 0xF8, \ + 0x0F, 0x00, 0x00, 0xF8, 0x0F, 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* Character 0x31 (49: '1')*/ \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0xF8, 0xFF, \ + 0x3F, 0x00, 0xC0, 0xFF, 0x0F, 0x00, 0x80, 0xFF, 0x0F, 0x00, 0x00, 0xFF, 0x0F, 0xF8, 0x00, 0xFF, 0x0F, 0xFF, 0x03, 0xFE, \ + 0xEF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0x0F, 0xFE, 0xFF, 0xFF, 0x0F, 0xFE, 0xFF, 0xFF, 0x0F, 0xFE, 0xFF, 0xFF, 0x0F, 0xFE, \ + 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0x03, 0xFF, 0xFF, 0xFF, 0x03, 0xFF, 0xFF, 0xFF, 0x81, 0xFF, 0xFF, 0xFF, 0xC0, 0xFF, \ + 0xFF, 0x7F, 0xC0, 0xFF, 0xFF, 0x3F, 0xE0, 0xFF, 0xFF, 0x1F, 0xF0, 0xFF, 0xFF, 0x0F, 0xF8, 0xFF, 0xFF, 0x07, 0xFC, 0xFF, \ + 0xFF, 0x03, 0xFE, 0xFF, 0xFF, 0x03, 0xFF, 0xFF, 0xFF, 0x81, 0xFF, 0xFF, 0xFF, 0xC0, 0xFF, 0xFF, 0x7F, 0xE0, 0xFF, 0xFF, \ + 0x3F, 0xF0, 0xFF, 0xFF, 0x1F, 0xF8, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x0F, 0xFC, 0xFF, 0xFF, 0x0F, 0xFE, 0xFF, 0xFF, \ + 0x0F, 0xFE, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0xFE, 0x07, 0x00, 0x00, 0xFC, 0x07, 0x00, 0x00, 0xFC, \ + 0x07, 0x00, 0x00, 0xFC, 0x07, 0x00, 0x00, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* Character 0x32 (50: '2')*/ \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFE, 0xFF, \ + 0x0F, 0x00, 0xF0, 0xFF, 0x0F, 0x00, 0xC0, 0xFF, 0x0F, 0x00, 0xC0, 0xFF, 0x0F, 0x7C, 0x80, 0xFF, 0x8F, 0xFF, 0x01, 0xFF, \ + 0xFF, 0xFF, 0x03, 0xFF, 0xFF, 0xFF, 0x03, 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0x07, 0xFF, \ + 0xFF, 0xFF, 0x03, 0xFF, 0xFF, 0xFF, 0x83, 0xFF, 0xFF, 0xFF, 0x81, 0xFF, 0xFF, 0x7F, 0xC0, 0xFF, 0xFF, 0x07, 0xE0, 0xFF, \ + 0x7F, 0x00, 0xF0, 0xFF, 0x7F, 0x00, 0xF8, 0xFF, 0x7F, 0x00, 0xE0, 0xFF, 0x7F, 0x00, 0x80, 0xFF, 0xFF, 0x7F, 0x00, 0xFF, \ + 0xFF, 0xFF, 0x01, 0xFF, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0x0F, 0xFC, 0xFF, 0xFF, 0x0F, 0xFC, \ + 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x0F, 0xFC, 0xFF, 0xFF, 0x0F, 0xFC, 0xFF, 0xFF, 0x0F, 0xFC, \ + 0xFF, 0xFF, 0x07, 0xFE, 0xF7, 0xFF, 0x07, 0xFE, 0x87, 0xFF, 0x01, 0xFF, 0x07, 0x7C, 0x80, 0xFF, 0x07, 0x00, 0xC0, 0xFF, \ + 0x07, 0x00, 0xE0, 0xFF, 0x0F, 0x00, 0xF0, 0xFF, 0x7F, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* Character 0x33 (51: '3')*/ \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0x7F, 0xE0, 0xFF, 0xFF, 0x7F, 0xE0, 0xFF, 0xFF, 0x3F, 0xE0, 0xFF, 0xFF, 0x1F, 0xE0, 0xFF, \ + 0xFF, 0x1F, 0xE0, 0xFF, 0xFF, 0x0F, 0xE0, 0xFF, 0xFF, 0x07, 0xE0, 0xFF, 0xFF, 0x07, 0xE0, 0xFF, 0xFF, 0x83, 0xE0, 0xFF, \ + 0xFF, 0x81, 0xE0, 0xFF, 0xFF, 0xC0, 0xE0, 0xFF, 0xFF, 0xE0, 0xE0, 0xFF, 0x7F, 0xE0, 0xE0, 0xFF, 0x3F, 0xF0, 0xE0, 0xFF, \ + 0x3F, 0xF8, 0xE0, 0xFF, 0x1F, 0xF8, 0xE0, 0xFF, 0x0F, 0xFC, 0xE0, 0xFF, 0x0F, 0xFE, 0xE0, 0xFF, 0x07, 0xFE, 0xE0, 0xFF, \ + 0x03, 0xFF, 0xE0, 0xFF, 0x83, 0xFF, 0xE0, 0xFF, 0x81, 0xFF, 0xC0, 0xFF, 0x01, 0x00, 0x00, 0xF0, 0x01, 0x00, 0x00, 0xF0, \ + 0x01, 0x00, 0x00, 0xF0, 0x01, 0x00, 0x00, 0xF0, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, \ + 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, \ + 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* Character 0x34 (52: '4')*/ \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0x0F, 0x00, 0x00, 0xFE, 0x0F, 0x00, 0x00, 0xFE, 0x0F, 0x00, 0x00, 0xFE, 0x0F, 0x00, 0x00, 0xFE, 0x0F, 0x00, 0x00, 0xFE, \ + 0x0F, 0xFE, 0xFF, 0xFF, 0x0F, 0xFE, 0xFF, 0xFF, 0x0F, 0xFE, 0xFF, 0xFF, 0x0F, 0xFE, 0xFF, 0xFF, 0x0F, 0xFE, 0xFF, 0xFF, \ + 0x0F, 0xFE, 0xFF, 0xFF, 0x0F, 0xFE, 0xFF, 0xFF, 0x0F, 0xFE, 0xFF, 0xFF, 0x0F, 0xC0, 0xFF, 0xFF, 0x0F, 0x00, 0xFC, 0xFF, \ + 0x0F, 0x00, 0xF0, 0xFF, 0x0F, 0x00, 0xC0, 0xFF, 0x0F, 0x00, 0x80, 0xFF, 0xFF, 0x0F, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0xFE, \ + 0xFF, 0xFF, 0x03, 0xFE, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0x07, 0xFC, 0xFF, 0xFF, 0x0F, 0xFC, 0xFF, 0xFF, 0x0F, 0xFC, \ + 0xFF, 0xFF, 0x0F, 0xFC, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x0F, 0xFC, 0xFF, 0xFF, 0x0F, 0xFC, 0xFF, 0xFF, 0x0F, 0xFC, \ + 0xFF, 0xFF, 0x07, 0xFE, 0xEF, 0xFF, 0x03, 0xFE, 0x07, 0xFF, 0x00, 0xFF, 0x07, 0x00, 0x80, 0xFF, 0x07, 0x00, 0xC0, 0xFF, \ + 0x07, 0x00, 0xE0, 0xFF, 0x0F, 0x00, 0xF0, 0xFF, 0xFF, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* Character 0x35 (53: '5')*/ \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0xC0, 0xFF, \ + 0xFF, 0x07, 0x00, 0xFE, 0xFF, 0x01, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0xFE, 0x7F, 0x80, 0x07, 0xFE, 0x3F, 0xE0, 0x7F, 0xFE, \ + 0x1F, 0xF0, 0xFF, 0xFF, 0x1F, 0xF8, 0xFF, 0xFF, 0x0F, 0xFC, 0xFF, 0xFF, 0x0F, 0xFE, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, \ + 0x07, 0xFE, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0x03, 0x0F, 0xE0, 0xFF, \ + 0x83, 0x03, 0x80, 0xFF, 0x83, 0x01, 0x00, 0xFF, 0x83, 0x00, 0x00, 0xFE, 0x03, 0xC0, 0x07, 0xFC, 0x03, 0xF0, 0x0F, 0xFC, \ + 0x03, 0xF8, 0x1F, 0xF8, 0x03, 0xFC, 0x3F, 0xF8, 0x03, 0xFC, 0x3F, 0xF8, 0x07, 0xFE, 0x3F, 0xF8, 0x07, 0xFE, 0x3F, 0xF8, \ + 0x07, 0xFE, 0x3F, 0xF8, 0x07, 0xFE, 0x3F, 0xF8, 0x07, 0xFE, 0x3F, 0xF8, 0x0F, 0xFE, 0x3F, 0xF8, 0x0F, 0xFC, 0x1F, 0xF8, \ + 0x0F, 0xFC, 0x1F, 0xFC, 0x1F, 0xF8, 0x0F, 0xFC, 0x1F, 0xF0, 0x07, 0xFE, 0x3F, 0xC0, 0x01, 0xFE, 0x7F, 0x00, 0x00, 0xFF, \ + 0xFF, 0x00, 0x80, 0xFF, 0xFF, 0x01, 0xE0, 0xFF, 0xFF, 0x07, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* Character 0x36 (54: '6')*/ \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0x0F, 0x00, 0x00, 0xF8, 0x0F, 0x00, 0x00, 0xF8, 0x0F, 0x00, 0x00, 0xF8, 0x0F, 0x00, 0x00, 0xF8, 0x0F, 0x00, 0x00, 0xF8, \ + 0xFF, 0xFF, 0x3F, 0xF8, 0xFF, 0xFF, 0x1F, 0xF8, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x0F, 0xFE, 0xFF, 0xFF, 0x0F, 0xFE, \ + 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0x83, 0xFF, 0xFF, 0xFF, 0x81, 0xFF, 0xFF, 0xFF, 0xC1, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, \ + 0xFF, 0x7F, 0xE0, 0xFF, 0xFF, 0x3F, 0xF0, 0xFF, 0xFF, 0x3F, 0xF8, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x0F, 0xFC, 0xFF, \ + 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0x03, 0xFF, 0xFF, 0xFF, 0x83, 0xFF, 0xFF, 0xFF, 0x81, 0xFF, 0xFF, \ + 0xFF, 0xC1, 0xFF, 0xFF, 0xFF, 0xC0, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0x7F, 0xE0, 0xFF, 0xFF, \ + 0x7F, 0xE0, 0xFF, 0xFF, 0x7F, 0xE0, 0xFF, 0xFF, 0x7F, 0xE0, 0xFF, 0xFF, 0x7F, 0xE0, 0xFF, 0xFF, 0x7F, 0xF0, 0xFF, 0xFF, \ + 0x7F, 0xF0, 0xFF, 0xFF, 0x7F, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* Character 0x37 (55: '7')*/ \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xF8, 0xFF, \ + 0xFF, 0x01, 0xE0, 0xFF, 0xFF, 0x00, 0x80, 0xFF, 0x7F, 0x00, 0x80, 0xFF, 0x3F, 0xE0, 0x00, 0xFF, 0x3F, 0xF8, 0x03, 0xFF, \ + 0x1F, 0xFC, 0x07, 0xFE, 0x1F, 0xFC, 0x0F, 0xFE, 0x1F, 0xFC, 0x0F, 0xFE, 0x1F, 0xFC, 0x0F, 0xFE, 0x1F, 0xFC, 0x07, 0xFE, \ + 0x1F, 0xF8, 0x07, 0xFF, 0x3F, 0xF0, 0x03, 0xFF, 0x3F, 0xE0, 0x81, 0xFF, 0x7F, 0xC0, 0x80, 0xFF, 0x7F, 0x00, 0xC0, 0xFF, \ + 0xFF, 0x00, 0xE0, 0xFF, 0xFF, 0x01, 0xF0, 0xFF, 0xFF, 0x03, 0xF8, 0xFF, 0xFF, 0x00, 0xE0, 0xFF, 0x7F, 0x00, 0xC0, 0xFF, \ + 0x3F, 0x60, 0x80, 0xFF, 0x1F, 0xF0, 0x00, 0xFF, 0x1F, 0xF8, 0x01, 0xFE, 0x0F, 0xFC, 0x03, 0xFE, 0x0F, 0xFC, 0x07, 0xFC, \ + 0x07, 0xFE, 0x0F, 0xFC, 0x07, 0xFE, 0x0F, 0xFC, 0x07, 0xFF, 0x1F, 0xFC, 0x07, 0xFF, 0x1F, 0xFC, 0x07, 0xFF, 0x1F, 0xFC, \ + 0x07, 0xFE, 0x0F, 0xFC, 0x07, 0xFC, 0x0F, 0xFC, 0x0F, 0xF8, 0x07, 0xFE, 0x0F, 0xE0, 0x01, 0xFE, 0x1F, 0x00, 0x00, 0xFF, \ + 0x3F, 0x00, 0x80, 0xFF, 0xFF, 0x00, 0xE0, 0xFF, 0xFF, 0x03, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* Character 0x38 (56: '8')*/ \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0xFE, 0xFF, \ + 0xFF, 0x00, 0xF0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x1F, 0x00, 0xC0, 0xFF, 0x0F, 0x70, 0x80, 0xFF, 0x07, 0xFC, 0x01, 0xFF, \ + 0x07, 0xFE, 0x03, 0xFF, 0x03, 0xFF, 0x03, 0xFF, 0x83, 0xFF, 0x07, 0xFE, 0x83, 0xFF, 0x07, 0xFE, 0x83, 0xFF, 0x0F, 0xFC, \ + 0xC1, 0xFF, 0x0F, 0xFC, 0xC1, 0xFF, 0x0F, 0xFC, 0xC1, 0xFF, 0x0F, 0xFC, 0x83, 0xFF, 0x07, 0xFC, 0x83, 0xFF, 0x07, 0xFC, \ + 0x83, 0xFF, 0x07, 0xFC, 0x03, 0xFF, 0x03, 0xF8, 0x03, 0xFE, 0x01, 0xF8, 0x07, 0x7C, 0x00, 0xF8, 0x0F, 0x00, 0x00, 0xF8, \ + 0x1F, 0x00, 0x10, 0xF8, 0x3F, 0x00, 0x1C, 0xFC, 0xFF, 0x00, 0x1F, 0xFC, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x1F, 0xFC, \ + 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x0F, 0xFC, 0xFF, 0xFF, 0x0F, 0xFE, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0x07, 0xFE, \ + 0xFF, 0xFF, 0x03, 0xFF, 0xFF, 0xFF, 0x81, 0xFF, 0xCF, 0xFF, 0x80, 0xFF, 0x0F, 0x3E, 0xC0, 0xFF, 0x0F, 0x00, 0xE0, 0xFF, \ + 0x0F, 0x00, 0xF0, 0xFF, 0x0F, 0x00, 0xFC, 0xFF, 0x3F, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* Character 0x39 (57: '9')*/ \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFC, 0x1F, 0xE0, 0x0F, 0xE3, 0xC7, 0xFF, \ + 0xE3, 0xFF, 0xE3, 0xFF, 0xE3, 0xFF, 0xE3, 0xFF, 0xE3, 0xFF, 0xE3, 0xFF, 0xC3, 0xFF, 0x87, 0xEF, 0x0F, 0xE0, 0x1F, 0xE0, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* Character 0x63 (99: 'c')*/ \ + 0xFF, 0xFB, 0x7F, 0xC0, 0x3F, 0xC0, 0x1F, 0xFF, 0x1F, 0xFF, 0x9F, 0xFF, 0x9F, 0xFF, 0x9F, 0xFF, 0x03, 0xF0, 0x03, 0xF0, \ + 0x9F, 0xFF, 0x9F, 0xFF, 0x9F, 0xFF, 0x9F, 0xFF, 0x9F, 0xFF, 0x9F, 0xFF, 0x9F, 0xFF, 0x9F, 0xFF, 0x9F, 0xFF, 0x9F, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* Character 0x66 (102: 'f')*/ \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE3, 0xFF, 0xDD, 0xFF, 0xDD, 0xFF, 0xDD, 0xFF, 0xE3, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* Character 0x20 (32: 'degree')*/ diff --git a/examples/refrigerator-app/silabs/include/RefrigeratorManager.h b/examples/refrigerator-app/silabs/include/RefrigeratorManager.h new file mode 100644 index 0000000000..669fd833f4 --- /dev/null +++ b/examples/refrigerator-app/silabs/include/RefrigeratorManager.h @@ -0,0 +1,74 @@ +/* + * + * 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 "AppEvent.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters::RefrigeratorAlarm; +using namespace chip::app::Clusters::RefrigeratorAlarm::Attributes; +using namespace chip::app::Clusters::TemperatureControl; +using namespace chip::app::Clusters::TemperatureControl::Attributes; +using namespace chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode; +using namespace chip::DeviceLayer; +using chip::Protocols::InteractionModel::Status; + +class RefrigeratorManager +{ +public: + CHIP_ERROR Init(); + void TempCtrlAttributeChangeHandler(EndpointId endpointId, AttributeId attributeId, uint8_t * value, uint16_t size); + void RefAlaramAttributeChangeHandler(EndpointId endpointId, AttributeId attributeId, uint8_t * value, uint16_t size); + uint8_t GetMode(); + int8_t GetCurrentTemp(); + int8_t SetMode(); + +private: + friend RefrigeratorManager & RefrigeratorMgr(); + + int16_t mCurrentMode; + int16_t mStartUpMode; + int16_t mOnMode; + + int16_t mTemperatureSetpoint; + int16_t mMinTemperature; + int16_t mMaxTemperature; + + chip::app::Clusters::RefrigeratorAlarm::AlarmBitmap mMask; + chip::app::Clusters::RefrigeratorAlarm::AlarmBitmap mState; + chip::app::Clusters::RefrigeratorAlarm::AlarmBitmap mSupported; + + int8_t ConvertToPrintableTemp(int16_t temperature); + static RefrigeratorManager sRefrigeratorMgr; +}; + +inline RefrigeratorManager & RefrigeratorMgr() +{ + return RefrigeratorManager::sRefrigeratorMgr; +} diff --git a/examples/refrigerator-app/silabs/include/RefrigeratorUI.h b/examples/refrigerator-app/silabs/include/RefrigeratorUI.h new file mode 100644 index 0000000000..cf157420fb --- /dev/null +++ b/examples/refrigerator-app/silabs/include/RefrigeratorUI.h @@ -0,0 +1,40 @@ +/* + * + * 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 "RefrigeratorIcons.h" +#include "glib.h" +#include "lcd.h" + +class RefrigeratorUI +{ + +public: + static void DrawUI(GLIB_Context_t * glibContext); + static void SetCurrentTemp(int8_t temp); + static void SetMode(uint8_t mode); + +private: + static void DrawHeader(GLIB_Context_t * glibContext); + static void DrawFooter(GLIB_Context_t * glibContext, bool autoMode = true); + static void DrawCurrentTemp(GLIB_Context_t * glibContext, int8_t temp, bool isCelsius = true); + static void DrawFont(GLIB_Context_t * glibContext, uint8_t initial_x, uint8_t initial_y, uint8_t width, uint8_t * data, + uint32_t size); + static void DrawSetPoint(GLIB_Context_t * glibContext, int8_t setPoint, bool secondLine); +}; diff --git a/examples/refrigerator-app/silabs/include/refrigerator-and-temperature-controlled-cabinet-mode.h b/examples/refrigerator-app/silabs/include/refrigerator-and-temperature-controlled-cabinet-mode.h new file mode 100644 index 0000000000..2c13cd1f4a --- /dev/null +++ b/examples/refrigerator-app/silabs/include/refrigerator-and-temperature-controlled-cabinet-mode.h @@ -0,0 +1,76 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include + +namespace chip { +namespace app { +namespace Clusters { + +namespace RefrigeratorAndTemperatureControlledCabinetMode { + +const uint8_t ModeNormal = 0; +const uint8_t ModeRapidCool = 1; +const uint8_t ModeRapidFreeze = 2; + +/// This is an application level delegate to handle LaundryWasherMode commands according to the specific business logic. +class RefrigeratorAndTemperatureControlledCabinetModeDelegate : public ModeBase::Delegate +{ +private: + using ModeTagStructType = detail::Structs::ModeTagStruct::Type; + ModeTagStructType modeTagsNoarmal[1] = { { .value = to_underlying(ModeTag::kAuto) } }; + ModeTagStructType modeTagsRapidCool[1] = { { .value = to_underlying(ModeTag::kRapidCool) } }; + ModeTagStructType modeTagsRapidFreeze[3] = { { .value = to_underlying(ModeBase::ModeTag::kMax) }, + { .value = to_underlying(ModeTag::kRapidFreeze) } }; + + const detail::Structs::ModeOptionStruct::Type kModeOptions[3] = { + detail::Structs::ModeOptionStruct::Type{ .label = CharSpan::fromCharString("Normal"), + .mode = ModeNormal, + .modeTags = DataModel::List(modeTagsNoarmal) }, + detail::Structs::ModeOptionStruct::Type{ .label = CharSpan::fromCharString("Rapid Cool"), + .mode = ModeRapidCool, + .modeTags = DataModel::List(modeTagsRapidCool) }, + detail::Structs::ModeOptionStruct::Type{ .label = CharSpan::fromCharString("Rapid Freeze"), + .mode = ModeRapidFreeze, + .modeTags = DataModel::List(modeTagsRapidFreeze) }, + }; + + CHIP_ERROR Init() override; + void HandleChangeToMode(uint8_t mode, ModeBase::Commands::ChangeToModeResponse::Type & response) override; + CHIP_ERROR GetModeLabelByIndex(uint8_t modeIndex, MutableCharSpan & label) override; + CHIP_ERROR GetModeValueByIndex(uint8_t modeIndex, uint8_t & value) override; + CHIP_ERROR GetModeTagsByIndex(uint8_t modeIndex, DataModel::List & tags) override; + +public: + ~RefrigeratorAndTemperatureControlledCabinetModeDelegate() override = default; +}; + +ModeBase::Instance * Instance(); + +void Shutdown(); + +} // namespace RefrigeratorAndTemperatureControlledCabinetMode + +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/examples/refrigerator-app/silabs/openthread.gn b/examples/refrigerator-app/silabs/openthread.gn new file mode 100644 index 0000000000..01a7070afc --- /dev/null +++ b/examples/refrigerator-app/silabs/openthread.gn @@ -0,0 +1,29 @@ +# Copyright (c) 2024 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/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" + chip_openthread_ftd = true + + import("//openthread.gni") +} diff --git a/examples/refrigerator-app/silabs/openthread.gni b/examples/refrigerator-app/silabs/openthread.gni new file mode 100644 index 0000000000..1b4d67ff84 --- /dev/null +++ b/examples/refrigerator-app/silabs/openthread.gni @@ -0,0 +1,26 @@ +# Copyright (c) 2024 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/chip.gni") +import("${chip_root}/config/standalone/args.gni") +import("${chip_root}/src/platform/silabs/efr32/args.gni") + +silabs_sdk_target = get_label_info(":sdk", "label_no_toolchain") + +app_data_model = "${chip_root}/examples/refrigerator-app/silabs/data_model:silabs-refrigerator" +chip_enable_ota_requestor = true +chip_enable_openthread = true + +openthread_external_platform = + "${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" diff --git a/examples/refrigerator-app/silabs/src/AppTask.cpp b/examples/refrigerator-app/silabs/src/AppTask.cpp new file mode 100644 index 0000000000..d2def279be --- /dev/null +++ b/examples/refrigerator-app/silabs/src/AppTask.cpp @@ -0,0 +1,144 @@ +/* + * + * Copyright (c) 2024 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. + */ + +/********************************************************** + * Includes + *********************************************************/ + +#include "AppTask.h" +#include "AppConfig.h" +#include "AppEvent.h" + +#include "LEDWidget.h" + +#ifdef DISPLAY_ENABLED +#include "RefrigeratorUI.h" +#include "lcd.h" +#ifdef QR_CODE_ENABLED +#include "qrcodegen.h" +#endif // QR_CODE_ENABLED +#endif // DISPLAY_ENABLED + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/********************************************************** + * Defines and Constants + *********************************************************/ + +#define APP_FUNCTION_BUTTON 0 +#define APP_REFRIGERATOR 1 + +using namespace chip; +using namespace chip::app; +using namespace chip::TLV; +using namespace ::chip::DeviceLayer; + +/********************************************************** + * Variable declarations + *********************************************************/ + +/********************************************************** + * AppTask Definitions + *********************************************************/ + +AppTask AppTask::sAppTask; + +CHIP_ERROR AppTask::Init() +{ + CHIP_ERROR err = CHIP_NO_ERROR; + chip::DeviceLayer::Silabs::GetPlatform().SetButtonsCb(AppTask::ButtonEventHandler); + +#ifdef DISPLAY_ENABLED + GetLCD().Init((uint8_t *) "Refrigrator-App"); +#endif + + err = BaseApplication::Init(); + if (err != CHIP_NO_ERROR) + { + ChipLogError(AppServer, "BaseApplication::Init() failed"); + appError(err); + } + err = RefrigeratorMgr().Init(); + if (err != CHIP_NO_ERROR) + { + ChipLogError(AppServer, "RefrigeratorMgr::Init() failed"); + appError(err); + } + + return err; +} + +CHIP_ERROR AppTask::StartAppTask() +{ + return BaseApplication::StartAppTask(AppTaskMain); +} + +void AppTask::AppTaskMain(void * pvParameter) +{ + AppEvent event; + osMessageQueueId_t sAppEventQueue = *(static_cast(pvParameter)); + + CHIP_ERROR err = sAppTask.Init(); + if (err != CHIP_NO_ERROR) + { + ChipLogError(AppServer, "AppTask.Init() failed"); + appError(err); + } + +#if !(defined(CHIP_CONFIG_ENABLE_ICD_SERVER) && CHIP_CONFIG_ENABLE_ICD_SERVER) + sAppTask.StartStatusLEDTimer(); +#endif + + ChipLogDetail(AppServer, "App Task started"); + while (true) + { + osStatus_t eventReceived = osMessageQueueGet(sAppEventQueue, &event, NULL, osWaitForever); + while (eventReceived == osOK) + { + sAppTask.DispatchEvent(&event); + eventReceived = osMessageQueueGet(sAppEventQueue, &event, NULL, 0); + } + } +} + +void AppTask::ButtonEventHandler(uint8_t button, uint8_t btnAction) +{ + AppEvent aEvent = {}; + aEvent.Type = AppEvent::kEventType_Button; + aEvent.ButtonEvent.Action = btnAction; + + if (button == APP_FUNCTION_BUTTON) + { + aEvent.Handler = BaseApplication::ButtonHandler; + sAppTask.PostEvent(&aEvent); + } +} diff --git a/examples/refrigerator-app/silabs/src/RefrigeratorManager.cpp b/examples/refrigerator-app/silabs/src/RefrigeratorManager.cpp new file mode 100644 index 0000000000..09ab827e9d --- /dev/null +++ b/examples/refrigerator-app/silabs/src/RefrigeratorManager.cpp @@ -0,0 +1,141 @@ +/* + * + * Copyright (c) 2024 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. + */ + +/********************************************************** + * Includes + *********************************************************/ + +#include "RefrigeratorManager.h" +#include "AppConfig.h" +#include "AppEvent.h" +#include "AppTask.h" +#include +#include +#include + +/********************************************************** + * Defines and Constants + *********************************************************/ + +using namespace chip; +using namespace ::chip::DeviceLayer; + +namespace RefAndTempAttr = chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Attributes; +namespace RefAlarmAttr = chip::app::Clusters::RefrigeratorAlarm::Attributes; +namespace TempCtrlAttr = chip::app::Clusters::TemperatureControl::Attributes; + +// set Parent Endpoint and Composition Type for an Endpoint +EndpointId kRefEndpointId = 1; +EndpointId kColdCabinetEndpointId = 2; +EndpointId kFreezeCabinetEndpointId = 3; + +RefrigeratorManager RefrigeratorManager::sRefrigeratorMgr; + +namespace { +app::Clusters::TemperatureControl::AppSupportedTemperatureLevelsDelegate sAppSupportedTemperatureLevelsDelegate; + +// Please refer to https://github.com/CHIP-Specifications/connectedhomeip-spec/blob/master/src/namespaces +constexpr const uint8_t kNamespaceRefrigerator = 0x41; +// Refrigerator Namespace: 0x41, tag 0x00 (Refrigerator) +constexpr const uint8_t kTagRefrigerator = 0x00; +// Refrigerator Namespace: 0x41, tag 0x01 (Freezer) +constexpr const uint8_t kTagFreezer = 0x01; +const Clusters::Descriptor::Structs::SemanticTagStruct::Type refrigeratorTagList[] = { { .namespaceID = kNamespaceRefrigerator, + .tag = kTagRefrigerator } }; +const Clusters::Descriptor::Structs::SemanticTagStruct::Type freezerTagList[] = { { .namespaceID = kNamespaceRefrigerator, + .tag = kTagFreezer } }; +} // namespace + +CHIP_ERROR RefrigeratorManager::Init() +{ + SetTreeCompositionForEndpoint(kRefEndpointId); + SetParentEndpointForEndpoint(kColdCabinetEndpointId, kRefEndpointId); + SetParentEndpointForEndpoint(kFreezeCabinetEndpointId, kRefEndpointId); + + // set TagList + SetTagList(kColdCabinetEndpointId, Span(refrigeratorTagList)); + SetTagList(kFreezeCabinetEndpointId, Span(freezerTagList)); + + app::Clusters::TemperatureControl::SetInstance(&sAppSupportedTemperatureLevelsDelegate); + return CHIP_NO_ERROR; +} + +int8_t RefrigeratorManager::ConvertToPrintableTemp(int16_t temperature) +{ + constexpr uint8_t kRoundUpValue = 50; + + // Round up the temperature as we won't print decimals on LCD + // Is it a negative temperature + if (temperature < 0) + { + temperature -= kRoundUpValue; + } + else + { + temperature += kRoundUpValue; + } + + return static_cast(temperature / 100); +} + +void RefrigeratorManager::TempCtrlAttributeChangeHandler(EndpointId endpointId, AttributeId attributeId, uint8_t * value, + uint16_t size) +{ + switch (attributeId) + { + case TempCtrlAttr::TemperatureSetpoint::Id: { + int16_t temperatureSetpoint = ConvertToPrintableTemp(static_cast(*value)); + mTemperatureSetpoint = temperatureSetpoint; + TempCtrlAttr::TemperatureSetpoint::Set(endpointId, temperatureSetpoint); + } + break; + default: { + ChipLogError(AppServer, "Unhandled Temperature controlled attribute %ld", attributeId); + return; + } + break; + } +} + +void RefrigeratorManager::RefAlaramAttributeChangeHandler(EndpointId endpointId, AttributeId attributeId, uint8_t * value, + uint16_t size) +{ + switch (attributeId) + { + case RefAlarmAttr::Mask::Id: { + auto mask = static_cast(*value); + mState = static_cast(mask); + RefAlarmAttr::Mask::Set(endpointId, mMask); + } + break; + + case RefAlarmAttr::State::Id: { + auto state = static_cast(*value); + mState = static_cast(state); + RefAlarmAttr::State::Set(endpointId, mState); + } + break; + + default: { + ChipLogError(AppServer, "Unhandled Refrigerator Alarm attribute %ld", attributeId); + return; + } + break; + } +} diff --git a/examples/refrigerator-app/silabs/src/RefrigeratorUI.cpp b/examples/refrigerator-app/silabs/src/RefrigeratorUI.cpp new file mode 100644 index 0000000000..655c803f21 --- /dev/null +++ b/examples/refrigerator-app/silabs/src/RefrigeratorUI.cpp @@ -0,0 +1,274 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include "RefrigeratorUI.h" +#include "demo-ui-bitmaps.h" +#include "dmd.h" +#include "glib.h" +#include "lcd.h" +#include + +#if SL_WIFI && !defined(SLI_SI91X_MCU_INTERFACE) +// Only needed for wifi NCP devices +#include "spi_multiplex.h" +#endif // SL_WIFI + +// LCD line define +constexpr uint8_t kTempLcdInitialX = 30; + +// Bitmap +static const uint8_t silabsLogo[] = { SILABS_LOGO_SMALL }; +static const uint8_t matterLogoBitmap[] = { MATTER_LOGO_BITMAP }; + +static const uint8_t wifiLogo[] = { WIFI_BITMAP }; +static const uint8_t threadLogo[] = { THREAD_BITMAP }; +static const uint8_t bleLogo[] = { BLUETOOTH_ICON_SMALL }; + +static const unsigned char monaco_48pt[] = { MONACO_48PT }; +static const unsigned char heating_bits[] = { HEATING_BITMAP }; +static const unsigned char cooling_bits[] = { COOLING_BITMAP }; +static const unsigned char heating_cooling_bits[] = { HEATING_COOLING_BITMAP }; + +static int8_t mCurrentTempCelsius; +static uint8_t mMode; + +#ifdef SL_WIFI +#define UI_WIFI 1 +#else +#define UI_WIFI 0 +#endif + +/** + * @brief Draw the entire UI on the screen including header, footer, and temperature. + * @param GLIB_Context_t * pointer to the context for the GLIB library + */ +void RefrigeratorUI::DrawUI(GLIB_Context_t * glibContext) +{ + if (glibContext == nullptr) + { + ChipLogError(AppServer, "App Task started"); + return; + } + + GLIB_clear(glibContext); + DrawHeader(glibContext); + DrawCurrentTemp(glibContext, mCurrentTempCelsius); + DrawFooter(glibContext, false); + +#if SL_LCDCTRL_MUX + sl_wfx_host_pre_lcd_spi_transfer(); +#endif // SL_LCDCTRL_MUX + DMD_updateDisplay(); +#if SL_LCDCTRL_MUX + sl_wfx_host_post_lcd_spi_transfer(); +#endif // SL_LCDCTRL_MUX +} + +/** + * @brief Set the current temperature of the refrigerator. + * @param int8_t temp The current temperature in Celsius + */ +void RefrigeratorUI::SetCurrentTemp(int8_t temp) +{ + mCurrentTempCelsius = temp; +} + +/** + * @brief Set the operating mode of the refrigerator. + * @param uint8_t mode Mode of the refrigerator (e.g., cooling, defrosting) + */ +void RefrigeratorUI::SetMode(uint8_t mode) +{ + mMode = mode; +} + +/** + * @brief Draw the header of the UI, usually displaying the title or current status. + * @param GLIB_Context_t * pointer to the context for the GLIB library + */ +void RefrigeratorUI::DrawHeader(GLIB_Context_t * glibContext) +{ + // Draw Silabs Corner icon + GLIB_drawBitmap(glibContext, SILABS_ICON_POSITION_X, STATUS_ICON_LINE, SILABS_LOGO_WIDTH, SILABS_LOGO_HEIGHT, silabsLogo); + // Draw BLE Icon + GLIB_drawBitmap(glibContext, BLE_ICON_POSITION_X, STATUS_ICON_LINE, BLUETOOTH_ICON_SIZE, BLUETOOTH_ICON_SIZE, bleLogo); + // Draw WiFi/OpenThread Icon + GLIB_drawBitmap(glibContext, NETWORK_ICON_POSITION_X, STATUS_ICON_LINE, (UI_WIFI) ? WIFI_BITMAP_HEIGHT : THREAD_BITMAP_WIDTH, + WIFI_BITMAP_HEIGHT, (UI_WIFI) ? wifiLogo : threadLogo); + // Draw Matter Icon + GLIB_drawBitmap(glibContext, MATTER_ICON_POSITION_X, STATUS_ICON_LINE, MATTER_LOGO_WIDTH, MATTER_LOGO_HEIGHT, matterLogoBitmap); +#if SL_LCDCTRL_MUX + sl_wfx_host_pre_lcd_spi_transfer(); +#endif // SL_LCDCTRL_MUX + DMD_updateDisplay(); +#if SL_LCDCTRL_MUX + sl_wfx_host_post_lcd_spi_transfer(); +#endif // SL_LCDCTRL_MUX +} + +/** + * @brief Draw the footer of the UI, which may display additional information such as mode. + * @param GLIB_Context_t * pointer to the context for the GLIB library + * @param bool autoMode Whether the refrigerator is in automatic mode + */ +void RefrigeratorUI::DrawFooter(GLIB_Context_t * glibContext, bool autoMode) +{ + // TODO:: Need to implement this function + +#if SL_LCDCTRL_MUX + sl_wfx_host_pre_lcd_spi_transfer(); +#endif // SL_LCDCTRL_MUX + DMD_updateDisplay(); +#if SL_LCDCTRL_MUX + sl_wfx_host_post_lcd_spi_transfer(); +#endif // SL_LCDCTRL_MUX +} + +/** + * @brief Draw a 2 digit Temp of screen. Because of this Celsius is used by default + * @param GLIB_Context_t * pointer to the context for the GLIB library + * @param int8_t current Temperature in Celsius + * @param int8_t setPoint in Celsius + * @param bool isCelsius By default set to True. For future development + */ +void RefrigeratorUI::DrawCurrentTemp(GLIB_Context_t * glibContext, int8_t temp, bool isCelsius) +{ + uint8_t tempArray[2]; + uint8_t position_x = 10; + uint8_t * data; + + if (temp > 99 || temp < -99) + { + // Invalid temp for a house thermostat + return; + } + + if (temp < 0) + { + for (uint8_t y = 60; y < 64; y++) + { + for (uint8_t x = 1; x < 10; x++) + { + GLIB_drawPixel(glibContext, x, y); + } + } + + temp = temp * -1; + } + + // Draw Unit + if (isCelsius) + { + data = (uint8_t *) &monaco_48pt[DEGREE_INDEX]; + DrawFont(glibContext, 65, kTempLcdInitialX, 15, data, MONACO_FONT_CH_LENGTH); + data = (uint8_t *) &monaco_48pt[CELSIUS_INDEX]; + DrawFont(glibContext, 70, kTempLcdInitialX, 15, data, MONACO_FONT_CH_LENGTH); + } + else + { + data = (uint8_t *) &monaco_48pt[DEGREE_INDEX]; + DrawFont(glibContext, 65, 25, 15, data, MONACO_FONT_CH_LENGTH); // 25 to fit with f of fahrenheint + data = (uint8_t *) &monaco_48pt[FAHRENHEIT_INDEX]; + DrawFont(glibContext, 70, kTempLcdInitialX, 15, data, MONACO_FONT_CH_LENGTH); + } + + // Print Current temp + tempArray[0] = (uint8_t) ((temp / 10)); + tempArray[1] = (uint8_t) ((temp % 10)); + + for (uint8_t ch = 0; ch < 2; ch++) + { + data = (uint8_t *) &monaco_48pt[tempArray[ch] * MONACO_FONT_NB_LENGTH]; + DrawFont(glibContext, position_x, kTempLcdInitialX, MONACO_FONT_WIDTH, data, MONACO_FONT_NB_LENGTH); + position_x += MONACO_FONT_WIDTH; + } +} + +/** + * @brief Draw a font at a specified position on the screen. + * @param GLIB_Context_t * pointer to the context for the GLIB library + * @param uint8_t initial_x X-coordinate for the starting position + * @param uint8_t initial_y Y-coordinate for the starting position + * @param uint8_t width Width of the font to be drawn + * @param uint8_t * data Pointer to the font data + * @param uint32_t size Size of the font data in bytes + */ +void RefrigeratorUI::DrawFont(GLIB_Context_t * glibContext, uint8_t initial_x, uint8_t initial_y, uint8_t width, uint8_t * data, + uint32_t size) +{ + uint8_t x = initial_x, y = initial_y; + for (uint16_t i = 0; i < size; i++) + { + for (uint8_t mask = 0; mask < 8; mask++) + { + if (!(data[i] & (0x01 << mask))) + { + GLIB_drawPixel(glibContext, x, y); + } + // Check line changes + if (((x - initial_x) % width) == 0 && x != initial_x) + { + x = initial_x; + y++; + // Font is 8 bit align with paddings bits; + mask = 8; + } + else + { + x++; + } + } + } +} + +/** + * @brief Draw the set point temperature on the screen. + * @param GLIB_Context_t * pointer to the context for the GLIB library + * @param int8_t setPoint The set point temperature in Celsius + * @param bool secondLine Whether to display on the second line (true) or first line (false) + */ +void RefrigeratorUI::DrawSetPoint(GLIB_Context_t * glibContext, int8_t setPoint, bool secondLine) +{ + char setPointLine[] = { '-', 'X', 'X', '\0' }; + + if (setPoint > 99 || setPoint < -99) + { + return; + } + + // Update SetPoint string + if (setPoint < 0) + { + setPointLine[0] = (setPoint < 0) ? '-' : ' '; + setPoint *= -1; + setPointLine[1] = ((setPoint / 10) + 0x30); + setPointLine[2] = ((setPoint % 10) + 0x30); + } + else + { + setPointLine[0] = ((setPoint / 10) + 0x30); + setPointLine[1] = ((setPoint % 10) + 0x30); + setPointLine[2] = '\0'; + } + + // Print SetPoint + GLIB_drawStringOnLine(glibContext, setPointLine, (secondLine) ? 8 : 7, GLIB_ALIGN_LEFT, 67, 0, true); +} diff --git a/examples/refrigerator-app/silabs/src/ZclCallbacks.cpp b/examples/refrigerator-app/silabs/src/ZclCallbacks.cpp new file mode 100644 index 0000000000..bd9febc75e --- /dev/null +++ b/examples/refrigerator-app/silabs/src/ZclCallbacks.cpp @@ -0,0 +1,87 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * This file implements the handler for data model messages. + */ + +#include "AppConfig.h" +#include "RefrigeratorManager.h" +#include +#include +#include +#include + +#ifdef DIC_ENABLE +#include "dic_control.h" +#endif // DIC_ENABLE + +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; + ChipLogProgress(Zcl, "Cluster callback: " ChipLogFormatMEI, ChipLogValueMEI(clusterId)); + + switch (clusterId) + { + case app::Clusters::Identify::Id: + ChipLogProgress(Zcl, "Identify cluster ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u", + ChipLogValueMEI(attributePath.mAttributeId), type, *value, size); + break; + case app::Clusters::RefrigeratorAlarm::Id: + RefrigeratorMgr().RefAlaramAttributeChangeHandler(attributePath.mEndpointId, attributeId, value, size); +#ifdef DIC_ENABLE + dic::control::AttributeHandler(attributePath.mEndpointId, attributeId); +#endif // DIC_ENABLE + break; + case app::Clusters::TemperatureControl::Id: + RefrigeratorMgr().TempCtrlAttributeChangeHandler(attributePath.mEndpointId, attributeId, value, size); +#ifdef DIC_ENABLE + dic::control::AttributeHandler(attributePath.mEndpointId, attributeId); +#endif // DIC_ENABLE + break; + default: + break; + } +} + +/** @brief Refrigerator Alarm Cluster Init + * + * This function is called when a specific cluster is initialized. It gives the + * application an opportunity to take care of cluster initialization procedures. + * It is called exactly once for each endpoint where cluster is present. + * + * @param endpoint Ver.: always + * + */ +void emberAfRefrigeratorAlarmClusterInitCallback(EndpointId endpoint) {} + +/** @brief Temperature Control Cluster Init + * + * This function is called when a specific cluster is initialized. It gives the + * application an opportunity to take care of cluster initialization procedures. + * It is called exactly once for each endpoint where cluster is present. + * + * @param endpoint Ver.: always + * + */ +void emberAfTemperatureControlClusterInitCallback(EndpointId endpoint) {} diff --git a/examples/refrigerator-app/silabs/src/refrigerator-and-temperature-controlled-cabinet-mode.cpp b/examples/refrigerator-app/silabs/src/refrigerator-and-temperature-controlled-cabinet-mode.cpp new file mode 100644 index 0000000000..443dcb7f6d --- /dev/null +++ b/examples/refrigerator-app/silabs/src/refrigerator-and-temperature-controlled-cabinet-mode.cpp @@ -0,0 +1,111 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include +#include + +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode; +using chip::Protocols::InteractionModel::Status; +template +using List = chip::app::DataModel::List; +using ModeTagStructType = chip::app::Clusters::detail::Structs::ModeTagStruct::Type; + +static RefrigeratorAndTemperatureControlledCabinetModeDelegate * gRefrigeratorAndTemperatureControlledCabinetModeDelegate = nullptr; +static ModeBase::Instance * gRefrigeratorAndTemperatureControlledCabinetModeInstance = nullptr; + +CHIP_ERROR RefrigeratorAndTemperatureControlledCabinetModeDelegate::Init() +{ + return CHIP_NO_ERROR; +} + +void RefrigeratorAndTemperatureControlledCabinetModeDelegate::HandleChangeToMode( + uint8_t NewMode, ModeBase::Commands::ChangeToModeResponse::Type & response) +{ + response.status = to_underlying(ModeBase::StatusCode::kSuccess); +} + +CHIP_ERROR RefrigeratorAndTemperatureControlledCabinetModeDelegate::GetModeLabelByIndex(uint8_t modeIndex, + chip::MutableCharSpan & label) +{ + if (modeIndex >= ArraySize(kModeOptions)) + { + return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED; + } + return chip::CopyCharSpanToMutableCharSpan(kModeOptions[modeIndex].label, label); +} + +CHIP_ERROR RefrigeratorAndTemperatureControlledCabinetModeDelegate::GetModeValueByIndex(uint8_t modeIndex, uint8_t & value) +{ + if (modeIndex >= ArraySize(kModeOptions)) + { + return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED; + } + value = kModeOptions[modeIndex].mode; + return CHIP_NO_ERROR; +} + +CHIP_ERROR RefrigeratorAndTemperatureControlledCabinetModeDelegate::GetModeTagsByIndex(uint8_t modeIndex, + List & tags) +{ + if (modeIndex >= ArraySize(kModeOptions)) + { + return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED; + } + + if (tags.size() < kModeOptions[modeIndex].modeTags.size()) + { + return CHIP_ERROR_INVALID_ARGUMENT; + } + + std::copy(kModeOptions[modeIndex].modeTags.begin(), kModeOptions[modeIndex].modeTags.end(), tags.begin()); + tags.reduce_size(kModeOptions[modeIndex].modeTags.size()); + + return CHIP_NO_ERROR; +} + +ModeBase::Instance * RefrigeratorAndTemperatureControlledCabinetMode::Instance() +{ + return gRefrigeratorAndTemperatureControlledCabinetModeInstance; +} + +void RefrigeratorAndTemperatureControlledCabinetMode::Shutdown() +{ + if (gRefrigeratorAndTemperatureControlledCabinetModeInstance != nullptr) + { + delete gRefrigeratorAndTemperatureControlledCabinetModeInstance; + gRefrigeratorAndTemperatureControlledCabinetModeInstance = nullptr; + } + if (gRefrigeratorAndTemperatureControlledCabinetModeDelegate != nullptr) + { + delete gRefrigeratorAndTemperatureControlledCabinetModeDelegate; + gRefrigeratorAndTemperatureControlledCabinetModeDelegate = nullptr; + } +} + +void emberAfRefrigeratorAndTemperatureControlledCabinetModeClusterInitCallback(chip::EndpointId endpointId) +{ + VerifyOrDie(endpointId == 1); // this cluster is only enabled for endpoint 1. + VerifyOrDie(gRefrigeratorAndTemperatureControlledCabinetModeDelegate == nullptr && + gRefrigeratorAndTemperatureControlledCabinetModeInstance == nullptr); + gRefrigeratorAndTemperatureControlledCabinetModeDelegate = + new RefrigeratorAndTemperatureControlledCabinetMode::RefrigeratorAndTemperatureControlledCabinetModeDelegate; + gRefrigeratorAndTemperatureControlledCabinetModeInstance = + new ModeBase::Instance(gRefrigeratorAndTemperatureControlledCabinetModeDelegate, 0x1, + RefrigeratorAndTemperatureControlledCabinetMode::Id, chip::to_underlying(Feature::kOnOff)); + gRefrigeratorAndTemperatureControlledCabinetModeInstance->Init(); +} diff --git a/examples/refrigerator-app/silabs/third_party/connectedhomeip b/examples/refrigerator-app/silabs/third_party/connectedhomeip new file mode 120000 index 0000000000..11a54ed360 --- /dev/null +++ b/examples/refrigerator-app/silabs/third_party/connectedhomeip @@ -0,0 +1 @@ +../../../../ \ No newline at end of file From 89ef86da843b29138ebb5ee7369b0936134676ad Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Fri, 11 Oct 2024 18:47:35 +0200 Subject: [PATCH 100/127] [darwin-framework-tool] Add a memory dump-graph command (#36017) --- examples/darwin-framework-tool/BUILD.gn | 5 ++ .../commands/memory/Commands.h | 32 ++++++++ .../commands/memory/DumpMemoryGraphCommand.h | 42 ++++++++++ .../commands/memory/DumpMemoryGraphCommand.mm | 28 +++++++ .../commands/memory/LeaksTool.h | 24 ++++++ .../commands/memory/LeaksTool.mm | 79 +++++++++++++++++++ examples/darwin-framework-tool/main.mm | 2 + .../Matter.xcodeproj/project.pbxproj | 28 +++++++ 8 files changed, 240 insertions(+) create mode 100644 examples/darwin-framework-tool/commands/memory/Commands.h create mode 100644 examples/darwin-framework-tool/commands/memory/DumpMemoryGraphCommand.h create mode 100644 examples/darwin-framework-tool/commands/memory/DumpMemoryGraphCommand.mm create mode 100644 examples/darwin-framework-tool/commands/memory/LeaksTool.h create mode 100644 examples/darwin-framework-tool/commands/memory/LeaksTool.mm diff --git a/examples/darwin-framework-tool/BUILD.gn b/examples/darwin-framework-tool/BUILD.gn index 2c202475a7..5e7b7d6410 100644 --- a/examples/darwin-framework-tool/BUILD.gn +++ b/examples/darwin-framework-tool/BUILD.gn @@ -209,6 +209,11 @@ executable("darwin-framework-tool") { "commands/discover/Commands.h", "commands/discover/DiscoverCommissionablesCommand.h", "commands/discover/DiscoverCommissionablesCommand.mm", + "commands/memory/Commands.h", + "commands/memory/DumpMemoryGraphCommand.h", + "commands/memory/DumpMemoryGraphCommand.mm", + "commands/memory/LeaksTool.h", + "commands/memory/LeaksTool.mm", "commands/pairing/Commands.h", "commands/pairing/DeviceControllerDelegateBridge.mm", "commands/pairing/GetCommissionerNodeIdCommand.h", diff --git a/examples/darwin-framework-tool/commands/memory/Commands.h b/examples/darwin-framework-tool/commands/memory/Commands.h new file mode 100644 index 0000000000..d58d62db1c --- /dev/null +++ b/examples/darwin-framework-tool/commands/memory/Commands.h @@ -0,0 +1,32 @@ +/* + * 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 "commands/common/Commands.h" +#include "commands/memory/DumpMemoryGraphCommand.h" + +void registerCommandsMemory(Commands & commands) +{ + const char * clusterName = "memory"; + commands_list clusterCommands = { + make_unique(), + }; + + commands.RegisterCommandSet(clusterName, clusterCommands, "Commands for inspecting program memory."); +} diff --git a/examples/darwin-framework-tool/commands/memory/DumpMemoryGraphCommand.h b/examples/darwin-framework-tool/commands/memory/DumpMemoryGraphCommand.h new file mode 100644 index 0000000000..a4eedfe617 --- /dev/null +++ b/examples/darwin-framework-tool/commands/memory/DumpMemoryGraphCommand.h @@ -0,0 +1,42 @@ +/* + * 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 "../common/CHIPCommandBridge.h" + +#include + +/** + * This command dump the memory graph of the program. + */ + +class DumpMemoryGraphCommand : public CHIPCommandBridge +{ +public: + DumpMemoryGraphCommand() : CHIPCommandBridge("dump-graph") + { + AddArgument("filepath", &mFilePath, + "An optional filepath to save the memory graph to. Defaults to 'darwin-framework-tool.memgraph"); + } + + /////////// CHIPCommandBridge Interface ///////// + CHIP_ERROR RunCommand() override; + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Milliseconds32(0); } + +private: + chip::Optional mFilePath; +}; diff --git a/examples/darwin-framework-tool/commands/memory/DumpMemoryGraphCommand.mm b/examples/darwin-framework-tool/commands/memory/DumpMemoryGraphCommand.mm new file mode 100644 index 0000000000..15bb462f4c --- /dev/null +++ b/examples/darwin-framework-tool/commands/memory/DumpMemoryGraphCommand.mm @@ -0,0 +1,28 @@ +/* + * 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 "DumpMemoryGraphCommand.h" + +#include "LeaksTool.h" + +CHIP_ERROR DumpMemoryGraphCommand::RunCommand() +{ + auto err = DumpMemoryGraph(mFilePath); + SetCommandExitStatus(err); + return err; +} diff --git a/examples/darwin-framework-tool/commands/memory/LeaksTool.h b/examples/darwin-framework-tool/commands/memory/LeaksTool.h new file mode 100644 index 0000000000..101b437932 --- /dev/null +++ b/examples/darwin-framework-tool/commands/memory/LeaksTool.h @@ -0,0 +1,24 @@ +/* + * 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 + +CHIP_ERROR DumpMemoryGraph(chip::Optional filePath); +CHIP_ERROR PrintPools(); diff --git a/examples/darwin-framework-tool/commands/memory/LeaksTool.mm b/examples/darwin-framework-tool/commands/memory/LeaksTool.mm new file mode 100644 index 0000000000..912134e163 --- /dev/null +++ b/examples/darwin-framework-tool/commands/memory/LeaksTool.mm @@ -0,0 +1,79 @@ +/* + * 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 "LeaksTool.h" + +#import +#include // For getpid() + +constexpr const char * kDefaultOutputGraphPath = "darwin-framework-tool.memgraph"; + +@interface LeaksTool : NSObject +- (BOOL)runWithArguments:(NSArray * _Nullable)arguments; +@end + +@implementation LeaksTool + +- (BOOL)runWithArguments:(NSArray * _Nullable)arguments +{ + pid_t pid = getpid(); + __auto_type * pidString = [NSString stringWithFormat:@"%d", pid]; + + __auto_type * task = [[NSTask alloc] init]; + task.launchPath = @"/usr/bin/leaks"; + task.arguments = @[ pidString ]; + if (arguments) { + task.arguments = [task.arguments arrayByAddingObjectsFromArray:arguments]; + } + + __auto_type * pipe = [NSPipe pipe]; + task.standardOutput = pipe; + task.standardError = pipe; + + __auto_type * fileHandle = [pipe fileHandleForReading]; + [task launch]; + [task waitUntilExit]; + + int exitCode = [task terminationStatus]; + if (exitCode != EXIT_SUCCESS) { + return NO; + } + + __auto_type * data = [fileHandle readDataToEndOfFile]; + __auto_type * output = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + NSLog(@"%@", output); + + return YES; +} + +@end + +CHIP_ERROR DumpMemoryGraph(chip::Optional filePath) +{ + NSMutableString * outputGraphArgument = [NSMutableString stringWithFormat:@"--outputGraph=%s", kDefaultOutputGraphPath]; + if (filePath.HasValue()) { + outputGraphArgument = [NSMutableString stringWithFormat:@"--outputGraph=%s", filePath.Value()]; + } + + __auto_type * leaksTool = [[LeaksTool alloc] init]; + if (![leaksTool runWithArguments:@[ outputGraphArgument ]]) { + return CHIP_ERROR_INTERNAL; + } + + return CHIP_NO_ERROR; +} diff --git a/examples/darwin-framework-tool/main.mm b/examples/darwin-framework-tool/main.mm index ad31cfe32e..e0c6e94224 100644 --- a/examples/darwin-framework-tool/main.mm +++ b/examples/darwin-framework-tool/main.mm @@ -27,6 +27,7 @@ #include "commands/delay/Commands.h" #include "commands/discover/Commands.h" #include "commands/interactive/Commands.h" +#include "commands/memory/Commands.h" #include "commands/pairing/Commands.h" #include "commands/payload/Commands.h" #include "commands/provider/Commands.h" @@ -46,6 +47,7 @@ int main(int argc, const char * argv[]) registerCommandsDelay(commands); registerCommandsDiscover(commands); registerCommandsInteractive(commands); + registerCommandsMemory(commands); registerCommandsPayload(commands); registerClusterOtaSoftwareUpdateProviderInteractive(commands); registerCommandsStorage(commands); diff --git a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj index 8a39c63440..488bd32967 100644 --- a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj +++ b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj @@ -329,6 +329,11 @@ B2E0D7B7245B0B5C003C5B48 /* MTRQRCodeSetupPayloadParser.mm in Sources */ = {isa = PBXBuildFile; fileRef = B2E0D7AE245B0B5C003C5B48 /* MTRQRCodeSetupPayloadParser.mm */; }; B2E0D7B8245B0B5C003C5B48 /* MTRSetupPayload.h in Headers */ = {isa = PBXBuildFile; fileRef = B2E0D7AF245B0B5C003C5B48 /* MTRSetupPayload.h */; settings = {ATTRIBUTES = (Public, ); }; }; B2E0D7B9245B0B5C003C5B48 /* MTRSetupPayload.mm in Sources */ = {isa = PBXBuildFile; fileRef = B2E0D7B0245B0B5C003C5B48 /* MTRSetupPayload.mm */; }; + B43B39EA2CB859A5006AA284 /* DumpMemoryGraphCommand.mm in Sources */ = {isa = PBXBuildFile; fileRef = B43B39E62CB859A5006AA284 /* DumpMemoryGraphCommand.mm */; }; + B43B39EB2CB859A5006AA284 /* LeaksTool.mm in Sources */ = {isa = PBXBuildFile; fileRef = B43B39E82CB859A5006AA284 /* LeaksTool.mm */; }; + B43B39EC2CB859A5006AA284 /* DumpMemoryGraphCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = B43B39E52CB859A5006AA284 /* DumpMemoryGraphCommand.h */; }; + B43B39ED2CB859A5006AA284 /* Commands.h in Headers */ = {isa = PBXBuildFile; fileRef = B43B39E42CB859A5006AA284 /* Commands.h */; }; + B43B39EE2CB859A5006AA284 /* LeaksTool.h in Headers */ = {isa = PBXBuildFile; fileRef = B43B39E72CB859A5006AA284 /* LeaksTool.h */; }; B45373AA2A9FE73400807602 /* WebSocketServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B45373A92A9FE73400807602 /* WebSocketServer.cpp */; }; B45373BD2A9FEA9100807602 /* service.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373B22A9FEA9000807602 /* service.c */; settings = {COMPILER_FLAGS = "-Wno-error -Wno-unreachable-code -Wno-conversion -Wno-format-nonliteral"; }; }; B45373BE2A9FEA9100807602 /* network.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373B32A9FEA9000807602 /* network.c */; settings = {COMPILER_FLAGS = "-Wno-error -Wno-unreachable-code -Wno-conversion -Wno-format-nonliteral"; }; }; @@ -775,6 +780,11 @@ B2E0D7AE245B0B5C003C5B48 /* MTRQRCodeSetupPayloadParser.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRQRCodeSetupPayloadParser.mm; sourceTree = ""; }; B2E0D7AF245B0B5C003C5B48 /* MTRSetupPayload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRSetupPayload.h; sourceTree = ""; }; B2E0D7B0245B0B5C003C5B48 /* MTRSetupPayload.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRSetupPayload.mm; sourceTree = ""; }; + B43B39E42CB859A5006AA284 /* Commands.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Commands.h; sourceTree = ""; }; + B43B39E52CB859A5006AA284 /* DumpMemoryGraphCommand.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DumpMemoryGraphCommand.h; sourceTree = ""; }; + B43B39E62CB859A5006AA284 /* DumpMemoryGraphCommand.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = DumpMemoryGraphCommand.mm; sourceTree = ""; }; + B43B39E72CB859A5006AA284 /* LeaksTool.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LeaksTool.h; sourceTree = ""; }; + B43B39E82CB859A5006AA284 /* LeaksTool.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = LeaksTool.mm; sourceTree = ""; }; B45373A92A9FE73400807602 /* WebSocketServer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebSocketServer.cpp; sourceTree = ""; }; B45373B22A9FEA9000807602 /* service.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = service.c; path = "repo/lib/core-net/service.c"; sourceTree = ""; }; B45373B32A9FEA9000807602 /* network.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = network.c; path = "repo/lib/core-net/network.c"; sourceTree = ""; }; @@ -897,6 +907,7 @@ 037C3D7B2991BD4F00B7EEE2 /* commands */ = { isa = PBXGroup; children = ( + B43B39E92CB859A5006AA284 /* memory */, 5124311D2BA0C09A000BC136 /* configuration */, B4FCD56C2B603A6300832859 /* bdx */, B4E262182AA0CFFE00DBA5BC /* delay */, @@ -1484,6 +1495,18 @@ path = CHIPTests; sourceTree = ""; }; + B43B39E92CB859A5006AA284 /* memory */ = { + isa = PBXGroup; + children = ( + B43B39E42CB859A5006AA284 /* Commands.h */, + B43B39E52CB859A5006AA284 /* DumpMemoryGraphCommand.h */, + B43B39E62CB859A5006AA284 /* DumpMemoryGraphCommand.mm */, + B43B39E72CB859A5006AA284 /* LeaksTool.h */, + B43B39E82CB859A5006AA284 /* LeaksTool.mm */, + ); + path = memory; + sourceTree = ""; + }; B45373AD2A9FE9BF00807602 /* libwebsockets */ = { isa = PBXGroup; children = ( @@ -1619,6 +1642,9 @@ 037C3DD12991BD5200B7EEE2 /* Commands.h in Headers */, 037C3DB92991BD5000B7EEE2 /* ReportCommandBridge.h in Headers */, 037C3DBE2991BD5000B7EEE2 /* OTASoftwareUpdateInteractive.h in Headers */, + B43B39EC2CB859A5006AA284 /* DumpMemoryGraphCommand.h in Headers */, + B43B39ED2CB859A5006AA284 /* Commands.h in Headers */, + B43B39EE2CB859A5006AA284 /* LeaksTool.h in Headers */, 037C3DBD2991BD5000B7EEE2 /* OTAProviderDelegate.h in Headers */, B4FCD5702B603A6300832859 /* Commands.h in Headers */, 037C3DB02991BD4F00B7EEE2 /* Commands.h in Headers */, @@ -1945,6 +1971,8 @@ B45373DF2A9FEB6F00807602 /* system.c in Sources */, B45373FC2A9FEC4F00807602 /* unix-caps.c in Sources */, B45373FE2A9FEC4F00807602 /* unix-fds.c in Sources */, + B43B39EA2CB859A5006AA284 /* DumpMemoryGraphCommand.mm in Sources */, + B43B39EB2CB859A5006AA284 /* LeaksTool.mm in Sources */, B45374002A9FEC4F00807602 /* unix-init.c in Sources */, B45373FF2A9FEC4F00807602 /* unix-misc.c in Sources */, E04AC67E2BEEA17F00BA409B /* ember-io-storage.cpp in Sources */, From 7287041ce3a5f9b50426ab3b938ad3a959320313 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Fri, 11 Oct 2024 18:57:18 +0200 Subject: [PATCH 101/127] [YAML] Add _ById commands support for darwin-framework-tool (#35996) --- .../matter_chip_tool_adapter/decoder.py | 40 ++++++++++- .../matter_chip_tool_adapter/encoder.py | 11 +++- .../commands/clusters/ClusterCommandBridge.h | 12 +++- .../commands/clusters/ReportCommandBridge.h | 25 +++++-- .../clusters/WriteAttributeCommandBridge.h | 11 +++- .../commands/common/RemoteDataModelLogger.mm | 66 ++++++++++++++++++- 6 files changed, 149 insertions(+), 16 deletions(-) diff --git a/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/decoder.py b/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/decoder.py index 68effa7bb3..73b451c826 100644 --- a/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/decoder.py +++ b/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/decoder.py @@ -155,6 +155,7 @@ class Converter(): def __init__(self, specifications): self.__specs = specifications self.__converters = [ + DarwinAnyFormatConverter(), StructFieldsNameConverter(), FloatConverter(), OctetStringConverter() @@ -252,6 +253,43 @@ def maybe_convert(self, typename: str, value): return value +class DarwinAnyFormatConverter(BaseConverter): + """ + Darwin payloads format for *ById commands is different from the base + format used for other commands. + """ + + def run(self, specs, value, cluster_name: str, typename: str, array: bool): + if isinstance(value, list) and len(value) >= 1 and isinstance(value[0], dict) and value[0].get('data') is not None: + value = [self.__convert(item_value) for item_value in value] + return value + + def __convert(self, value): + if not isinstance(value, dict): + return value + + data = value.get('data') + if not isinstance(data, dict): + return value + + value = data.get('value') + if not isinstance(value, list): + return value + + value_type = data.get('type') + + if value_type == 'Structure': + struct = {} + for field in value: + context_tag = field.get('contextTag') + struct[str(context_tag)] = self.__convert(field) + value = struct + elif value_type == 'Array': + value = [self.__convert(item_value) for item_value in value] + + return value + + class FloatConverter(BaseConverter): """ Jsoncpp stores floats as double. @@ -348,7 +386,7 @@ def run(self, specs, value, cluster_name: str, typename: str, array: bool): del value[key_name] elif isinstance(value, list) and array: - value = [self.run(specs, v, cluster_name, typename, False) + value = [self.run(specs, v, cluster_name, typename, isinstance(v, list)) for v in value] return value diff --git a/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py b/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py index 252d23c037..6b1bf1a6e0 100644 --- a/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py +++ b/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py @@ -510,7 +510,16 @@ def __get_alias(self, cluster_name: str, command_name: str = None, argument_name if aliases is None or aliases.get(argument_name) is None: return None - return aliases.get(argument_name) + value = aliases.get(argument_name) + + if cluster_name == '*' and self.__is_darwin_framework_tool: + if argument_name == 'AttributeId': + return 'attribute-id' + elif argument_name == 'ClusterId': + return 'cluster-id' + elif argument_name == 'Value': + return 'attribute-value' + return value def _supports_endpoint(self, request): return self._has_support(request, 'has_endpoint') diff --git a/examples/darwin-framework-tool/commands/clusters/ClusterCommandBridge.h b/examples/darwin-framework-tool/commands/clusters/ClusterCommandBridge.h index 4512bf219a..7bf34f11a6 100644 --- a/examples/darwin-framework-tool/commands/clusters/ClusterCommandBridge.h +++ b/examples/darwin-framework-tool/commands/clusters/ClusterCommandBridge.h @@ -73,10 +73,13 @@ class ClusterCommand : public ModelCommand { uint16_t __block responsesNeeded = repeatCount; dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * endpoint = @(endpointId); + __auto_type * cluster = @(clusterId); + __auto_type * command = @(commandId); while (repeatCount--) { - [device invokeCommandWithEndpointID:[NSNumber numberWithUnsignedShort:endpointId] - clusterID:[NSNumber numberWithUnsignedInteger:clusterId] - commandID:[NSNumber numberWithUnsignedInteger:commandId] + [device invokeCommandWithEndpointID:endpoint + clusterID:cluster + commandID:command commandFields:commandFields timedInvokeTimeout:mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] @@ -88,6 +91,9 @@ class ClusterCommand : public ModelCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(endpoint, cluster, command, error); + } else { + RemoteDataModelLogger::LogCommandAsJSON(endpoint, cluster, command, values); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); diff --git a/examples/darwin-framework-tool/commands/clusters/ReportCommandBridge.h b/examples/darwin-framework-tool/commands/clusters/ReportCommandBridge.h index c0cbdab840..1a2612b7e3 100644 --- a/examples/darwin-framework-tool/commands/clusters/ReportCommandBridge.h +++ b/examples/darwin-framework-tool/commands/clusters/ReportCommandBridge.h @@ -57,20 +57,26 @@ class ReadAttribute : public ModelCommand { if (mFabricFiltered.HasValue()) { params.filterByFabric = mFabricFiltered.Value(); } + + __auto_type * endpoint = @(endpointId); + __auto_type * cluster = @(mClusterId); + __auto_type * attribute = @(mAttributeId); [device - readAttributesWithEndpointID:[NSNumber numberWithUnsignedShort:endpointId] - clusterID:[NSNumber numberWithUnsignedInteger:mClusterId] - attributeID:[NSNumber numberWithUnsignedInteger:mAttributeId] + readAttributesWithEndpointID:endpoint + clusterID:cluster + attributeID:attribute params:params queue:callbackQueue completion:^(NSArray *> * _Nullable values, NSError * _Nullable error) { if (error != nil) { LogNSError("Error reading attribute", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(endpoint, cluster, attribute, error); } if (values) { for (id item in values) { NSLog(@"Response Item: %@", [item description]); } + RemoteDataModelLogger::LogAttributeAsJSON(endpoint, cluster, attribute, values); } SetCommandExitStatus(error); }]; @@ -137,16 +143,23 @@ class SubscribeAttribute : public ModelCommand { params.resubscribeAutomatically = mAutoResubscribe.Value(); } - [device subscribeToAttributesWithEndpointID:[NSNumber numberWithUnsignedShort:endpointId] - clusterID:[NSNumber numberWithUnsignedInteger:mClusterId] - attributeID:[NSNumber numberWithUnsignedInteger:mAttributeId] + __auto_type * endpoint = @(endpointId); + __auto_type * cluster = @(mClusterId); + __auto_type * attribute = @(mAttributeId); + [device subscribeToAttributesWithEndpointID:endpoint + clusterID:cluster + attributeID:attribute params:params queue:callbackQueue reportHandler:^(NSArray *> * _Nullable values, NSError * _Nullable error) { + if (error != nil) { + RemoteDataModelLogger::LogAttributeErrorAsJSON(endpoint, cluster, attribute, error); + } if (values) { for (id item in values) { NSLog(@"Response Item: %@", [item description]); } + RemoteDataModelLogger::LogAttributeAsJSON(endpoint, cluster, attribute, values); } SetCommandExitStatus(error); } diff --git a/examples/darwin-framework-tool/commands/clusters/WriteAttributeCommandBridge.h b/examples/darwin-framework-tool/commands/clusters/WriteAttributeCommandBridge.h index e771316adf..66003042cc 100644 --- a/examples/darwin-framework-tool/commands/clusters/WriteAttributeCommandBridge.h +++ b/examples/darwin-framework-tool/commands/clusters/WriteAttributeCommandBridge.h @@ -74,10 +74,13 @@ class WriteAttribute : public ModelCommand { { dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * endpoint = @(endpointId); + __auto_type * cluster = @(mClusterId); + __auto_type * attribute = @(mAttributeId); [device - writeAttributeWithEndpointID:[NSNumber numberWithUnsignedShort:endpointId] - clusterID:[NSNumber numberWithUnsignedInteger:clusterId] - attributeID:[NSNumber numberWithUnsignedInteger:attributeId] + writeAttributeWithEndpointID:endpoint + clusterID:cluster + attributeID:attribute value:value timedWriteTimeout:mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] @@ -86,11 +89,13 @@ class WriteAttribute : public ModelCommand { completion:^(NSArray *> * _Nullable values, NSError * _Nullable error) { if (error != nil) { LogNSError("Error writing attribute", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(endpoint, cluster, attribute, error); } if (values) { for (id item in values) { NSLog(@"Response Item: %@", [item description]); } + RemoteDataModelLogger::LogAttributeAsJSON(endpoint, cluster, attribute, values); } SetCommandExitStatus(error); }]; diff --git a/examples/darwin-framework-tool/commands/common/RemoteDataModelLogger.mm b/examples/darwin-framework-tool/commands/common/RemoteDataModelLogger.mm index ff12cdc022..50d446b780 100644 --- a/examples/darwin-framework-tool/commands/common/RemoteDataModelLogger.mm +++ b/examples/darwin-framework-tool/commands/common/RemoteDataModelLogger.mm @@ -27,6 +27,8 @@ #include +constexpr char kAttributePathKey[] = "attributePath"; +constexpr char kCommandPathKey[] = "commandPath"; constexpr char kClusterIdKey[] = "clusterId"; constexpr char kEndpointIdKey[] = "endpointId"; constexpr char kAttributeIdKey[] = "attributeId"; @@ -142,8 +144,45 @@ CHIP_ERROR LogAttributeAsJSON(NSNumber * endpointId, NSNumber * clusterId, NSNum Json::Value jsonValue; VerifyOrDie(CHIP_NO_ERROR == AsJsonValue(result, jsonValue)); - value[kValueKey] = jsonValue; + // When using the *-by-id commands, the return format is always encapsulated + // within an array. If the attribute itself is an empty array, the result will + // appear as follows: + // + //[ + // { + // attributePath = ""; + // data = { + // type = Array; + // value = ( + // ); + // }; + // } + //] + bool hasData = false; + if (jsonValue.isArray() && !jsonValue.empty()) { + for (Json::ArrayIndex i = 0; i < jsonValue.size(); i++) { + if (jsonValue[i].isObject()) { + if (jsonValue[i].isMember(kAttributePathKey)) { + jsonValue[i].removeMember(kAttributePathKey); + } + + if (!jsonValue[i].empty()) { + hasData = true; + } + } else { + hasData = true; + } + } + } else { + hasData = true; + } + + if (!hasData) { + return CHIP_NO_ERROR; + } + + value[kValueKey] = jsonValue; auto valueStr = JsonToString(value); return gDelegate->LogJSON(valueStr.c_str()); } @@ -159,8 +198,31 @@ CHIP_ERROR LogCommandAsJSON(NSNumber * endpointId, NSNumber * clusterId, NSNumbe Json::Value jsonValue; VerifyOrDie(CHIP_NO_ERROR == AsJsonValue(result, jsonValue)); - value[kValueKey] = jsonValue; + bool hasData = false; + if (jsonValue.isArray()) { + for (Json::ArrayIndex i = 0; i < jsonValue.size(); i++) { + if (jsonValue[i].isObject()) { + if (jsonValue[i].isMember(kCommandPathKey)) { + jsonValue[i].removeMember(kCommandPathKey); + } + + if (!jsonValue[i].empty()) { + hasData = true; + } + } else { + hasData = true; + } + } + } else { + hasData = true; + } + + if (!hasData) { + return CHIP_NO_ERROR; + } + + value[kValueKey] = jsonValue; auto valueStr = JsonToString(value); return gDelegate->LogJSON(valueStr.c_str()); } From d2d06b3865f91570311c199611b31f4c64b8a964 Mon Sep 17 00:00:00 2001 From: Junior Martinez <67972863+jmartinez-silabs@users.noreply.github.com> Date: Fri, 11 Oct 2024 14:46:48 -0400 Subject: [PATCH 102/127] =?UTF-8?q?[Silabs]=20Reduce=20the=20amount=20of?= =?UTF-8?q?=20target=20built=20by=20the=20ci=20while=20keeping=20almost=20?= =?UTF-8?q?the=20sa=E2=80=A6=20(#36043)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Reduce the amount of target build by the ci why keeping almost the same code coverage * Fix missing target change in bloat report --- .github/workflows/examples-efr32.yaml | 45 +++++---------------------- 1 file changed, 7 insertions(+), 38 deletions(-) diff --git a/.github/workflows/examples-efr32.yaml b/.github/workflows/examples-efr32.yaml index 6d28635597..57337d5531 100644 --- a/.github/workflows/examples-efr32.yaml +++ b/.github/workflows/examples-efr32.yaml @@ -68,8 +68,7 @@ jobs: ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py \ --enable-flashbundle \ - --target efr32-brd4187c-thermostat-openthread-mtd \ - --target efr32-brd4187c-air-quality-sensor-app-openthread-mtd \ + --target efr32-brd4187c-thermostat-use-ot-lib \ --target efr32-brd4187c-switch-shell-use-ot-coap-lib \ --target efr32-brd4187c-unit-test \ build \ @@ -82,29 +81,17 @@ jobs: ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py \ --enable-flashbundle \ - --target efr32-brd4187c-light-use-ot-lib \ - --target efr32-brd4187c-pump \ - --target efr32-brd4187c-lock-shell-heap-monitoring \ - build \ - --copy-artifacts-to out/artifacts \ - " - - name: Clean out build output - run: rm -rf ./out - - name: Build BRD4187C variants (3) - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --enable-flashbundle \ + --target efr32-brd4187c-lock-rpc \ + --target efr32-brd4187c-air-quality-sensor-app-shell-heap-monitoring \ --target efr32-brd4187c-window-covering-additional-data-advertising \ - --target efr32-brd4187c-light-rpc \ build \ --copy-artifacts-to out/artifacts \ " - name: Prepare some bloat report from the previous builds run: | .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - efr32 BRD4187C lighting-app \ - out/efr32-brd4187c-light-rpc/matter-silabs-lighting-example.out \ + efr32 BRD4187C lock-app \ + out/efr32-brd4187c-lock-rpc/matter-silabs-lock-example.out \ /tmp/bloat_reports/ .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ efr32 BRD4187C window-app \ @@ -112,12 +99,12 @@ jobs: /tmp/bloat_reports/ - name: Clean out build output run: rm -rf ./out - - name: Build BRD4338A WiFi Soc variants + - name: Build some WiFi Soc variants run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py \ --enable-flashbundle \ - --target efr32-brd4338a-light-skip-rps-generation \ + --target efr32-brd2605a-light-skip-rps-generation \ --target efr32-brd4338a-lock-skip-rps-generation \ build \ --copy-artifacts-to out/artifacts \ @@ -130,24 +117,6 @@ jobs: /tmp/bloat_reports/ - name: Clean out build output run: rm -rf ./out - - name: Build BRD2605A WiFi Soc variants - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --enable-flashbundle \ - --target efr32-brd2605a-light-skip-rps-generation \ - --target efr32-brd2605a-lock-skip-rps-generation \ - build \ - --copy-artifacts-to out/artifacts \ - " - - name: Prepare bloat report for brd2605a lock app - run: | - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - efr32 BRD2605a lock-app \ - out/efr32-brd2605a-lock-skip-rps-generation/matter-silabs-lock-example.out \ - /tmp/bloat_reports/ - - name: Clean out build output - run: rm -rf ./out - name: Build EFR32 with WiFi NCP run: | ./scripts/run_in_build_env.sh \ From 48cf3e5bc2f23a6ecfb1f4969123fc00d24790a5 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 11 Oct 2024 15:55:34 -0400 Subject: [PATCH 103/127] Fix casts when determining endpoint indices. (#36047) Not everything got updated correctly when endpoint indices changed from uint8 to uint16. Fixes https://github.com/project-chip/connectedhomeip/issues/36007 --- src/app/util/attribute-storage.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/util/attribute-storage.cpp b/src/app/util/attribute-storage.cpp index 0d1b3827e8..adc728157c 100644 --- a/src/app/util/attribute-storage.cpp +++ b/src/app/util/attribute-storage.cpp @@ -255,7 +255,7 @@ uint16_t emberAfGetDynamicIndexFromEndpoint(EndpointId id) { if (emAfEndpoints[index].endpoint == id) { - return static_cast(index - FIXED_ENDPOINT_COUNT); + return static_cast(index - FIXED_ENDPOINT_COUNT); } } return kEmberInvalidEndpointIndex; @@ -322,7 +322,7 @@ EndpointId emberAfClearDynamicEndpoint(uint16_t index) { EndpointId ep = 0; - index = static_cast(index + FIXED_ENDPOINT_COUNT); + index = static_cast(index + FIXED_ENDPOINT_COUNT); if ((index < MAX_ENDPOINT_COUNT) && (emAfEndpoints[index].endpoint != kInvalidEndpointId) && (emberAfEndpointIndexIsEnabled(index))) From 8e1ab70ddaa965cb71d8158fd306271611718e96 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Fri, 11 Oct 2024 21:57:20 +0200 Subject: [PATCH 104/127] [darwin-framework-tool] Add some autorelease pools to CHIPCommandBridge::Run to make the memory graph cleaner (#36046) --- .../commands/common/CHIPCommandBridge.mm | 45 +++++++++++-------- 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.mm b/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.mm index 8b9a5d3e9f..d52c29a5b0 100644 --- a/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.mm +++ b/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.mm @@ -40,31 +40,40 @@ CHIP_ERROR CHIPCommandBridge::Run() { - ChipLogProgress(chipTool, "Running Command"); - ReturnErrorOnFailure(MaybeSetUpStack()); - SetIdentity(mCommissionerName.HasValue() ? mCommissionerName.Value() : kIdentityAlpha); + // In interactive mode, we want to avoid memory accumulating in the main autorelease pool, + // so we clear it after each command. + @autoreleasepool { + ChipLogProgress(chipTool, "Running Command"); + // Although the body of `Run` is within its own autorelease pool, this code block is further wrapped + // in an additional autorelease pool. This ensures that when the memory dump graph command is used directly, + // we can verify there’s no additional noise from the autorelease pools—a kind of sanity check. + @autoreleasepool { + ReturnErrorOnFailure(MaybeSetUpStack()); + } + SetIdentity(mCommissionerName.HasValue() ? mCommissionerName.Value() : kIdentityAlpha); - { - std::lock_guard lk(cvWaitingForResponseMutex); - mWaitingForResponse = YES; - } + { + std::lock_guard lk(cvWaitingForResponseMutex); + mWaitingForResponse = YES; + } - ReturnLogErrorOnFailure(RunCommand()); + ReturnLogErrorOnFailure(RunCommand()); - auto err = StartWaiting(GetWaitDuration()); + auto err = StartWaiting(GetWaitDuration()); - bool deferCleanup = (IsInteractive() && DeferInteractiveCleanup()); + bool deferCleanup = (IsInteractive() && DeferInteractiveCleanup()); - Shutdown(); + Shutdown(); - if (deferCleanup) { - sDeferredCleanups.insert(this); - } else { - Cleanup(); - } - MaybeTearDownStack(); + if (deferCleanup) { + sDeferredCleanups.insert(this); + } else { + Cleanup(); + } + MaybeTearDownStack(); - return err; + return err; + } } CHIP_ERROR CHIPCommandBridge::GetPAACertsFromFolder(NSArray * __autoreleasing * paaCertsResult) From 1988399d7132bc1fd880a05540b6c5b4fcce8ae5 Mon Sep 17 00:00:00 2001 From: yunhanw-google Date: Fri, 11 Oct 2024 13:41:02 -0700 Subject: [PATCH 105/127] enable stayActive test in java matter controller during commission flow (#36020) --- .../com/matter/controller/commands/pairing/PairingCommand.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairingCommand.kt b/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairingCommand.kt index a33a813f07..4351a937f7 100644 --- a/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairingCommand.kt +++ b/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairingCommand.kt @@ -183,7 +183,9 @@ abstract class PairingCommand( override fun onICDRegistrationInfoRequired() { logger.log(Level.INFO, "onICDRegistrationInfoRequired") currentCommissioner() - .updateCommissioningICDRegistrationInfo(ICDRegistrationInfo.newBuilder().build()) + .updateCommissioningICDRegistrationInfo( + ICDRegistrationInfo.newBuilder().setICDStayActiveDurationMsec(30000L).build() + ) } override fun onICDRegistrationComplete(errorCode: Long, icdDeviceInfo: ICDDeviceInfo) { From f94fbfd23125ceff32fa2f725bfdedfbab56c5a0 Mon Sep 17 00:00:00 2001 From: Justin Wood Date: Sat, 12 Oct 2024 10:52:56 -0700 Subject: [PATCH 106/127] Dead code, no longer needed, causes duplicate checkins (#36051) * Dead code, no longer needed * Restyled by clang-format --------- Co-authored-by: Restyled.io --- src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm b/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm index ca3100a1ad..7e88870aa7 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm @@ -83,11 +83,6 @@ - (void)_unregisterNodeID:(NSNumber *)nodeID [self _updateRegistrationInfo]; } -- (void)_checkinWithContext:(NSDictionary *)context -{ - [self _updateRegistrationInfo]; -} - - (void)removeDevice:(MTRDevice *)device { [super removeDevice:device]; @@ -253,8 +248,6 @@ - (BOOL)_setupXPCConnection MTR_LOG("%@ Activating new XPC connection", self); [self.xpcConnection activate]; - [self _checkinWithContext:[NSDictionary dictionary]]; - // FIXME: Trying to kick all the MTRDevices attached to this controller to re-establish connections // This state needs to be stored properly and re-established at connnection time From bf37d4e01ba6eddadbfd2c0ef5f2b23ce89710a7 Mon Sep 17 00:00:00 2001 From: yunhanw-google Date: Sat, 12 Oct 2024 14:10:54 -0700 Subject: [PATCH 107/127] [ICD] Improve ICDClientStorage (#36036) * Improve ICDClientStorage -- when DeleteAllEntries is triggered, and all fabric are removed, we need remove ICDFabricList from persistent storage, if there is at least 1 fabric in table, we would update fabricList vector and persistent storage. -- when fabric does not exist, storeEntry needs to return invalid fabric error, and deleteEntry or deleteAllEntries needs to return no error. -- Add multiple unit tests to cover DeleteAllEntries/StoreEntry/CheckInHandling for multiple fabrics * Update DefaultICDClientStorage.cpp Co-authored-by: mkardous-silabs <84793247+mkardous-silabs@users.noreply.github.com> * Update DefaultICDClientStorage.cpp Co-authored-by: mkardous-silabs <84793247+mkardous-silabs@users.noreply.github.com> * Update DefaultICDClientStorage.cpp Co-authored-by: mkardous-silabs <84793247+mkardous-silabs@users.noreply.github.com> * Update DefaultICDClientStorage.cpp Co-authored-by: mkardous-silabs <84793247+mkardous-silabs@users.noreply.github.com> * Update DefaultICDClientStorage.cpp Co-authored-by: mkardous-silabs <84793247+mkardous-silabs@users.noreply.github.com> * address comments * Restyled by whitespace * Restyled by clang-format * address comments * address comments and add more tests * Restyled by whitespace * Restyled by clang-format --------- Co-authored-by: mkardous-silabs <84793247+mkardous-silabs@users.noreply.github.com> Co-authored-by: Restyled.io --- src/app/icd/client/CheckInHandler.cpp | 5 + .../icd/client/DefaultICDClientStorage.cpp | 51 ++- src/app/icd/client/DefaultICDClientStorage.h | 9 + src/app/tests/BUILD.gn | 2 + src/app/tests/TestCheckInHandler.cpp | 300 ++++++++++++++++++ src/app/tests/TestDefaultICDClientStorage.cpp | 172 +++++++++- 6 files changed, 531 insertions(+), 8 deletions(-) create mode 100644 src/app/tests/TestCheckInHandler.cpp diff --git a/src/app/icd/client/CheckInHandler.cpp b/src/app/icd/client/CheckInHandler.cpp index e0edc649cc..f4eaa48b11 100644 --- a/src/app/icd/client/CheckInHandler.cpp +++ b/src/app/icd/client/CheckInHandler.cpp @@ -52,8 +52,12 @@ CHIP_ERROR CheckInHandler::Init(Messaging::ExchangeManager * exchangeManager, IC { VerifyOrReturnError(exchangeManager != nullptr, CHIP_ERROR_INVALID_ARGUMENT); VerifyOrReturnError(clientStorage != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(delegate != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(engine != nullptr, CHIP_ERROR_INVALID_ARGUMENT); VerifyOrReturnError(mpExchangeManager == nullptr, CHIP_ERROR_INCORRECT_STATE); VerifyOrReturnError(mpICDClientStorage == nullptr, CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(mpCheckInDelegate == nullptr, CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(mpImEngine == nullptr, CHIP_ERROR_INCORRECT_STATE); mpExchangeManager = exchangeManager; mpICDClientStorage = clientStorage; @@ -113,6 +117,7 @@ CHIP_ERROR CheckInHandler::OnMessageReceived(Messaging::ExchangeContext * ec, co if (refreshKey) { + ChipLogProgress(ICD, "Key Refresh is required"); RefreshKeySender * refreshKeySender = mpCheckInDelegate->OnKeyRefreshNeeded(clientInfo, mpICDClientStorage); if (refreshKeySender == nullptr) { diff --git a/src/app/icd/client/DefaultICDClientStorage.cpp b/src/app/icd/client/DefaultICDClientStorage.cpp index 2b6b3a1aff..0c6a0f7e13 100644 --- a/src/app/icd/client/DefaultICDClientStorage.cpp +++ b/src/app/icd/client/DefaultICDClientStorage.cpp @@ -51,6 +51,11 @@ CHIP_ERROR DefaultICDClientStorage::UpdateFabricList(FabricIndex fabricIndex) mFabricList.push_back(fabricIndex); + return StoreFabricList(); +} + +CHIP_ERROR DefaultICDClientStorage::StoreFabricList() +{ Platform::ScopedMemoryBuffer backingBuffer; size_t counter = mFabricList.size(); size_t total = kFabricIndexTlvSize * counter + kArrayOverHead; @@ -68,7 +73,7 @@ CHIP_ERROR DefaultICDClientStorage::UpdateFabricList(FabricIndex fabricIndex) const auto len = writer.GetLengthWritten(); VerifyOrReturnError(CanCastTo(len), CHIP_ERROR_BUFFER_TOO_SMALL); - writer.Finalize(backingBuffer); + ReturnErrorOnFailure(writer.Finalize(backingBuffer)); return mpClientInfoStore->SyncSetKeyValue(DefaultStorageKeyAllocator::ICDFabricList().KeyName(), backingBuffer.Get(), static_cast(len)); } @@ -211,6 +216,7 @@ CHIP_ERROR DefaultICDClientStorage::Load(FabricIndex fabricIndex, std::vector 0, CHIP_NO_ERROR); size_t len = clientInfoSize * count + kArrayOverHead; Platform::ScopedMemoryBuffer backingBuffer; VerifyOrReturnError(CanCastTo(len), CHIP_ERROR_BUFFER_TOO_SMALL); @@ -344,8 +350,21 @@ CHIP_ERROR DefaultICDClientStorage::SerializeToTlv(TLV::TLVWriter & writer, cons return writer.EndContainer(arrayType); } +bool DefaultICDClientStorage::FabricExists(FabricIndex fabricIndex) +{ + for (auto & fabric_idx : mFabricList) + { + if (fabric_idx == fabricIndex) + { + return true; + } + } + return false; +} + CHIP_ERROR DefaultICDClientStorage::StoreEntry(const ICDClientInfo & clientInfo) { + VerifyOrReturnError(FabricExists(clientInfo.peer_node.GetFabricIndex()), CHIP_ERROR_INVALID_FABRIC_INDEX); std::vector clientInfoVector; size_t clientInfoSize = MaxICDClientInfoSize(); ReturnErrorOnFailure(Load(clientInfo.peer_node.GetFabricIndex(), clientInfoVector, clientInfoSize)); @@ -359,7 +378,6 @@ CHIP_ERROR DefaultICDClientStorage::StoreEntry(const ICDClientInfo & clientInfo) break; } } - clientInfoVector.push_back(clientInfo); size_t total = clientInfoSize * clientInfoVector.size() + kArrayOverHead; Platform::ScopedMemoryBuffer backingBuffer; @@ -371,7 +389,7 @@ CHIP_ERROR DefaultICDClientStorage::StoreEntry(const ICDClientInfo & clientInfo) const auto len = writer.GetLengthWritten(); VerifyOrReturnError(CanCastTo(len), CHIP_ERROR_BUFFER_TOO_SMALL); - writer.Finalize(backingBuffer); + ReturnErrorOnFailure(writer.Finalize(backingBuffer)); ReturnErrorOnFailure(mpClientInfoStore->SyncSetKeyValue( DefaultStorageKeyAllocator::ICDClientInfoKey(clientInfo.peer_node.GetFabricIndex()).KeyName(), backingBuffer.Get(), static_cast(len))); @@ -416,7 +434,7 @@ CHIP_ERROR DefaultICDClientStorage::UpdateEntryCountForFabric(FabricIndex fabric const auto len = writer.GetLengthWritten(); VerifyOrReturnError(CanCastTo(len), CHIP_ERROR_BUFFER_TOO_SMALL); - writer.Finalize(backingBuffer); + ReturnErrorOnFailure(writer.Finalize(backingBuffer)); return mpClientInfoStore->SyncSetKeyValue(DefaultStorageKeyAllocator::FabricICDClientInfoCounter(fabricIndex).KeyName(), backingBuffer.Get(), static_cast(len)); @@ -424,9 +442,11 @@ CHIP_ERROR DefaultICDClientStorage::UpdateEntryCountForFabric(FabricIndex fabric CHIP_ERROR DefaultICDClientStorage::DeleteEntry(const ScopedNodeId & peerNode) { + VerifyOrReturnError(FabricExists(peerNode.GetFabricIndex()), CHIP_NO_ERROR); size_t clientInfoSize = 0; std::vector clientInfoVector; ReturnErrorOnFailure(Load(peerNode.GetFabricIndex(), clientInfoVector, clientInfoSize)); + VerifyOrReturnError(clientInfoVector.size() > 0, CHIP_NO_ERROR); for (auto it = clientInfoVector.begin(); it != clientInfoVector.end(); it++) { @@ -440,7 +460,6 @@ CHIP_ERROR DefaultICDClientStorage::DeleteEntry(const ScopedNodeId & peerNode) ReturnErrorOnFailure( mpClientInfoStore->SyncDeleteKeyValue(DefaultStorageKeyAllocator::ICDClientInfoKey(peerNode.GetFabricIndex()).KeyName())); - size_t total = clientInfoSize * clientInfoVector.size() + kArrayOverHead; Platform::ScopedMemoryBuffer backingBuffer; ReturnErrorCodeIf(!backingBuffer.Calloc(total), CHIP_ERROR_NO_MEMORY); @@ -451,7 +470,7 @@ CHIP_ERROR DefaultICDClientStorage::DeleteEntry(const ScopedNodeId & peerNode) const auto len = writer.GetLengthWritten(); VerifyOrReturnError(CanCastTo(len), CHIP_ERROR_BUFFER_TOO_SMALL); - writer.Finalize(backingBuffer); + ReturnErrorOnFailure(writer.Finalize(backingBuffer)); ReturnErrorOnFailure( mpClientInfoStore->SyncSetKeyValue(DefaultStorageKeyAllocator::ICDClientInfoKey(peerNode.GetFabricIndex()).KeyName(), backingBuffer.Get(), static_cast(len))); @@ -461,6 +480,8 @@ CHIP_ERROR DefaultICDClientStorage::DeleteEntry(const ScopedNodeId & peerNode) CHIP_ERROR DefaultICDClientStorage::DeleteAllEntries(FabricIndex fabricIndex) { + VerifyOrReturnError(FabricExists(fabricIndex), CHIP_NO_ERROR); + size_t clientInfoSize = 0; std::vector clientInfoVector; ReturnErrorOnFailure(Load(fabricIndex, clientInfoVector, clientInfoSize)); @@ -471,7 +492,23 @@ CHIP_ERROR DefaultICDClientStorage::DeleteAllEntries(FabricIndex fabricIndex) } ReturnErrorOnFailure( mpClientInfoStore->SyncDeleteKeyValue(DefaultStorageKeyAllocator::ICDClientInfoKey(fabricIndex).KeyName())); - return mpClientInfoStore->SyncDeleteKeyValue(DefaultStorageKeyAllocator::FabricICDClientInfoCounter(fabricIndex).KeyName()); + ReturnErrorOnFailure( + mpClientInfoStore->SyncDeleteKeyValue(DefaultStorageKeyAllocator::FabricICDClientInfoCounter(fabricIndex).KeyName())); + + for (auto fabric = mFabricList.begin(); fabric != mFabricList.end(); fabric++) + { + if (*fabric == fabricIndex) + { + mFabricList.erase(fabric); + break; + } + } + + if (mFabricList.size() == 0) + { + return mpClientInfoStore->SyncDeleteKeyValue(DefaultStorageKeyAllocator::ICDFabricList().KeyName()); + } + return StoreFabricList(); } CHIP_ERROR DefaultICDClientStorage::ProcessCheckInPayload(const ByteSpan & payload, ICDClientInfo & clientInfo, diff --git a/src/app/icd/client/DefaultICDClientStorage.h b/src/app/icd/client/DefaultICDClientStorage.h index 76faeb9afc..13064fe649 100644 --- a/src/app/icd/client/DefaultICDClientStorage.h +++ b/src/app/icd/client/DefaultICDClientStorage.h @@ -120,6 +120,12 @@ class DefaultICDClientStorage : public ICDClientStorage CHIP_ERROR ProcessCheckInPayload(const ByteSpan & payload, ICDClientInfo & clientInfo, Protocols::SecureChannel::CounterType & counter) override; +#if CONFIG_BUILD_FOR_HOST_UNIT_TEST + size_t GetFabricListSize() { return mFabricList.size(); } + + PersistentStorageDelegate * GetClientInfoStore() { return mpClientInfoStore; } +#endif // CONFIG_BUILD_FOR_HOST_UNIT_TEST + protected: enum class ClientInfoTag : uint8_t { @@ -173,9 +179,12 @@ class DefaultICDClientStorage : public ICDClientStorage private: friend class ICDClientInfoIteratorImpl; + CHIP_ERROR StoreFabricList(); CHIP_ERROR LoadFabricList(); CHIP_ERROR LoadCounter(FabricIndex fabricIndex, size_t & count, size_t & clientInfoSize); + bool FabricExists(FabricIndex fabricIndex); + CHIP_ERROR IncreaseEntryCountForFabric(FabricIndex fabricIndex); CHIP_ERROR DecreaseEntryCountForFabric(FabricIndex fabricIndex); CHIP_ERROR UpdateEntryCountForFabric(FabricIndex fabricIndex, bool increase); diff --git a/src/app/tests/BUILD.gn b/src/app/tests/BUILD.gn index e3ad975bce..9ebed234e5 100644 --- a/src/app/tests/BUILD.gn +++ b/src/app/tests/BUILD.gn @@ -206,6 +206,7 @@ chip_test_suite("tests") { "TestBasicCommandPathRegistry.cpp", "TestBindingTable.cpp", "TestBuilderParser.cpp", + "TestCheckInHandler.cpp", "TestCommandHandlerInterfaceRegistry.cpp", "TestCommandInteraction.cpp", "TestCommandPathParams.cpp", @@ -251,6 +252,7 @@ chip_test_suite("tests") { "${chip_root}/src/app/codegen-data-model-provider:instance-header", "${chip_root}/src/app/common:cluster-objects", "${chip_root}/src/app/data-model-provider/tests:encode-decode", + "${chip_root}/src/app/icd/client:handler", "${chip_root}/src/app/icd/client:manager", "${chip_root}/src/app/tests:helpers", "${chip_root}/src/app/util/mock:mock_codegen_data_model", diff --git a/src/app/tests/TestCheckInHandler.cpp b/src/app/tests/TestCheckInHandler.cpp new file mode 100644 index 0000000000..0d57eb6b42 --- /dev/null +++ b/src/app/tests/TestCheckInHandler.cpp @@ -0,0 +1,300 @@ +/* + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace chip; +using namespace app; +using namespace System; +using TestSessionKeystoreImpl = Crypto::DefaultSessionKeystore; + +constexpr uint8_t kKeyBuffer1[] = { + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f +}; + +constexpr uint8_t kKeyBuffer2[] = { + 0xf1, 0xe1, 0xd1, 0xc1, 0xb1, 0xa1, 0x91, 0x81, 0x71, 0x61, 0x51, 0x14, 0x31, 0x21, 0x11, 0x01 +}; + +class TestCheckInHandler : public chip::Test::AppContext +{ +}; + +class CheckInHandlerWrapper : public chip::app::CheckInHandler +{ +public: + CHIP_ERROR ValidateOnMessageReceived(Messaging::ExchangeContext * ec, const PayloadHeader & payloadHeader, + System::PacketBufferHandle && payload) + { + return OnMessageReceived(ec, payloadHeader, std::move(payload)); + } +}; + +TEST_F(TestCheckInHandler, TestOnMessageReceived) +{ + InteractionModelEngine * engine = InteractionModelEngine::GetInstance(); + EXPECT_EQ(engine->Init(&GetExchangeManager(), &GetFabricTable(), app::reporting::GetDefaultReportScheduler()), CHIP_NO_ERROR); + TestPersistentStorageDelegate clientInfoStorage; + TestSessionKeystoreImpl keystore; + + DefaultICDClientStorage manager; + EXPECT_EQ(manager.Init(&clientInfoStorage, &keystore), CHIP_NO_ERROR); + + DefaultCheckInDelegate checkInDelegate; + EXPECT_EQ(checkInDelegate.Init(&manager, engine), CHIP_NO_ERROR); + + CheckInHandlerWrapper checkInHandler; + EXPECT_EQ(checkInHandler.Init(&GetExchangeManager(), &manager, &checkInDelegate, engine), CHIP_NO_ERROR); + + FabricIndex fabricIdA = 1; + NodeId nodeIdA = 6666; + + ICDClientInfo clientInfoA; + clientInfoA.peer_node = ScopedNodeId(nodeIdA, fabricIdA); + clientInfoA.start_icd_counter = 0; + clientInfoA.offset = 0; + EXPECT_EQ(manager.UpdateFabricList(fabricIdA), CHIP_NO_ERROR); + EXPECT_EQ(manager.SetKey(clientInfoA, ByteSpan(kKeyBuffer1)), CHIP_NO_ERROR); + EXPECT_EQ(manager.StoreEntry(clientInfoA), CHIP_NO_ERROR); + + FabricIndex fabricIdB = 2; + NodeId nodeIdB = 6667; + + ICDClientInfo clientInfoB; + clientInfoB.peer_node = ScopedNodeId(nodeIdB, fabricIdB); + clientInfoB.offset = 0; + EXPECT_EQ(manager.UpdateFabricList(fabricIdB), CHIP_NO_ERROR); + EXPECT_EQ(manager.SetKey(clientInfoB, ByteSpan(kKeyBuffer2)), CHIP_NO_ERROR); + EXPECT_EQ(manager.StoreEntry(clientInfoB), CHIP_NO_ERROR); + + PayloadHeader payloadHeader; + payloadHeader.SetExchangeID(0); + payloadHeader.SetMessageType(chip::Protocols::SecureChannel::MsgType::ICD_CheckIn); + + uint32_t counter = 1; + System::PacketBufferHandle buffer1 = MessagePacketBuffer::New(chip::Protocols::SecureChannel::CheckinMessage::kMinPayloadSize); + MutableByteSpan output1{ buffer1->Start(), buffer1->MaxDataLength() }; + EXPECT_EQ(chip::Protocols::SecureChannel::CheckinMessage::GenerateCheckinMessagePayload( + clientInfoA.aes_key_handle, clientInfoA.hmac_key_handle, counter, ByteSpan(), output1), + CHIP_NO_ERROR); + + buffer1->SetDataLength(static_cast(output1.size())); + EXPECT_EQ(checkInHandler.ValidateOnMessageReceived(nullptr, payloadHeader, std::move(buffer1)), CHIP_NO_ERROR); + + ICDClientInfo clientInfo1; + auto * iterator = manager.IterateICDClientInfo(); + ASSERT_NE(iterator, nullptr); + while (iterator->Next(clientInfo1)) + { + if (clientInfo1.peer_node.GetNodeId() == nodeIdA && clientInfo1.peer_node.GetFabricIndex() == fabricIdA) + { + break; + } + } + iterator->Release(); + + EXPECT_EQ(clientInfo1.offset, counter - clientInfoA.start_icd_counter); + + // Validate duplicate check-in message handling + chip::System::PacketBufferHandle buffer2 = + MessagePacketBuffer::New(chip::Protocols::SecureChannel::CheckinMessage::kMinPayloadSize); + MutableByteSpan output2{ buffer2->Start(), buffer2->MaxDataLength() }; + EXPECT_EQ(chip::Protocols::SecureChannel::CheckinMessage::GenerateCheckinMessagePayload( + clientInfoA.aes_key_handle, clientInfoA.hmac_key_handle, counter, ByteSpan(), output2), + CHIP_NO_ERROR); + + buffer2->SetDataLength(static_cast(output2.size())); + EXPECT_EQ(checkInHandler.ValidateOnMessageReceived(nullptr, payloadHeader, std::move(buffer2)), CHIP_NO_ERROR); + + ICDClientInfo clientInfo2; + iterator = manager.IterateICDClientInfo(); + ASSERT_NE(iterator, nullptr); + while (iterator->Next(clientInfo2)) + { + if (clientInfo2.peer_node.GetNodeId() == nodeIdA && clientInfo2.peer_node.GetFabricIndex() == fabricIdA) + { + break; + } + } + iterator->Release(); + EXPECT_EQ(clientInfo2.offset, counter - clientInfoA.start_icd_counter); + + // Validate second check-in message with increased counter + counter++; + System::PacketBufferHandle buffer3 = MessagePacketBuffer::New(chip::Protocols::SecureChannel::CheckinMessage::kMinPayloadSize); + MutableByteSpan output3{ buffer3->Start(), buffer3->MaxDataLength() }; + EXPECT_EQ(chip::Protocols::SecureChannel::CheckinMessage::GenerateCheckinMessagePayload( + clientInfoA.aes_key_handle, clientInfoA.hmac_key_handle, counter, ByteSpan(), output3), + CHIP_NO_ERROR); + buffer3->SetDataLength(static_cast(output3.size())); + EXPECT_EQ(checkInHandler.ValidateOnMessageReceived(nullptr, payloadHeader, std::move(buffer3)), CHIP_NO_ERROR); + ICDClientInfo clientInfo3; + iterator = manager.IterateICDClientInfo(); + ASSERT_NE(iterator, nullptr); + while (iterator->Next(clientInfo3)) + { + if (clientInfo3.peer_node.GetNodeId() == nodeIdA && clientInfo3.peer_node.GetFabricIndex() == fabricIdA) + { + break; + } + } + iterator->Release(); + EXPECT_EQ(clientInfo3.offset, counter - clientInfoA.start_icd_counter); + + // Validate check-in message from fabricB + counter++; + System::PacketBufferHandle buffer4 = MessagePacketBuffer::New(chip::Protocols::SecureChannel::CheckinMessage::kMinPayloadSize); + MutableByteSpan output4{ buffer4->Start(), buffer4->MaxDataLength() }; + EXPECT_EQ(chip::Protocols::SecureChannel::CheckinMessage::GenerateCheckinMessagePayload( + clientInfoB.aes_key_handle, clientInfoB.hmac_key_handle, counter, ByteSpan(), output4), + CHIP_NO_ERROR); + buffer4->SetDataLength(static_cast(output4.size())); + EXPECT_EQ(checkInHandler.ValidateOnMessageReceived(nullptr, payloadHeader, std::move(buffer4)), CHIP_NO_ERROR); + ICDClientInfo clientInfo4; + iterator = manager.IterateICDClientInfo(); + ASSERT_NE(iterator, nullptr); + while (iterator->Next(clientInfo4)) + { + if (clientInfo4.peer_node.GetNodeId() == nodeIdB && clientInfo4.peer_node.GetFabricIndex() == fabricIdB) + { + break; + } + } + iterator->Release(); + EXPECT_EQ(clientInfo4.offset, counter - clientInfoB.start_icd_counter); + + // Validate check-in message from removed fabricB + counter++; + System::PacketBufferHandle buffer5 = MessagePacketBuffer::New(chip::Protocols::SecureChannel::CheckinMessage::kMinPayloadSize); + MutableByteSpan output5{ buffer5->Start(), buffer5->MaxDataLength() }; + EXPECT_EQ(chip::Protocols::SecureChannel::CheckinMessage::GenerateCheckinMessagePayload( + clientInfoB.aes_key_handle, clientInfoB.hmac_key_handle, counter, ByteSpan(), output5), + CHIP_NO_ERROR); + + EXPECT_EQ(manager.DeleteAllEntries(fabricIdB), CHIP_NO_ERROR); + buffer5->SetDataLength(static_cast(output5.size())); + EXPECT_EQ(checkInHandler.ValidateOnMessageReceived(nullptr, payloadHeader, std::move(buffer5)), CHIP_NO_ERROR); + ICDClientInfo clientInfo5; + iterator = manager.IterateICDClientInfo(); + ASSERT_NE(iterator, nullptr); + bool located = false; + while (iterator->Next(clientInfo5)) + { + if (clientInfo5.peer_node.GetFabricIndex() == fabricIdB) + { + located = true; + break; + } + } + iterator->Release(); + EXPECT_FALSE(located); + + // Add back fabricB and validate check-in message again + EXPECT_EQ(manager.UpdateFabricList(fabricIdB), CHIP_NO_ERROR); + EXPECT_EQ(manager.SetKey(clientInfoB, ByteSpan(kKeyBuffer2)), CHIP_NO_ERROR); + EXPECT_EQ(manager.StoreEntry(clientInfoB), CHIP_NO_ERROR); + counter++; + System::PacketBufferHandle buffer6 = MessagePacketBuffer::New(chip::Protocols::SecureChannel::CheckinMessage::kMinPayloadSize); + MutableByteSpan output6{ buffer6->Start(), buffer6->MaxDataLength() }; + EXPECT_EQ(chip::Protocols::SecureChannel::CheckinMessage::GenerateCheckinMessagePayload( + clientInfoB.aes_key_handle, clientInfoB.hmac_key_handle, counter, ByteSpan(), output6), + CHIP_NO_ERROR); + buffer6->SetDataLength(static_cast(output4.size())); + EXPECT_EQ(checkInHandler.ValidateOnMessageReceived(nullptr, payloadHeader, std::move(buffer6)), CHIP_NO_ERROR); + ICDClientInfo clientInfo6; + iterator = manager.IterateICDClientInfo(); + ASSERT_NE(iterator, nullptr); + while (iterator->Next(clientInfo6)) + { + if (clientInfo6.peer_node.GetNodeId() == nodeIdB && clientInfo6.peer_node.GetFabricIndex() == fabricIdB) + { + break; + } + } + iterator->Release(); + EXPECT_EQ(clientInfo6.offset, counter - clientInfoB.start_icd_counter); + + // Clear fabric table + EXPECT_EQ(manager.DeleteAllEntries(fabricIdA), CHIP_NO_ERROR); + EXPECT_EQ(manager.DeleteAllEntries(fabricIdB), CHIP_NO_ERROR); + // Add back fabricA and validate check-in message again + EXPECT_EQ(manager.UpdateFabricList(fabricIdA), CHIP_NO_ERROR); + EXPECT_EQ(manager.SetKey(clientInfoA, ByteSpan(kKeyBuffer1)), CHIP_NO_ERROR); + EXPECT_EQ(manager.StoreEntry(clientInfoA), CHIP_NO_ERROR); + counter++; + System::PacketBufferHandle buffer7 = MessagePacketBuffer::New(chip::Protocols::SecureChannel::CheckinMessage::kMinPayloadSize); + MutableByteSpan output7{ buffer7->Start(), buffer7->MaxDataLength() }; + EXPECT_EQ(chip::Protocols::SecureChannel::CheckinMessage::GenerateCheckinMessagePayload( + clientInfoA.aes_key_handle, clientInfoA.hmac_key_handle, counter, ByteSpan(), output7), + CHIP_NO_ERROR); + buffer7->SetDataLength(static_cast(output7.size())); + EXPECT_EQ(checkInHandler.ValidateOnMessageReceived(nullptr, payloadHeader, std::move(buffer7)), CHIP_NO_ERROR); + ICDClientInfo clientInfo7; + iterator = manager.IterateICDClientInfo(); + ASSERT_NE(iterator, nullptr); + while (iterator->Next(clientInfo7)) + { + if (clientInfo7.peer_node.GetNodeId() == nodeIdA && clientInfo7.peer_node.GetFabricIndex() == fabricIdA) + { + break; + } + } + iterator->Release(); + EXPECT_EQ(clientInfo7.offset, counter - clientInfoA.start_icd_counter); + + // Validate IcdclientInfo is not updated when handling overlimited counter and fail to create case session + uint32_t old_start_icd_counter = clientInfo7.start_icd_counter; + uint32_t old_counter = counter; + counter = (1U << 31) + 100U + clientInfo7.start_icd_counter; + System::PacketBufferHandle buffer8 = MessagePacketBuffer::New(chip::Protocols::SecureChannel::CheckinMessage::kMinPayloadSize); + MutableByteSpan output8{ buffer8->Start(), buffer8->MaxDataLength() }; + EXPECT_EQ(chip::Protocols::SecureChannel::CheckinMessage::GenerateCheckinMessagePayload( + clientInfoA.aes_key_handle, clientInfoA.hmac_key_handle, counter, ByteSpan(), output8), + CHIP_NO_ERROR); + + buffer8->SetDataLength(static_cast(output8.size())); + EXPECT_EQ(checkInHandler.ValidateOnMessageReceived(nullptr, payloadHeader, std::move(buffer8)), CHIP_NO_ERROR); + ICDClientInfo clientInfo8; + iterator = manager.IterateICDClientInfo(); + ASSERT_NE(iterator, nullptr); + while (iterator->Next(clientInfo8)) + { + if (clientInfo8.peer_node.GetNodeId() == nodeIdA && clientInfo8.peer_node.GetFabricIndex() == fabricIdA) + { + break; + } + } + iterator->Release(); + EXPECT_EQ(clientInfo8.offset, old_counter - clientInfoA.start_icd_counter); + EXPECT_EQ(clientInfo8.start_icd_counter, old_start_icd_counter); + + checkInHandler.Shutdown(); +} diff --git a/src/app/tests/TestDefaultICDClientStorage.cpp b/src/app/tests/TestDefaultICDClientStorage.cpp index ac950fdbc7..0ea48d3326 100644 --- a/src/app/tests/TestDefaultICDClientStorage.cpp +++ b/src/app/tests/TestDefaultICDClientStorage.cpp @@ -103,6 +103,12 @@ TEST_F(TestDefaultICDClientStorage, TestClientInfoCount) iterator->Release(); + EXPECT_TRUE(manager.GetClientInfoStore()->SyncDoesKeyExist(DefaultStorageKeyAllocator::ICDFabricList().KeyName())); + EXPECT_TRUE(manager.GetClientInfoStore()->SyncDoesKeyExist( + DefaultStorageKeyAllocator::FabricICDClientInfoCounter(fabricId).KeyName())); + EXPECT_TRUE( + manager.GetClientInfoStore()->SyncDoesKeyExist(DefaultStorageKeyAllocator::ICDClientInfoKey(fabricId).KeyName())); + // Delete all and verify iterator counts 0 EXPECT_EQ(manager.DeleteAllEntries(fabricId), CHIP_NO_ERROR); iterator = manager.IterateICDClientInfo(); @@ -116,6 +122,14 @@ TEST_F(TestDefaultICDClientStorage, TestClientInfoCount) } iterator->Release(); EXPECT_EQ(count, 0u); + EXPECT_EQ(manager.GetFabricListSize(), 0u); + EXPECT_FALSE(manager.GetClientInfoStore()->SyncDoesKeyExist(DefaultStorageKeyAllocator::ICDFabricList().KeyName())); + EXPECT_FALSE(manager.GetClientInfoStore()->SyncDoesKeyExist( + DefaultStorageKeyAllocator::FabricICDClientInfoCounter(fabricId).KeyName())); + EXPECT_FALSE( + manager.GetClientInfoStore()->SyncDoesKeyExist(DefaultStorageKeyAllocator::ICDClientInfoKey(fabricId).KeyName())); + + EXPECT_EQ(manager.DeleteAllEntries(fabricId), CHIP_NO_ERROR); } { @@ -174,6 +188,15 @@ TEST_F(TestDefaultICDClientStorage, TestClientInfoCountMultipleFabric) EXPECT_EQ(manager.DeleteEntry(ScopedNodeId(nodeId3, fabricId2)), CHIP_NO_ERROR); EXPECT_EQ(iterator->Count(), 0u); + EXPECT_EQ(manager.GetFabricListSize(), 2u); + EXPECT_TRUE(manager.GetClientInfoStore()->SyncDoesKeyExist(DefaultStorageKeyAllocator::ICDFabricList().KeyName())); + EXPECT_TRUE(manager.GetClientInfoStore()->SyncDoesKeyExist( + DefaultStorageKeyAllocator::FabricICDClientInfoCounter(fabricId1).KeyName())); + EXPECT_TRUE(manager.GetClientInfoStore()->SyncDoesKeyExist(DefaultStorageKeyAllocator::ICDClientInfoKey(fabricId1).KeyName())); + EXPECT_TRUE(manager.GetClientInfoStore()->SyncDoesKeyExist( + DefaultStorageKeyAllocator::FabricICDClientInfoCounter(fabricId2).KeyName())); + EXPECT_TRUE(manager.GetClientInfoStore()->SyncDoesKeyExist(DefaultStorageKeyAllocator::ICDClientInfoKey(fabricId2).KeyName())); + // Verify ClientInfos manually count correctly size_t count = 0; ICDClientInfo clientInfo; @@ -183,6 +206,59 @@ TEST_F(TestDefaultICDClientStorage, TestClientInfoCountMultipleFabric) } EXPECT_FALSE(count); + + EXPECT_EQ(manager.DeleteEntry(ScopedNodeId(nodeId3, fabricId2)), CHIP_NO_ERROR); +} + +TEST_F(TestDefaultICDClientStorage, TestClientInfoCountMultipleFabricWithRemovingFabric) +{ + + FabricIndex fabricId1 = 1; + FabricIndex fabricId2 = 2; + NodeId nodeId1 = 6666; + NodeId nodeId2 = 6667; + NodeId nodeId3 = 6668; + DefaultICDClientStorage manager; + TestPersistentStorageDelegate clientInfoStorage; + TestSessionKeystoreImpl keystore; + EXPECT_EQ(manager.Init(&clientInfoStorage, &keystore), CHIP_NO_ERROR); + EXPECT_EQ(manager.UpdateFabricList(fabricId1), CHIP_NO_ERROR); + EXPECT_EQ(manager.UpdateFabricList(fabricId2), CHIP_NO_ERROR); + + // Write some ClientInfos and see the counts are correct + ICDClientInfo clientInfo1; + clientInfo1.peer_node = ScopedNodeId(nodeId1, fabricId1); + ICDClientInfo clientInfo2; + clientInfo2.peer_node = ScopedNodeId(nodeId2, fabricId1); + ICDClientInfo clientInfo3; + clientInfo3.peer_node = ScopedNodeId(nodeId3, fabricId2); + + EXPECT_EQ(manager.SetKey(clientInfo1, ByteSpan(kKeyBuffer1)), CHIP_NO_ERROR); + EXPECT_EQ(manager.StoreEntry(clientInfo1), CHIP_NO_ERROR); + + EXPECT_EQ(manager.SetKey(clientInfo2, ByteSpan(kKeyBuffer2)), CHIP_NO_ERROR); + EXPECT_EQ(manager.StoreEntry(clientInfo2), CHIP_NO_ERROR); + + EXPECT_EQ(manager.SetKey(clientInfo3, ByteSpan(kKeyBuffer3)), CHIP_NO_ERROR); + EXPECT_EQ(manager.StoreEntry(clientInfo3), CHIP_NO_ERROR); + // Make sure iterator counts correctly + auto * iterator = manager.IterateICDClientInfo(); + EXPECT_EQ(iterator->Count(), 3u); + iterator->Release(); + + EXPECT_EQ(manager.DeleteAllEntries(fabricId1), CHIP_NO_ERROR); + + iterator = manager.IterateICDClientInfo(); + ASSERT_NE(iterator, nullptr); + DefaultICDClientStorage::ICDClientInfoIteratorWrapper clientInfoIteratorWrapper(iterator); + EXPECT_EQ(iterator->Count(), 1u); + + EXPECT_EQ(manager.DeleteAllEntries(fabricId2), CHIP_NO_ERROR); + EXPECT_EQ(iterator->Count(), 0u); + + EXPECT_EQ(manager.StoreEntry(clientInfo1), CHIP_ERROR_INVALID_FABRIC_INDEX); + EXPECT_EQ(manager.StoreEntry(clientInfo2), CHIP_ERROR_INVALID_FABRIC_INDEX); + EXPECT_EQ(manager.StoreEntry(clientInfo3), CHIP_ERROR_INVALID_FABRIC_INDEX); } TEST_F(TestDefaultICDClientStorage, TestProcessCheckInPayload) @@ -214,9 +290,103 @@ TEST_F(TestDefaultICDClientStorage, TestProcessCheckInPayload) uint32_t checkInCounter = 0; ByteSpan payload{ buffer->Start(), buffer->DataLength() }; EXPECT_EQ(manager.ProcessCheckInPayload(payload, decodeClientInfo, checkInCounter), CHIP_NO_ERROR); + EXPECT_EQ(checkInCounter, counter); + + // Validate second check-in message with increased counter + counter++; + EXPECT_EQ(chip::Protocols::SecureChannel::CheckinMessage::GenerateCheckinMessagePayload( + clientInfo.aes_key_handle, clientInfo.hmac_key_handle, counter, ByteSpan(), output), + CHIP_NO_ERROR); + buffer->SetDataLength(static_cast(output.size())); + ByteSpan payload1{ buffer->Start(), buffer->DataLength() }; + EXPECT_EQ(manager.ProcessCheckInPayload(payload1, decodeClientInfo, checkInCounter), CHIP_NO_ERROR); + EXPECT_EQ(checkInCounter, counter); - // 2. Use a key not available in the storage for encoding + // Use a key not available in the storage for encoding EXPECT_EQ(manager.SetKey(clientInfo, ByteSpan(kKeyBuffer2)), CHIP_NO_ERROR); + EXPECT_EQ(chip::Protocols::SecureChannel::CheckinMessage::GenerateCheckinMessagePayload( + clientInfo.aes_key_handle, clientInfo.hmac_key_handle, counter, ByteSpan(), output), + CHIP_NO_ERROR); + + buffer->SetDataLength(static_cast(output.size())); + ByteSpan payload2{ buffer->Start(), buffer->DataLength() }; + EXPECT_EQ(manager.ProcessCheckInPayload(payload2, decodeClientInfo, checkInCounter), CHIP_ERROR_NOT_FOUND); +} + +TEST_F(TestDefaultICDClientStorage, TestProcessCheckInPayloadWithRemovedKey) +{ + FabricIndex fabricId = 1; + NodeId nodeId = 6666; + TestPersistentStorageDelegate clientInfoStorage; + TestSessionKeystoreImpl keystore; + + DefaultICDClientStorage manager; + EXPECT_EQ(manager.Init(&clientInfoStorage, &keystore), CHIP_NO_ERROR); + EXPECT_EQ(manager.UpdateFabricList(fabricId), CHIP_NO_ERROR); + // Populate clientInfo + ICDClientInfo clientInfo; + clientInfo.peer_node = ScopedNodeId(nodeId, fabricId); + + EXPECT_EQ(manager.SetKey(clientInfo, ByteSpan(kKeyBuffer1)), CHIP_NO_ERROR); + EXPECT_EQ(manager.StoreEntry(clientInfo), CHIP_NO_ERROR); + + uint32_t counter = 1; + System::PacketBufferHandle buffer = MessagePacketBuffer::New(chip::Protocols::SecureChannel::CheckinMessage::kMinPayloadSize); + MutableByteSpan output{ buffer->Start(), buffer->MaxDataLength() }; + EXPECT_EQ(chip::Protocols::SecureChannel::CheckinMessage::GenerateCheckinMessagePayload( + clientInfo.aes_key_handle, clientInfo.hmac_key_handle, counter, ByteSpan(), output), + CHIP_NO_ERROR); + + buffer->SetDataLength(static_cast(output.size())); + ICDClientInfo decodeClientInfo; + uint32_t checkInCounter = 0; + ByteSpan payload{ buffer->Start(), buffer->DataLength() }; + EXPECT_EQ(manager.ProcessCheckInPayload(payload, decodeClientInfo, checkInCounter), CHIP_NO_ERROR); + EXPECT_EQ(checkInCounter, counter); + + // Use a removed key in the storage for encoding + manager.RemoveKey(clientInfo), CHIP_NO_ERROR; + EXPECT_EQ(chip::Protocols::SecureChannel::CheckinMessage::GenerateCheckinMessagePayload( + clientInfo.aes_key_handle, clientInfo.hmac_key_handle, counter, ByteSpan(), output), + CHIP_NO_ERROR); + + buffer->SetDataLength(static_cast(output.size())); + ByteSpan payload1{ buffer->Start(), buffer->DataLength() }; + EXPECT_EQ(manager.ProcessCheckInPayload(payload1, decodeClientInfo, checkInCounter), CHIP_ERROR_NOT_FOUND); +} + +TEST_F(TestDefaultICDClientStorage, TestProcessCheckInPayloadWithEmptyIcdStorage) +{ + FabricIndex fabricId = 1; + NodeId nodeId = 6666; + TestPersistentStorageDelegate clientInfoStorage; + TestSessionKeystoreImpl keystore; + + DefaultICDClientStorage manager; + EXPECT_EQ(manager.Init(&clientInfoStorage, &keystore), CHIP_NO_ERROR); + EXPECT_EQ(manager.UpdateFabricList(fabricId), CHIP_NO_ERROR); + // Populate clientInfo + ICDClientInfo clientInfo; + clientInfo.peer_node = ScopedNodeId(nodeId, fabricId); + + EXPECT_EQ(manager.SetKey(clientInfo, ByteSpan(kKeyBuffer1)), CHIP_NO_ERROR); + EXPECT_EQ(manager.StoreEntry(clientInfo), CHIP_NO_ERROR); + + uint32_t counter = 1; + System::PacketBufferHandle buffer = MessagePacketBuffer::New(chip::Protocols::SecureChannel::CheckinMessage::kMinPayloadSize); + MutableByteSpan output{ buffer->Start(), buffer->MaxDataLength() }; + EXPECT_EQ(chip::Protocols::SecureChannel::CheckinMessage::GenerateCheckinMessagePayload( + clientInfo.aes_key_handle, clientInfo.hmac_key_handle, counter, ByteSpan(), output), + CHIP_NO_ERROR); + + buffer->SetDataLength(static_cast(output.size())); + ICDClientInfo decodeClientInfo; + uint32_t checkInCounter = 0; + ByteSpan payload{ buffer->Start(), buffer->DataLength() }; + EXPECT_EQ(manager.ProcessCheckInPayload(payload, decodeClientInfo, checkInCounter), CHIP_NO_ERROR); + EXPECT_EQ(checkInCounter, counter); + manager.DeleteAllEntries(fabricId); + EXPECT_EQ(chip::Protocols::SecureChannel::CheckinMessage::GenerateCheckinMessagePayload( clientInfo.aes_key_handle, clientInfo.hmac_key_handle, counter, ByteSpan(), output), CHIP_NO_ERROR); From 4df081c1cc157b35cf131afb40bb0228eb8aff4f Mon Sep 17 00:00:00 2001 From: Pradip De Date: Sun, 13 Oct 2024 15:40:57 -0700 Subject: [PATCH 108/127] Definition of the Camera AV StreamManagement Cluster. (#35841) * Definition of the Camera AV StreamManagement Cluster. Define StreamTypeEnum in global-enums.xml, moving from WebRTC Provider cluster and AV Stream Management. Spec in `cameras` branch. Draft PR: https://github.com/CHIP-Specifications/connectedhomeip-spec/pull/10004 * Keep the jclass and its corresponding constructor jmethod inside a scope block. This is to prevent duplicate declaration error when multiple variables of the same struct type are present. * Auto-generated files from zap-regen for Camera AV Stream Management. --- .github/workflows/tests.yaml | 1 + docs/zap_clusters.md | 1 + scripts/rules.matterlint | 1 + .../camera-av-stream-management-cluster.xml | 478 + .../zcl/data-model/chip/global-enums.xml | 13 +- .../chip/webrtc-provider-cluster.xml | 9 - .../zcl/zcl-with-test-extensions.json | 11 +- src/app/zap-templates/zcl/zcl.json | 11 +- src/app/zap_cluster_list.json | 2 + .../data_model/controller-clusters.matter | 340 + .../chip/devicecontroller/ChipClusters.java | 2127 ++++ .../devicecontroller/ChipEventStructs.java | 468 + .../chip/devicecontroller/ChipStructs.java | 1044 ++ .../devicecontroller/ClusterIDMapping.java | 387 + .../devicecontroller/ClusterInfoMapping.java | 809 ++ .../devicecontroller/ClusterReadMapping.java | 522 + .../devicecontroller/ClusterWriteMapping.java | 486 + ...anagementClusterAudioStreamChangedEvent.kt | 144 + ...gementClusterSnapshotStreamChangedEvent.kt | 158 + ...anagementClusterVideoStreamChangedEvent.kt | 214 + .../chip/devicecontroller/cluster/files.gni | 12 + ...anagementClusterAudioCapabilitiesStruct.kt | 111 + ...treamManagementClusterAudioStreamStruct.kt | 101 + ...usterRateDistortionTradeOffPointsStruct.kt | 75 + ...amManagementClusterSnapshotParamsStruct.kt | 75 + ...amManagementClusterSnapshotStreamStruct.kt | 109 + ...mManagementClusterVideoResolutionStruct.kt | 59 + ...anagementClusterVideoSensorParamsStruct.kt | 83 + ...treamManagementClusterVideoStreamStruct.kt | 162 + ...AvStreamManagementClusterViewportStruct.kt | 69 + .../CameraAvStreamManagementCluster.kt | 6746 ++++++++++++ ...anagementClusterAudioStreamChangedEvent.kt | 144 + ...gementClusterSnapshotStreamChangedEvent.kt | 156 + ...anagementClusterVideoStreamChangedEvent.kt | 212 + .../java/matter/controller/cluster/files.gni | 13 + ...anagementClusterAudioCapabilitiesStruct.kt | 111 + ...treamManagementClusterAudioStreamStruct.kt | 101 + ...usterRateDistortionTradeOffPointsStruct.kt | 75 + ...amManagementClusterSnapshotParamsStruct.kt | 75 + ...amManagementClusterSnapshotStreamStruct.kt | 109 + ...mManagementClusterVideoResolutionStruct.kt | 59 + ...anagementClusterVideoSensorParamsStruct.kt | 83 + ...treamManagementClusterVideoStreamStruct.kt | 162 + ...AvStreamManagementClusterViewportStruct.kt | 69 + .../java/templates/partials/decode_value.zapt | 42 +- .../CHIPAttributeTLVValueDecoder.cpp | 9359 +++++++++++------ .../CHIPEventTLVValueDecoder.cpp | 1733 ++- .../python/chip/clusters/CHIPClusters.py | 467 + .../python/chip/clusters/Objects.py | 1653 +++ .../MTRAttributeSpecifiedCheck.mm | 171 + .../MTRAttributeTLVValueDecoder.mm | 822 ++ .../CHIP/zap-generated/MTRBaseClusters.h | 515 + .../CHIP/zap-generated/MTRBaseClusters.mm | 2890 +++++ .../CHIP/zap-generated/MTRClusterConstants.h | 80 + .../CHIP/zap-generated/MTRClusterNames.mm | 337 + .../CHIP/zap-generated/MTRClusters.h | 190 + .../CHIP/zap-generated/MTRClusters.mm | 873 ++ .../zap-generated/MTRCommandPayloadsObjc.h | 520 + .../zap-generated/MTRCommandPayloadsObjc.mm | 1552 +++ .../MTRCommandPayloads_Internal.h | 102 + .../zap-generated/MTRCommandTimedCheck.mm | 12 + .../zap-generated/MTREventTLVValueDecoder.mm | 272 + .../CHIP/zap-generated/MTRStructsObjc.h | 124 + .../CHIP/zap-generated/MTRStructsObjc.mm | 516 + .../zap-generated/attributes/Accessors.cpp | 1662 +++ .../zap-generated/attributes/Accessors.h | 229 + .../app-common/zap-generated/callback.h | 121 + .../zap-generated/cluster-enums-check.h | 64 + .../app-common/zap-generated/cluster-enums.h | 82 + .../zap-generated/cluster-objects.cpp | 2387 ++++- .../zap-generated/cluster-objects.h | 1861 ++++ .../app-common/zap-generated/ids/Attributes.h | 218 + .../app-common/zap-generated/ids/Clusters.h | 3 + .../app-common/zap-generated/ids/Commands.h | 74 + .../app-common/zap-generated/ids/Events.h | 18 + .../zap-generated/cluster/Commands.h | 917 ++ .../cluster/ComplexArgumentParser.cpp | 524 + .../cluster/ComplexArgumentParser.h | 53 + .../cluster/logging/DataModelLogger.cpp | 1468 ++- .../cluster/logging/DataModelLogger.h | 52 + .../cluster/logging/EntryToText.cpp | 163 + .../zap-generated/cluster/Commands.h | 6753 ++++++++++++ 82 files changed, 50448 insertions(+), 4628 deletions(-) create mode 100644 src/app/zap-templates/zcl/data-model/chip/camera-av-stream-management-cluster.xml create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/CameraAvStreamManagementClusterAudioStreamChangedEvent.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/CameraAvStreamManagementClusterSnapshotStreamChangedEvent.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/CameraAvStreamManagementClusterVideoStreamChangedEvent.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterAudioCapabilitiesStruct.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterAudioStreamStruct.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterSnapshotParamsStruct.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterSnapshotStreamStruct.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterVideoResolutionStruct.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterVideoSensorParamsStruct.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterVideoStreamStruct.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterViewportStruct.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/clusters/CameraAvStreamManagementCluster.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/eventstructs/CameraAvStreamManagementClusterAudioStreamChangedEvent.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/eventstructs/CameraAvStreamManagementClusterSnapshotStreamChangedEvent.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/eventstructs/CameraAvStreamManagementClusterVideoStreamChangedEvent.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterAudioCapabilitiesStruct.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterAudioStreamStruct.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterSnapshotParamsStruct.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterSnapshotStreamStruct.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterVideoResolutionStruct.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterVideoSensorParamsStruct.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterVideoStreamStruct.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterViewportStruct.kt diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index a84e8639f7..63957b64d8 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -111,6 +111,7 @@ jobs: src/app/zap-templates/zcl/data-model/chip/boolean-state-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/actions-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/bridged-device-basic-information.xml \ + src/app/zap-templates/zcl/data-model/chip/camera-av-stream-management-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/chip-ota.xml \ src/app/zap-templates/zcl/data-model/chip/chip-types.xml \ src/app/zap-templates/zcl/data-model/chip/channel-cluster.xml \ diff --git a/docs/zap_clusters.md b/docs/zap_clusters.md index 84ca34a74d..b37e8b2b8b 100644 --- a/docs/zap_clusters.md +++ b/docs/zap_clusters.md @@ -130,6 +130,7 @@ Generally regenerate using one of: | 1295 | 0x50F | ContentControl | | 1296 | 0x510 | ContentAppObserver | | 1360 | 0x550 | ZoneManagement | +| 1361 | 0x551 | CameraAvStreamManagement | | 1363 | 0x553 | WebRTCTransportProvider | | 1364 | 0x554 | WebRTCTransportRequestor | | 1366 | 0x556 | Chime | diff --git a/scripts/rules.matterlint b/scripts/rules.matterlint index 69715eea87..4f61d26be7 100644 --- a/scripts/rules.matterlint +++ b/scripts/rules.matterlint @@ -14,6 +14,7 @@ load "../src/app/zap-templates/zcl/data-model/chip/binding-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/boolean-state-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/actions-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/bridged-device-basic-information.xml"; +load "../src/app/zap-templates/zcl/data-model/chip/camera-av-stream-management-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/channel-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/chime-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/chip-ota.xml"; diff --git a/src/app/zap-templates/zcl/data-model/chip/camera-av-stream-management-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/camera-av-stream-management-cluster.xml new file mode 100644 index 0000000000..c64342b551 --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/chip/camera-av-stream-management-cluster.xml @@ -0,0 +1,478 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Camera AV Stream Management + 0x0551 + CAMERA_AV_STREAM_MANAGEMENT_CLUSTER + The Camera AV Stream Management cluster is used to allow clients to manage, control, and configure various audio, video, and snapshot streams on a camera. + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + MaxConcurrentVideoEncoders + MaxEncodedPixelRate + VideoSensorParams + NightVisionCapable + MinViewport + RateDistortionTradeOffPoints + MaxPreRollBufferSize + MicrophoneCapabilities + SpeakerCapabilities + TwoWayTalkSupport + SupportedSnapshotParams + MaxNetworkBandwidth + CurrentFrameRate + + HDRModeEnabled + + + + CurrentVideoCodecs + CurrentSnapshotConfig + FabricsUsingCamera + AllocatedVideoStreams + AllocatedAudioStreams + AllocatedSnapshotStreams + + RankedVideoStreamPrioritiesList + + + + SoftRecordingPrivacyModeEnabled + SoftLivestreamPrivacyModeEnabled + HardPrivacyModeOn + + NightVision + + + + + NightVisionIllum + + + + + AWBEnabled + + + + + AutoShutterSpeedEnabled + + + + + AutoISOEnabled + + + + Viewport + + SpeakerMuted + + + + + SpeakerVolumeLevel + + + + + SpeakerMaxLevel + + + + + SpeakerMinLevel + + + + + MicrophoneMuted + + + + + MicrophoneVolumeLevel + + + + + MicrophoneMaxLevel + + + + + MicrophoneMinLevel + + + + + MicrophoneAGCEnabled + + + + ImageRotation + ImageFlipHorizontal + ImageFlipVertical + + LocalVideoRecordingEnabled + + + + + LocalSnapshotRecordingEnabled + + + + + StatusLightEnabled + + + + + StatusLightBrightness + + + + + DepthSensorStatus + + + + + This command SHALL allocate an audio stream on the camera and return an allocated audio stream identifier. + + + + + + + + + + + This command SHALL be sent by the camera in response to the AudioStreamAllocate command, carrying the newly allocated audio stream identifier. + + + + + This command SHALL deallocate an audio stream on the camera, corresponding to the given audio stream identifier. + + + + + + This command SHALL allocate a video stream on the camera and return an allocated video stream identifier. + + + + + + + + + + + + + + + + + This command SHALL be sent by the camera in response to the VideoStreamAllocate command, carrying the newly allocated video stream identifier. + + + + + This command SHALL be used to modify the resolution of a stream specified by the VideoStreamID. + + + + + + + + + This command SHALL deallocate a video stream on the camera, corresponding to the given video stream identifier. + + + + + + This command SHALL allocate a snapshot stream on the device and return an allocated snapshot stream identifier. + + + + + + + + + + + This command SHALL be sent by the device in response to the SnapshotStreamAllocate command, carrying the newly allocated snapshot stream identifier. + + + + + This command SHALL deallocate an snapshot stream on the camera, corresponding to the given snapshot stream identifier. + + + + + + This command SHALL set the relative priorities of the various stream types on the camera. + + + + + + This command SHALL return a Snapshot from the camera. + + + + + + + This command SHALL be sent by the device in response to the CaptureSnapshot command, carrying the requested snapshot. + + + + + + + This command sets the viewport in all video streams. + + + + + + The data fields for this command SHALL be as follows: + + + + + + The data fields for this command SHALL be as follows: + + + + + + The data fields for this command SHALL be as follows: + + + + + + + + + + + + + + + + + This event SHALL be generated when there is a modification in the corresponding video stream. + + + + + + + + + + + This event SHALL be generated when there is a modification in the corresponding audio stream. + + + + + + + + + + + This event SHALL be generated when there is a modification in the corresponding snapshot stream. + + + + diff --git a/src/app/zap-templates/zcl/data-model/chip/global-enums.xml b/src/app/zap-templates/zcl/data-model/chip/global-enums.xml index 81ebd8506a..277ceb01aa 100644 --- a/src/app/zap-templates/zcl/data-model/chip/global-enums.xml +++ b/src/app/zap-templates/zcl/data-model/chip/global-enums.xml @@ -34,6 +34,18 @@ TODO: Make these structures global rather than defining them for each cluster. + + + + + + + + + + + +