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 01/27] [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 0c263fc6ae3cfa..c90619bdddc040 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 dd102217482de3..09d8a7d266a8ca 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 5b9fc4c9ae894b..27b2e35365a1c6 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 253e21e4ef6a97..6b399a1c1dbf27 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 02/27] [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 9f5456cec09f76..2b7aeef2b79375 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 26b9183da6a6b8..d731ab2dc6a804 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 03/27] 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 a957074e3ce1f9..4541871dcba139 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 0d41b3f5194b5a..43582fdb366918 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 00000000000000..3a5159cc514bf1 --- /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 c99919a9080a8b..93ce543e09e98c 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 849b3a9c07d39e..10209346a0cd94 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 4955cbd3ff3222..5a3812056125ab 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 9e2108896df494..2868d9548f7733 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 0afdf03edee25c..37577b62704f9d 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 9766e9a0c6be66..15c7380d23cff9 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 9f4aea321813af..e8aa253ae714af 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 219be92b35cedd..6f5ed4760c2279 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 23e8535f510650..5f3b3d69ec2146 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 27e016da52c1ee..2e90245f479d3d 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 4b3156bbe9e456..8ed77f6ba812e5 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 3cd7f3a9b21b9b..dfe6aac340269c 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 7897847accc7bf..093e389dcf41db 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 aeb245a9be31e6..845d8e9d4a9e3f 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 66a1d06c05e998..c585b14a8477b7 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 cef0eae01b9c12..ec31d8341b388c 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 6ab8c82be629b2..fd6b88370d1c41 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 07b6fc2745b247..f5eeec33449589 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 060a540017cd58..b3b09afad31e25 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 c689dd649be7c0..b656973f6afe98 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 9ccb50b38711b6..7e7937d86f5fe2 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 07d5706a22b030..fe7ed3de40702d 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 2cbbf0fe9a19b6..c2c76ecde0ca5f 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 647bee1528b08c..f974364115f1da 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 1cf2f7e8a038e7..7db0ddca28ce04 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 7e19f8dee9c1c6..2c69456e86e57d 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 12407e6c5fd6b0..223cfdf588175a 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 9fa60cd8bf31a8..9bf08fe72afdf0 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 c08f4eb4ef2a65..e8e6ce773c6fec 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 1130a7b423d8bd..6678080a600d6b 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 da51ba252820cc..49c8c6a6375a3e 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 4975d3ae296609..851099cb8ec8e2 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 8f2e0baf35b9b6..810efdbfa25362 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 b5e26e4336a6e3..168417dd984856 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 25398b41eadfbf..c5699c03184a81 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 6a396fc3a3153f..1b591cd438c3fc 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 f7f7d75d53fd8a..c845ec199734d5 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 2e2a96f92be941..32dea4af4fc754 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 36e7ab984ae094..44c65fbc58ac15 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 1f3d240b22c611..016778fdf1d0bd 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 4541b9cc6e06a9..05111e3b8f9c89 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 27542e651d4699..17b068452cdae6 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 7e5af6c7a5ea73..58c333e8b4e6b0 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 46ed696da919c0..633893272598d5 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 cf63bd810a0622..342fbc64f61c10 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 dc1b69da2272f9..809e2785170ab2 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 84a511b98ded98..f9f192f18ea6ae 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 75690865cf6d8e..114f41ab9c651b 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 defe78eafdab72..84451d26002c28 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 b92eaf42b5f318..fb294b724f9e82 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 9ff05d4ab0d68f..e0e9d86320302a 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 8e700b49ab61f0..a3e350bdfb76c7 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 1cb6ec203a703c..a0adf75ac4b8e2 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 85868a94683ab9..403544bf4fcc6b 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 0b6b4809a489d4..653bd942a949e3 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 6058aa34c50431..408cd85adb60d7 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 6e8bd7d9f532b7..69a41b08e034a9 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 fb5d5f6b362cb7..0f67fb04053ac6 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 1408e2b9f631b7..43cb2cddf8d122 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 61e52ed0bee62d..144bfd82d38037 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 92005f345bb21a..6494f4a7f17c63 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 aaebf642b1fcfa..10355debd0543b 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 b25cfe16ce3b09..4571cfb36305f2 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 8f809b4adaecd2..d66ff60bf6304b 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 f12cafea666617..0f3c74e66248f3 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 97e9e047d24ca7..d817042753c251 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 ced3b16b3d6a45..82c9e93dad0414 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 11e8d545b542d1..1bd7185b1f6e60 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 5f7df8c160b410..0f1c3deae690f3 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 f8322506e65294..483be894ba11ed 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 736c97096ef22c..799510eeeadf32 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 935811de21f2e1..7a4dde3f6cb983 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 722339357b3e66..989680ed6b8e0a 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 d03f99e55fef12..26dfc3e52f8f22 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 35d1cb62c0949d..8d7f6d5ed876ec 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 d46d72553d89a9..58181a6588205f 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 924c6f4a017d9d..d9800d65b7ceac 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 bc1d6980711661..d261e539047c35 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 4ebb32525cbb62..8ff2a570376505 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 4b7222b69033eb..dacfe58c8b6923 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 07c889a6ea44d6..c0437cb8096537 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 7bfb97c22eea1f..a1db9bac83cedd 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 b00de41f370b64..74194135de80f7 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 d9e876bcd04761..0f4cd513e3341a 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 94c33d58c022a1..d120bb7169c17d 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 bd33e693dca63e..3fd126fc529e49 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 a7d318ca658e28..f806db4d0921e6 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 1b17aec1fd1ab6..39042271e11331 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 74a8becdf77d40..795e81cf2f274d 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 57ae214a5d81ea..59549fd0bcdc9b 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 57c51fa98d7c02..6f913578cbcb9a 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 35eef081a93fbc..45596896405b98 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 9e117249752e03..e05c4a5bd5056c 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 8a7762337e6bca..5cad6ce013fed6 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 885ec6b16c0720..d831d486d27bd2 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 463b8136d50f5f..bf5e97ea5e9d0c 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 9c6cb80d9a2ed5..8d4b53f4292c24 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 b6ba0ead011199..cce0a2f697a8d7 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 d4e5f186621a62..3a5ca170694138 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 be21c6d7d43272..1506d2a7125f96 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 91e2958fb0030e..2bfc214665defd 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 1b6966a09ab4bc..060b71d85ee550 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 8617d3ddd6e101..f0ed8f214d421a 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 3671747dee1b3f..d35aa6e61e4af7 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 d468227781b4c7..ec2c7c17daf098 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 687f4d21b060eb..89a2462a2bf917 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 9441569c874517..0b9e1ec3bb067a 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 6bf7226986f270..d830a416c0911a 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 2fa1215bd1a9d4..55afad11bebe88 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 815fcef97b0a42..329bceb1fb1cb5 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 892bf28f0d3d1a..ffc639390ee3de 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 4fd9ef92717e3e..42edca72f39515 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 db4b390027a9a6..2770625bb707fa 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 c697c7ab5f5be5..557b7606ccbea3 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 dbff20e6f45ffd..13f4420b0a24ad 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 639bd3dd9a2de2..3de09c6e9356dc 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 2785171f9412f4..0cbf0274c5977b 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 9e4bca47626543..3dfd75f4f43897 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 2c4ddd1dc74861..5234a74685c34e 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 52624655554a7b..7352d03e241a91 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 ae3e6c393085b6..48715c3b7a5aa9 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 60bbed18bd1908..1b522117b9ea6f 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 458b3cf740170b..ad515dbff1983a 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 d3040fdb6be570..90db1601b1375a 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 850faf052adf24..55c37c70945571 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 f53a75503b5ace..e78d6d7f427c7e 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 74c09e2b72f02c..8cfbee8e46a8fa 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 19229b38ec2afe..315790e9802726 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 41482be51c356f..41773804e45d75 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 9592bce3fe90e5..b55e21d88498bd 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 3f3a84bdf2d283..cf53f446f903c8 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 99da6da78b8547..130ccb8d59fa3d 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 434da0025824b6..dc6188a14e92fa 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 7cafaa7b5549fb..3c764c6fe8c9bf 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 9858976520ce63..cb2df9d66a87e3 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 b9aa7dabb73c94..99ca9f3ac0194b 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 1aaed7a14e36f4..0865bc87f4d1cc 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 cd4378fcdc1bfa..7677dcf184c0b2 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 91c679e14be918..81389830301a72 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 dff4bd5f82d445..74f935aac9714e 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 a367dcad3d84be..76fe9074bec56f 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 d62797e91e60dc..f363f03ba688d8 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 f6fe8738f47972..0e9ec9f7957f42 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 edc71545cf2d42..1c6cea2023d4de 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 07785346c7539c..82a77c4c886d17 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 1f439b84e68779..4ce83f81ddbd4b 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 3f292d0e85fb27..4c7c9d9420bad0 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 f48b96991ef80d..d0ae9cf86af2c0 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 fa77f94ae7dd69..6dad144f3050c4 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 38053540c69413..ae4f64a8059bb7 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 a079c88c8be8ab..d6f00b00a6c13b 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 f4c6ebfa14d25f..4b53ab032cc668 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 0609051f4ef38f..6905e3bde8096f 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 d90065d5bb34bb..a63053cf346ea8 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 f1363a51f33c83..30c57dcb3fa6dc 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 a103898567159c..9af428d103674c 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 f2f0dd66314688..9365e5bc780520 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 a66d4eafd4fecc..b0762d0d88169c 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 f6ad63d3682194..b85ff9a9f024e4 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 3b850c08043811..c6b7674c6c7f60 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 9d7d9b28794a27..2bbcdd5108b03f 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 6172ee013fdcba..b9dcb0257d1b1a 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 91e2102b5ec46d..07e8613cc1cc4d 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 a17f7b8be47013..6465692c95fd63 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 8436bc8418a804..77eca93761ab8f 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 dfd03d957d4f0b..d4033ea58ba8b6 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 3744b6fe5e70d5..ca41bf088e0fd2 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 f0ff8032eab519..ddf3e421a7f75c 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 6e3980bcae429e..9d98a050c702f1 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 8969807d5819e3..eda01ef9556493 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 08c3e830d21271..811349b3a96f6c 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 7729ccee8af24d..a9ee14f12b622f 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 4e0171b0779936..b4c908c232fa94 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 2f4c9a1f55b8d1..50bca6f3da1f7f 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 70d7b966acda4e..872f1fa9301866 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 92c0ab23ceb620..cdd13822929cff 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 4e678211c5ddce..34a391873b3101 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 5f00eeb287a543..64af55ce0710e1 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 0793ee3b10387d..2d910b1e52b364 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 41bbcef22b8c2e..19c7aee68defd9 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 af56efc3d58ff5..3b21a1c050ae0d 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 58d37bf10180b0..7e7775d555261d 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 2e153a37dec551..2d23a9f84b0192 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 75ffea120ff126..97a13606eabc45 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 e4262a09e70ab8..b8e567f76a4504 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 c972116f343dde..b38f6f94df6c1d 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 2d0afb8a5c2e67..6c9bc1c0884d41 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 82b49eddd86953..ce32518b71c7c3 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 8634e94129b86a..8a30609e94e2cf 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 bd28023b8e32e8..6a2dc48ba4ebd9 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 d79b4125309e11..ed9f1b353149c6 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 3b1b6a5b1cd269..96dced72f952af 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 acdeb676ed8aa5..6cfb95803af52b 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 d728a61991edf0..5fd170463d3e7a 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 16a2e6dbb0cd5b..597468624d0ea1 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 04/27] [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 00000000000000..9021cd80f61815 --- /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 14d9caf7e21839..c1a879277865ed 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 d2fd8b72afadf6..b39f65b96d77c7 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 00000000000000..28f362ba2d3b21 --- /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 05/27] [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 9a6989881e5e0c..9a51b612a18a7c 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 06/27] [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 8acb5636f4f648..3a27c68184c8b0 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 b261eba0bb3a4d..11dcf2f03db88e 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 83dae81eec9a28..653742177876cd 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 e9dded102bcac1..138e1129b82273 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 1188d9a796a4c5..fceb80c2d802f5 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 d6282f287a1181..ea0c9b1203f58f 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 e63769de1d0a3e..56f43620b56114 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 7e7937d86f5fe2..a2e7b15dc2af99 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 3fd126fc529e49..995a80cd941289 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 39042271e11331..2ac1556199a0c7 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 07/27] [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 e46fdce014aef0..41e38b6593b687 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 08/27] [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 5c24cdec825ac1..f3954d1eb89358 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 00000000000000..b05216fc9d7eae --- /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 00000000000000..d024a5da954b9d --- /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 00000000000000..e2586446b812d8 --- /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 00000000000000..7e52816578fbee --- /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 00000000000000..d391814190d09f --- /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 00000000000000..f2758328a72777 --- /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 00000000000000..d1ade242d14a0f --- /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 00000000000000..0d217ab47b4256 --- /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 00000000000000..f7927d1a6aaecc --- /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 00000000000000..3c8601d09bee9b --- /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 00000000000000..61d3ad5f4c8fab --- /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 00000000000000..c1633f454d3359 --- /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 00000000000000..259034e1b5704a --- /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 00000000000000..63cc97e84922a2 --- /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 00000000000000..57d85a48307a7f --- /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 00000000000000..df46629269ab58 --- /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 00000000000000..9b9e1b548ed13d --- /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 00000000000000..f832e6f0b53d74 --- /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 00000000000000..dba13b3a518e64 --- /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 00000000000000..3d1cfd234ac688 --- /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 00000000000000..c33729fc43741a --- /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 00000000000000..8b8d24e11524d7 --- /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 00000000000000..b05216fc9d7eae --- /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 00000000000000..679421424806b9 --- /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 00000000000000..948f1b590bc9fe --- /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 00000000000000..477699f17f23d9 --- /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 00000000000000..db7bdf853a4946 --- /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 00000000000000..01f30e70f552ec --- /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 00000000000000..2d48dd821d5ea8 --- /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 00000000000000..c751c71c268255 --- /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 00000000000000..7e3a68a707e31b --- /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 00000000000000..cc972c64546e48 --- /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 00000000000000..df4e9e7ae8c4bd --- /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 00000000000000..c866b86874994d --- /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 65d214d31904ab..f70b9bf33cd741 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 da563910f749c7..568c4b753d9081 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 ff545ecf38c762..58258b73cd50e8 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 157b85d4773f5f..3adefb0953d373 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 33235198752182..d993e5c163ada1 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 17d2c865bbaf53..c802cf8e047dcb 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 78795976c0bbc2..bffe3c900d29af 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 386ba20c6d6982..29aaae72805818 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 7bab05ab23eccf..d743598efeedf9 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 b4f5366038a1a5..f42faea3c0b47a 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 09/27] 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 4880c1058dc7f9..5793ebfd1a4726 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 3fe162181391d4..13d2bc8a6da850 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 104a57a2fc019a..e3ad975bce4fa6 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 00000000000000..f8d9f34642f1cc --- /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 10/27] 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 a2dca96dc6dd24..b3a6ed24e66568 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 b3115f2ff3113a..783c46ef4100ee 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 104777a72bb735..161fdd52aef6d6 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 11/27] =?UTF-8?q?Revert=20"Refactoring=20of=20support=20te?= =?UTF-8?q?st=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 4541871dcba139..a957074e3ce1f9 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 43582fdb366918..0d41b3f5194b5a 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 3a5159cc514bf1..00000000000000 --- 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 93ce543e09e98c..c99919a9080a8b 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 10209346a0cd94..849b3a9c07d39e 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 5a3812056125ab..4955cbd3ff3222 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 2868d9548f7733..9e2108896df494 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 37577b62704f9d..0afdf03edee25c 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 15c7380d23cff9..9766e9a0c6be66 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 e8aa253ae714af..9f4aea321813af 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 6f5ed4760c2279..219be92b35cedd 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 5f3b3d69ec2146..23e8535f510650 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 2e90245f479d3d..27e016da52c1ee 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 8ed77f6ba812e5..4b3156bbe9e456 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 dfe6aac340269c..3cd7f3a9b21b9b 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 093e389dcf41db..7897847accc7bf 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 845d8e9d4a9e3f..aeb245a9be31e6 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 c585b14a8477b7..66a1d06c05e998 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 ec31d8341b388c..cef0eae01b9c12 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 fd6b88370d1c41..6ab8c82be629b2 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 f5eeec33449589..07b6fc2745b247 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 b3b09afad31e25..060a540017cd58 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 b656973f6afe98..c689dd649be7c0 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 a2e7b15dc2af99..76e8e83c92fd4d 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 fe7ed3de40702d..07d5706a22b030 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 c2c76ecde0ca5f..2cbbf0fe9a19b6 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 f974364115f1da..647bee1528b08c 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 7db0ddca28ce04..1cf2f7e8a038e7 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 2c69456e86e57d..7e19f8dee9c1c6 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 223cfdf588175a..12407e6c5fd6b0 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 9bf08fe72afdf0..9fa60cd8bf31a8 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 e8e6ce773c6fec..c08f4eb4ef2a65 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 6678080a600d6b..1130a7b423d8bd 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 49c8c6a6375a3e..da51ba252820cc 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 851099cb8ec8e2..4975d3ae296609 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 810efdbfa25362..8f2e0baf35b9b6 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 168417dd984856..b5e26e4336a6e3 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 c5699c03184a81..25398b41eadfbf 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 1b591cd438c3fc..6a396fc3a3153f 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 c845ec199734d5..f7f7d75d53fd8a 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 32dea4af4fc754..2e2a96f92be941 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 44c65fbc58ac15..36e7ab984ae094 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 016778fdf1d0bd..1f3d240b22c611 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 05111e3b8f9c89..4541b9cc6e06a9 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 17b068452cdae6..27542e651d4699 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 58c333e8b4e6b0..7e5af6c7a5ea73 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 633893272598d5..46ed696da919c0 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 342fbc64f61c10..cf63bd810a0622 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 809e2785170ab2..dc1b69da2272f9 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 f9f192f18ea6ae..84a511b98ded98 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 114f41ab9c651b..75690865cf6d8e 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 84451d26002c28..defe78eafdab72 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 fb294b724f9e82..b92eaf42b5f318 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 e0e9d86320302a..9ff05d4ab0d68f 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 a3e350bdfb76c7..8e700b49ab61f0 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 a0adf75ac4b8e2..1cb6ec203a703c 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 403544bf4fcc6b..85868a94683ab9 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 653bd942a949e3..0b6b4809a489d4 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 408cd85adb60d7..6058aa34c50431 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 69a41b08e034a9..6e8bd7d9f532b7 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 0f67fb04053ac6..fb5d5f6b362cb7 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 43cb2cddf8d122..1408e2b9f631b7 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 144bfd82d38037..61e52ed0bee62d 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 6494f4a7f17c63..92005f345bb21a 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 10355debd0543b..aaebf642b1fcfa 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 4571cfb36305f2..b25cfe16ce3b09 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 d66ff60bf6304b..8f809b4adaecd2 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 0f3c74e66248f3..f12cafea666617 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 d817042753c251..97e9e047d24ca7 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 82c9e93dad0414..ced3b16b3d6a45 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 1bd7185b1f6e60..11e8d545b542d1 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 0f1c3deae690f3..5f7df8c160b410 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 483be894ba11ed..f8322506e65294 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 799510eeeadf32..736c97096ef22c 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 7a4dde3f6cb983..935811de21f2e1 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 989680ed6b8e0a..722339357b3e66 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 26dfc3e52f8f22..d03f99e55fef12 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 8d7f6d5ed876ec..35d1cb62c0949d 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 58181a6588205f..d46d72553d89a9 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 d9800d65b7ceac..924c6f4a017d9d 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 d261e539047c35..bc1d6980711661 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 8ff2a570376505..4ebb32525cbb62 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 dacfe58c8b6923..4b7222b69033eb 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 c0437cb8096537..07c889a6ea44d6 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 a1db9bac83cedd..7bfb97c22eea1f 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 74194135de80f7..b00de41f370b64 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 0f4cd513e3341a..d9e876bcd04761 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 d120bb7169c17d..94c33d58c022a1 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 995a80cd941289..a04cbf0cdeaf4c 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 f806db4d0921e6..a7d318ca658e28 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 2ac1556199a0c7..c0b3e83fe39629 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 795e81cf2f274d..74a8becdf77d40 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 59549fd0bcdc9b..57ae214a5d81ea 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 6f913578cbcb9a..57c51fa98d7c02 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 45596896405b98..35eef081a93fbc 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 e05c4a5bd5056c..9e117249752e03 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 5cad6ce013fed6..8a7762337e6bca 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 d831d486d27bd2..885ec6b16c0720 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 bf5e97ea5e9d0c..463b8136d50f5f 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 8d4b53f4292c24..9c6cb80d9a2ed5 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 cce0a2f697a8d7..b6ba0ead011199 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 3a5ca170694138..d4e5f186621a62 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 1506d2a7125f96..be21c6d7d43272 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 2bfc214665defd..91e2958fb0030e 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 060b71d85ee550..1b6966a09ab4bc 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 f0ed8f214d421a..8617d3ddd6e101 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 d35aa6e61e4af7..3671747dee1b3f 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 ec2c7c17daf098..d468227781b4c7 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 89a2462a2bf917..687f4d21b060eb 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 0b9e1ec3bb067a..9441569c874517 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 d830a416c0911a..6bf7226986f270 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 55afad11bebe88..2fa1215bd1a9d4 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 329bceb1fb1cb5..815fcef97b0a42 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 ffc639390ee3de..892bf28f0d3d1a 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 42edca72f39515..4fd9ef92717e3e 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 2770625bb707fa..db4b390027a9a6 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 557b7606ccbea3..c697c7ab5f5be5 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 13f4420b0a24ad..dbff20e6f45ffd 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 3de09c6e9356dc..639bd3dd9a2de2 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 0cbf0274c5977b..2785171f9412f4 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 3dfd75f4f43897..9e4bca47626543 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 5234a74685c34e..2c4ddd1dc74861 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 7352d03e241a91..52624655554a7b 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 48715c3b7a5aa9..ae3e6c393085b6 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 1b522117b9ea6f..60bbed18bd1908 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 ad515dbff1983a..458b3cf740170b 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 90db1601b1375a..d3040fdb6be570 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 55c37c70945571..850faf052adf24 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 e78d6d7f427c7e..f53a75503b5ace 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 8cfbee8e46a8fa..74c09e2b72f02c 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 315790e9802726..19229b38ec2afe 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 41773804e45d75..41482be51c356f 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 b55e21d88498bd..9592bce3fe90e5 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 cf53f446f903c8..3f3a84bdf2d283 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 130ccb8d59fa3d..99da6da78b8547 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 dc6188a14e92fa..434da0025824b6 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 3c764c6fe8c9bf..7cafaa7b5549fb 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 cb2df9d66a87e3..9858976520ce63 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 99ca9f3ac0194b..b9aa7dabb73c94 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 0865bc87f4d1cc..1aaed7a14e36f4 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 7677dcf184c0b2..cd4378fcdc1bfa 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 81389830301a72..91c679e14be918 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 74f935aac9714e..dff4bd5f82d445 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 76fe9074bec56f..a367dcad3d84be 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 f363f03ba688d8..d62797e91e60dc 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 0e9ec9f7957f42..f6fe8738f47972 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 1c6cea2023d4de..edc71545cf2d42 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 82a77c4c886d17..07785346c7539c 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 4ce83f81ddbd4b..1f439b84e68779 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 4c7c9d9420bad0..3f292d0e85fb27 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 d0ae9cf86af2c0..f48b96991ef80d 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 6dad144f3050c4..fa77f94ae7dd69 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 ae4f64a8059bb7..38053540c69413 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 d6f00b00a6c13b..a079c88c8be8ab 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 4b53ab032cc668..f4c6ebfa14d25f 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 6905e3bde8096f..0609051f4ef38f 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 a63053cf346ea8..d90065d5bb34bb 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 30c57dcb3fa6dc..f1363a51f33c83 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 9af428d103674c..a103898567159c 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 9365e5bc780520..f2f0dd66314688 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 b0762d0d88169c..a66d4eafd4fecc 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 b85ff9a9f024e4..f6ad63d3682194 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 c6b7674c6c7f60..3b850c08043811 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 2bbcdd5108b03f..9d7d9b28794a27 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 b9dcb0257d1b1a..6172ee013fdcba 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 07e8613cc1cc4d..91e2102b5ec46d 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 6465692c95fd63..a17f7b8be47013 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 77eca93761ab8f..8436bc8418a804 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 d4033ea58ba8b6..dfd03d957d4f0b 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 ca41bf088e0fd2..3744b6fe5e70d5 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 ddf3e421a7f75c..f0ff8032eab519 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 9d98a050c702f1..6e3980bcae429e 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 eda01ef9556493..8969807d5819e3 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 811349b3a96f6c..08c3e830d21271 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 a9ee14f12b622f..7729ccee8af24d 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 b4c908c232fa94..4e0171b0779936 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 50bca6f3da1f7f..2f4c9a1f55b8d1 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 872f1fa9301866..70d7b966acda4e 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 7e7775d555261d..58d37bf10180b0 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 cdd13822929cff..92c0ab23ceb620 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 34a391873b3101..4e678211c5ddce 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 64af55ce0710e1..5f00eeb287a543 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 2d910b1e52b364..0793ee3b10387d 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 19c7aee68defd9..41bbcef22b8c2e 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 3b21a1c050ae0d..af56efc3d58ff5 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 2d23a9f84b0192..2e153a37dec551 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 b8e567f76a4504..e4262a09e70ab8 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 97a13606eabc45..75ffea120ff126 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 b38f6f94df6c1d..c972116f343dde 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 6c9bc1c0884d41..2d0afb8a5c2e67 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 ce32518b71c7c3..82b49eddd86953 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 8a30609e94e2cf..8634e94129b86a 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 6a2dc48ba4ebd9..bd28023b8e32e8 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 ed9f1b353149c6..d79b4125309e11 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 96dced72f952af..3b1b6a5b1cd269 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 6cfb95803af52b..acdeb676ed8aa5 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 5fd170463d3e7a..d728a61991edf0 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 597468624d0ea1..16a2e6dbb0cd5b 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 12/27] 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 85868a94683ab9..6e0e588d2fe134 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 13/27] =?UTF-8?q?tv-casting-app=20fix=20CloseCommissioning?= =?UTF-8?q?Window=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 fc3ba6cd1da90a..f711096a22f79f 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 4bdf660bd5bda9..f354aa094f7da5 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 c89b899bf5db43..a54d1013d3fec2 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 14/27] [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 61aad700353f08..aefa2fffc1eeb7 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 36e2be5d428436..9ecec60ae52a41 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 15/27] 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 e2763ec41069f3..af102bf96ea5b8 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 16/27] 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 6178348ad5d5d5..345b307f26c24d 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 9683da21f8a7f9..915f20c4a2c863 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 3d5d101fbf4c6e..829af128bf7627 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 17/27] 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 edd34d34bd13d2..00000000000000 --- 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 99f857e86303ea..00000000000000 --- 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 bf1ef5219e5d93..00000000000000 --- 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 e578e73312ebd1..00000000000000 --- 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 cecc041dc2d34b..00000000000000 --- 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 2d37747fe82c12..00000000000000 --- 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 11a54ed360106c..00000000000000 --- 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 cbd365aec78e74..00000000000000 --- 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 0539af8bf6a1ba..42738adce7c0c8 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 b9b9c59661cf74..8c7968888e67e5 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 51d507072bacfd..c9a9a40eedf5f6 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 18/27] 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 aeffec708dba8c..1917fcf4de18f5 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 19/27] 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 8f0a4de9c1a064..e0edc649cc4563 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 20/27] 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 9ff05d4ab0d68f..ba10ba97675d43 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 21/27] 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 29aaae72805818..79ba80159f8823 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 c3e594930d9eac..7047fb21acacbe 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 d743598efeedf9..bd32866dc41e1b 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 f42faea3c0b47a..a06e87e063bad4 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 22/27] [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 d6955a90a55734..a5dd275eb10fbb 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 23/27] 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 79ba80159f8823..37af7693934825 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 bd32866dc41e1b..5658861414e70f 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 a06e87e063bad4..b33467eebac0cc 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 24/27] 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 c8b23b6de70ba5..45b762488ab768 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 bd4b85374cc24f..fe5f028bc3ef9e 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 25/27] 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 9dfa1d87a145e6..9ad98db789b3d6 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 26/27] 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 9c59e54137bf2b..49ce9b663c27af 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 27/27] 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 45b762488ab768..caba07bedff6fa 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: |