From 6ade0dff90846a7aabc9c3723ef438dc9b063357 Mon Sep 17 00:00:00 2001 From: Terence Hampson Date: Thu, 5 Sep 2024 09:36:02 -0400 Subject: [PATCH 01/42] Fix fabric sync test timeouts (#35417) * Override timeout for FabricSync tests * Bump up timeouts just a little more * Remove TODOs that actually won't change since test will need to wait upto time anyways * Add unsaved files --- src/python_testing/TC_BRBINFO_4_1.py | 5 +++-- src/python_testing/TC_CCTRL_2_2.py | 6 ++++++ src/python_testing/TC_CCTRL_2_3.py | 6 ++++++ src/python_testing/TC_ECOINFO_2_2.py | 6 ++++++ src/python_testing/TC_MCORE_FS_1_1.py | 6 ++++++ src/python_testing/TC_MCORE_FS_1_2.py | 4 +++- src/python_testing/TC_MCORE_FS_1_5.py | 4 +++- 7 files changed, 33 insertions(+), 4 deletions(-) diff --git a/src/python_testing/TC_BRBINFO_4_1.py b/src/python_testing/TC_BRBINFO_4_1.py index 595d87912ad012..df922748999dd0 100644 --- a/src/python_testing/TC_BRBINFO_4_1.py +++ b/src/python_testing/TC_BRBINFO_4_1.py @@ -47,10 +47,11 @@ class TC_BRBINFO_4_1(MatterBaseTest): async def _read_attribute_expect_success(self, endpoint, cluster, attribute, node_id): return await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=attribute, node_id=node_id) - # Override default timeout to support a 60 min wait + # This test has some manual steps and also multiple sleeps >= 30 seconds. Test typically runs under 3 mins, + # so 6 minutes is more than enough. @property def default_timeout(self) -> int: - return 63*60 + return 6*60 def desc_TC_BRBINFO_4_1(self) -> str: """Returns a description of this test""" diff --git a/src/python_testing/TC_CCTRL_2_2.py b/src/python_testing/TC_CCTRL_2_2.py index aa52703313ceaa..8e7a8f1fde6ac3 100644 --- a/src/python_testing/TC_CCTRL_2_2.py +++ b/src/python_testing/TC_CCTRL_2_2.py @@ -119,6 +119,12 @@ def steps_TC_CCTRL_2_2(self) -> list[TestStep]: return steps + # This test has some manual steps and also multiple sleeps for up to 30 seconds. Test typically runs + # under 2 mins, so 4 minutes is more than enough. + @property + def default_timeout(self) -> int: + return 4*60 + @run_if_endpoint_matches(has_cluster(Clusters.CommissionerControl)) async def test_TC_CCTRL_2_2(self): self.is_ci = self.check_pics('PICS_SDK_CI_ONLY') diff --git a/src/python_testing/TC_CCTRL_2_3.py b/src/python_testing/TC_CCTRL_2_3.py index 9baa0856412d5f..224f283f46d27b 100644 --- a/src/python_testing/TC_CCTRL_2_3.py +++ b/src/python_testing/TC_CCTRL_2_3.py @@ -103,6 +103,12 @@ def steps_TC_CCTRL_2_3(self) -> list[TestStep]: return steps + # This test has some manual steps and one sleep for up to 30 seconds. Test typically + # runs under 1 mins, so 3 minutes is more than enough. + @property + def default_timeout(self) -> int: + return 3*60 + @per_endpoint_test(has_cluster(Clusters.CommissionerControl)) async def test_TC_CCTRL_2_3(self): self.is_ci = self.check_pics('PICS_SDK_CI_ONLY') diff --git a/src/python_testing/TC_ECOINFO_2_2.py b/src/python_testing/TC_ECOINFO_2_2.py index b004a95927ef59..24f39ab93f2a04 100644 --- a/src/python_testing/TC_ECOINFO_2_2.py +++ b/src/python_testing/TC_ECOINFO_2_2.py @@ -42,6 +42,12 @@ def steps_TC_ECOINFO_2_2(self) -> list[TestStep]: return steps + # This test has some manual steps, so we need a longer timeout. Test typically runs under 1 mins so 3 mins should + # be enough time for test to run + @property + def default_timeout(self) -> int: + return 3*60 + @async_test_body async def test_TC_ECOINFO_2_2(self): dev_ctrl = self.default_controller diff --git a/src/python_testing/TC_MCORE_FS_1_1.py b/src/python_testing/TC_MCORE_FS_1_1.py index 27978af3dee234..e56a1fb8246b56 100755 --- a/src/python_testing/TC_MCORE_FS_1_1.py +++ b/src/python_testing/TC_MCORE_FS_1_1.py @@ -87,6 +87,12 @@ def steps_TC_MCORE_FS_1_1(self) -> list[TestStep]: TestStep("3c", "DUT_FSA commissions TH_FSA")] return steps + # This test has some manual steps and one sleep for up to 30 seconds. Test typically + # runs under 1 mins, so 3 minutes is more than enough. + @property + def default_timeout(self) -> int: + return 3*60 + @async_test_body async def test_TC_MCORE_FS_1_1(self): self.is_ci = self.check_pics('PICS_SDK_CI_ONLY') diff --git a/src/python_testing/TC_MCORE_FS_1_2.py b/src/python_testing/TC_MCORE_FS_1_2.py index c199225b33f99c..816abe5d876b00 100644 --- a/src/python_testing/TC_MCORE_FS_1_2.py +++ b/src/python_testing/TC_MCORE_FS_1_2.py @@ -117,9 +117,11 @@ def steps_TC_MCORE_FS_1_2(self) -> list[TestStep]: TestStep(7, "TH reads all attributes in the Bridged Device Basic Information cluster on new endpoint identified in step 3 from the DUT_FSA")] return steps + # This test has some manual steps, so we need a longer timeout. Test typically runs under 1 mins so 3 mins should + # be enough time for test to run @property def default_timeout(self) -> int: - return self.user_params.get("report_waiting_timeout_delay_sec", 10)*2 + 60 + return 3*60 @async_test_body async def test_TC_MCORE_FS_1_2(self): diff --git a/src/python_testing/TC_MCORE_FS_1_5.py b/src/python_testing/TC_MCORE_FS_1_5.py index dbf20660e7560d..df80072d5126e3 100755 --- a/src/python_testing/TC_MCORE_FS_1_5.py +++ b/src/python_testing/TC_MCORE_FS_1_5.py @@ -117,9 +117,11 @@ def steps_TC_MCORE_FS_1_5(self) -> list[TestStep]: TestStep(10, "TH waits up to 10 seconds for subscription report from the AdministratorCommissioning attribute (from step 6) to reflect values from previous step")] return steps + # This test has some manual steps, so we need a longer timeout. Test typically runs under 1 mins so 3 mins should + # be enough time for test to run @property def default_timeout(self) -> int: - return self.user_params.get("report_waiting_timeout_delay_sec", 10)*2 + 60 + return 3*60 @async_test_body async def test_TC_MCORE_FS_1_5(self): From 5fdee503c4556861bbaaa67e69bd80fbc94b3f13 Mon Sep 17 00:00:00 2001 From: Shubham Patil Date: Thu, 5 Sep 2024 20:22:29 +0530 Subject: [PATCH 02/42] [ESP32] menuconfig options for groups cluster (#35394) * [ESP32] menuconfig options for groups cluster * all-clusters-app has 3 endpoints with group cluster --- config/esp32/components/chip/Kconfig | 20 +++++++++++++++++++ .../all-clusters-app/esp32/sdkconfig.defaults | 2 ++ src/platform/ESP32/CHIPPlatformConfig.h | 12 +++++++++++ 3 files changed, 34 insertions(+) diff --git a/config/esp32/components/chip/Kconfig b/config/esp32/components/chip/Kconfig index 147bb97af25278..40beb7d5ce4643 100644 --- a/config/esp32/components/chip/Kconfig +++ b/config/esp32/components/chip/Kconfig @@ -183,6 +183,26 @@ menu "CHIP Core" or failure during certification tests. Even if it passes, it may fail to function properly with actual controllers. + config MAX_GROUP_ENDPOINTS_PER_FABRIC + int "Maximum Group Endpoints per Fabric" + default 1 + help + Specifies the maximum number of group endpoints supported per fabric. + + config MAX_GROUPS_PER_FABRIC_PER_ENDPOINT + int "Maximum Groups per Fabric per Endpoint" + default 4 + help + Specifies the maximum number of groups per fabric for each endpoint. + The value of CHIP_CONFIG_MAX_GROUPS_PER_FABRIC is calculated as: + (MAX_GROUP_ENDPOINTS_PER_FABRIC * MAX_GROUPS_PER_FABRIC_PER_ENDPOINT) + + config MAX_GROUP_KEYS_PER_FABRIC + int "Maximum Number of Group Key Sets per Fabric" + default 3 + help + Specifies the maximum number of group key sets supported per fabric. + endmenu # "General Options" menu "Networking Options" diff --git a/examples/all-clusters-app/esp32/sdkconfig.defaults b/examples/all-clusters-app/esp32/sdkconfig.defaults index 08fcf94d8ca928..ed9adcc7d82870 100644 --- a/examples/all-clusters-app/esp32/sdkconfig.defaults +++ b/examples/all-clusters-app/esp32/sdkconfig.defaults @@ -72,3 +72,5 @@ CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH=y # Increase LwIP IPv6 address number CONFIG_LWIP_IPV6_NUM_ADDRESSES=6 + +CONFIG_MAX_GROUP_ENDPOINTS_PER_FABRIC=3 diff --git a/src/platform/ESP32/CHIPPlatformConfig.h b/src/platform/ESP32/CHIPPlatformConfig.h index 24fbf7c4f1b809..e5b189772662d1 100644 --- a/src/platform/ESP32/CHIPPlatformConfig.h +++ b/src/platform/ESP32/CHIPPlatformConfig.h @@ -69,6 +69,18 @@ #define CHIP_CONFIG_MAX_FABRICS CONFIG_MAX_FABRICS #endif +#ifndef CHIP_CONFIG_MAX_GROUP_ENDPOINTS_PER_FABRIC +#define CHIP_CONFIG_MAX_GROUP_ENDPOINTS_PER_FABRIC CONFIG_MAX_GROUP_ENDPOINTS_PER_FABRIC +#endif + +#ifndef CHIP_CONFIG_MAX_GROUPS_PER_FABRIC +#define CHIP_CONFIG_MAX_GROUPS_PER_FABRIC (CONFIG_MAX_GROUPS_PER_FABRIC_PER_ENDPOINT * CHIP_CONFIG_MAX_GROUP_ENDPOINTS_PER_FABRIC) +#endif + +#ifndef CHIP_CONFIG_MAX_GROUP_KEYS_PER_FABRIC +#define CHIP_CONFIG_MAX_GROUP_KEYS_PER_FABRIC CONFIG_MAX_GROUP_KEYS_PER_FABRIC +#endif + #ifdef CONFIG_ENABLE_WIFI_STATION #define CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION 1 #else From 9c40d08e66037e330b18bd1fc1dc6febb6990d36 Mon Sep 17 00:00:00 2001 From: jby-nxp <113013617+jby-nxp@users.noreply.github.com> Date: Thu, 5 Sep 2024 17:37:07 +0200 Subject: [PATCH 03/42] [NXP] fix issue when joining predefined wifi AP (#35091) --- .../nxp/common/CHIPDeviceNXPPlatformDefaultConfig.h | 4 ++++ src/platform/nxp/common/CHIPDevicePlatformEvent.h | 1 + src/platform/nxp/common/ConnectivityManagerImpl.cpp | 13 +++++++++---- src/platform/nxp/common/ConnectivityManagerImpl.h | 1 + 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/platform/nxp/common/CHIPDeviceNXPPlatformDefaultConfig.h b/src/platform/nxp/common/CHIPDeviceNXPPlatformDefaultConfig.h index 28e26038e6a3e2..ba2321c9a26566 100644 --- a/src/platform/nxp/common/CHIPDeviceNXPPlatformDefaultConfig.h +++ b/src/platform/nxp/common/CHIPDeviceNXPPlatformDefaultConfig.h @@ -118,3 +118,7 @@ #ifndef CHIP_DEVICE_CONFIG_INIT_OT_PLAT_ALARM #define CHIP_DEVICE_CONFIG_INIT_OT_PLAT_ALARM 1 #endif // CHIP_DEVICE_CONFIG_INIT_OT_PLAT_ALARM + +#ifndef CHIP_DEVICE_CONFIG_WIFI_STATION_RECONNECT_INTERVAL +#define CHIP_DEVICE_CONFIG_WIFI_STATION_RECONNECT_INTERVAL 300 +#endif // CHIP_DEVICE_CONFIG_WIFI_STATION_RECONNECT_INTERVAL in Milliseconds diff --git a/src/platform/nxp/common/CHIPDevicePlatformEvent.h b/src/platform/nxp/common/CHIPDevicePlatformEvent.h index 5c6a5c3c39ecf9..2f0947b859f27b 100644 --- a/src/platform/nxp/common/CHIPDevicePlatformEvent.h +++ b/src/platform/nxp/common/CHIPDevicePlatformEvent.h @@ -70,6 +70,7 @@ enum InternalPlatformSpecificEventTypes kPlatformNxpIpChangeEvent, kPlatformNxpStartWlanConnectEvent, kPlatformNxpScanWiFiNetworkDoneEvent, + kPlatformNxpStartWlanInitWaitTimerEvent, }; } // namespace DeviceEventType diff --git a/src/platform/nxp/common/ConnectivityManagerImpl.cpp b/src/platform/nxp/common/ConnectivityManagerImpl.cpp index 9c3eb7fb7a88e8..09d716ac6ea77f 100644 --- a/src/platform/nxp/common/ConnectivityManagerImpl.cpp +++ b/src/platform/nxp/common/ConnectivityManagerImpl.cpp @@ -162,6 +162,11 @@ void ConnectivityManagerImpl::_OnPlatformEvent(const ChipDeviceEvent * event) NetworkCommissioning::NXPWiFiDriver::GetInstance().ScanWiFINetworkDoneFromMatterTaskContext( event->Platform.ScanWiFiNetworkCount); } + else if (event->Type == kPlatformNxpStartWlanInitWaitTimerEvent) + { + DeviceLayer::SystemLayer().StartTimer(System::Clock::Milliseconds32(kWlanInitWaitMs), ConnectNetworkTimerHandler, + (void *) event->Platform.pNetworkDataEvent); + } #endif } @@ -662,10 +667,10 @@ void ConnectivityManagerImpl::ConnectNetworkTimerHandler(::chip::System::Layer * } else { - PlatformMgr().LockChipStack(); - DeviceLayer::SystemLayer().StartTimer(System::Clock::Milliseconds32(CHIP_DEVICE_CONFIG_WIFI_STATION_RECONNECT_INTERVAL), - ConnectNetworkTimerHandler, context); - PlatformMgr().UnlockChipStack(); + /* Post an event to start a delay timer asynchronously in the Matter task context */ + event.Type = DeviceEventType::kPlatformNxpStartWlanInitWaitTimerEvent; + event.Platform.pNetworkDataEvent = (struct wlan_network *) context; + (void) PlatformMgr().PostEvent(&event); } } diff --git a/src/platform/nxp/common/ConnectivityManagerImpl.h b/src/platform/nxp/common/ConnectivityManagerImpl.h index 9327e4d2d1ec9b..a187d0baf39e60 100644 --- a/src/platform/nxp/common/ConnectivityManagerImpl.h +++ b/src/platform/nxp/common/ConnectivityManagerImpl.h @@ -144,6 +144,7 @@ class ConnectivityManagerImpl final : public ConnectivityManager, BitFlags mFlags; static netif_ext_callback_t sNetifCallback; + static constexpr uint32_t kWlanInitWaitMs = CHIP_DEVICE_CONFIG_WIFI_STATION_RECONNECT_INTERVAL; #if CHIP_ENABLE_OPENTHREAD static constexpr uint8_t kMaxIp6Addr = 3; From 3621c4322857e600dbd51855b893a7da43813dcf Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 5 Sep 2024 11:59:37 -0400 Subject: [PATCH 04/42] Add MinValue/MaxValue helpers on our NumericAttributeTraits. (#35390) * Add MinValue/MaxValue helpers on our NumericAttributeTraits. Uses the new helpers in SceneHandlerImpl. Fixes https://github.com/project-chip/connectedhomeip/issues/35328 * Address review comments. --- .../scenes-server/SceneHandlerImpl.cpp | 74 +++++-------------- .../util/attribute-storage-null-handling.h | 37 ++++++++++ src/app/util/odd-sized-integers.h | 55 +++++++++----- 3 files changed, 91 insertions(+), 75 deletions(-) diff --git a/src/app/clusters/scenes-server/SceneHandlerImpl.cpp b/src/app/clusters/scenes-server/SceneHandlerImpl.cpp index 4e01802f00f34a..fcaa3985734bb2 100644 --- a/src/app/clusters/scenes-server/SceneHandlerImpl.cpp +++ b/src/app/clusters/scenes-server/SceneHandlerImpl.cpp @@ -77,62 +77,25 @@ bool IsExactlyOneValuePopulated(const AttributeValuePairType & type) /// CapAttributeValue /// Cap the attribute value based on the attribute's min and max if they are defined, /// or based on the attribute's size if they are not. -/// @param[in] aVPair AttributeValuePairType -/// @param[in] metadata EmberAfAttributeMetadata /// -template +/// The TypeForMinMax template parameter determines the type to use for the +/// min/max computation. The Type template parameter determines how the +/// resulting value is actually represented, because for booleans we +/// unfortunately end up using uint8, not an actual boolean. +/// +/// @param[in] value The value from the AttributeValuePairType that we were given. +/// @param[in] metadata The metadata for the attribute the value is for. +/// +/// +/// +template void CapAttributeValue(typename app::NumericAttributeTraits::WorkingType & value, const EmberAfAttributeMetadata * metadata) { - using IntType = app::NumericAttributeTraits; - using WorkingType = typename IntType::WorkingType; - - WorkingType maxValue; - WorkingType minValue; - uint16_t bitWidth = static_cast(emberAfAttributeSize(metadata) * 8); - - // TODO Use min/max values from Type to obtain min/max instead of relying on metadata. See: - // https://github.com/project-chip/connectedhomeip/issues/35328 - - // Min/Max Value caps for the OddSize integers - if (metadata->IsSignedIntegerAttribute()) - { - // We use emberAfAttributeSize for cases like INT24S, INT40S, INT48S, INT56S where numeric_limits::max() - // wouldn't work - maxValue = static_cast((1ULL << (bitWidth - 1)) - 1); - minValue = static_cast(-(1ULL << (bitWidth - 1))); - } - else - { - // We use emberAfAttributeSize for cases like INT24U, INT40U, INT48U, INT56U where numeric_limits::max() - // wouldn't work - if (ZCL_INT64U_ATTRIBUTE_TYPE == app::Compatibility::Internal::AttributeBaseType(metadata->attributeType)) - { - maxValue = static_cast(UINT64_MAX); // Bit shift of 64 is undefined so we use UINT64_MAX - } - else - { - maxValue = static_cast((1ULL << bitWidth) - 1); - } - minValue = static_cast(0); - } + using IntType = app::NumericAttributeTraits; + using WorkingType = std::remove_reference_t; - // Ensure that the metadata's signedness matches the working type's signedness - VerifyOrDie(metadata->IsSignedIntegerAttribute() == std::is_signed::value); - - if (metadata->IsBoolean()) - { - if (metadata->IsNullable() && (value != 1 && value != 0)) - { - // If the attribute is nullable, the value can be set to NULL - app::NumericAttributeTraits::SetNull(value); - } - else - { - // Caping the value to 1 in case values greater than 1 are set - value = value ? 1 : 0; - } - return; - } + WorkingType minValue = IntType::MinValue(metadata->IsNullable()); + WorkingType maxValue = IntType::MaxValue(metadata->IsNullable()); // Check metadata for min and max values if (metadata->HasMinMax()) @@ -142,10 +105,6 @@ void CapAttributeValue(typename app::NumericAttributeTraits::WorkingType & maxValue = ConvertDefaultValueToWorkingValue(minMaxValue->maxValue); } - // If the attribute is nullable, the min and max values calculated for types will not be valid, however this does not - // change the behavior here as the value will already be NULL if it is out of range. E.g. a nullable INT8U has a minValue of - // -127. The code above determin minValue = -128, so an input value of -128 would not enter the condition block below, but would - // be considered NULL nonetheless. if (metadata->IsNullable() && (minValue > value || maxValue < value)) { // If the attribute is nullable, the value can be set to NULL @@ -187,6 +146,9 @@ CHIP_ERROR ValidateAttributePath(EndpointId endpoint, ClusterId cluster, Attribu switch (app::Compatibility::Internal::AttributeBaseType(metadata->attributeType)) { case ZCL_BOOLEAN_ATTRIBUTE_TYPE: + VerifyOrReturnError(aVPair.valueUnsigned8.HasValue(), CHIP_ERROR_INVALID_ARGUMENT); + CapAttributeValue(aVPair.valueUnsigned8.Value(), metadata); + break; case ZCL_INT8U_ATTRIBUTE_TYPE: VerifyOrReturnError(aVPair.valueUnsigned8.HasValue(), CHIP_ERROR_INVALID_ARGUMENT); CapAttributeValue(aVPair.valueUnsigned8.Value(), metadata); diff --git a/src/app/util/attribute-storage-null-handling.h b/src/app/util/attribute-storage-null-handling.h index 8db72a2321bf7b..826e5aff531a98 100644 --- a/src/app/util/attribute-storage-null-handling.h +++ b/src/app/util/attribute-storage-null-handling.h @@ -127,6 +127,39 @@ struct NumericAttributeTraits // Utility that lets consumers treat a StorageType instance as a uint8_t* // for writing to the attribute store. static uint8_t * ToAttributeStoreRepresentation(StorageType & value) { return reinterpret_cast(&value); } + + // Min and max values for the type. + static WorkingType MinValue(bool isNullable) + { + if constexpr (!std::is_signed_v) + { + return 0; + } + + if (isNullable) + { + // Smallest negative value is excluded for nullable signed types. + return static_cast(std::numeric_limits::min() + 1); + } + + return std::numeric_limits::min(); + } + + static WorkingType MaxValue(bool isNullable) + { + if constexpr (std::is_signed_v) + { + return std::numeric_limits::max(); + } + + if (isNullable) + { + // Largest value is excluded for nullable unsigned types. + return static_cast(std::numeric_limits::max() - 1); + } + + return std::numeric_limits::max(); + } }; template @@ -209,6 +242,10 @@ struct NumericAttributeTraits static uint8_t * ToAttributeStoreRepresentation(StorageType & value) { return reinterpret_cast(&value); } + static uint8_t MinValue(bool isNullable) { return 0; } + + static uint8_t MaxValue(bool isNullable) { return 1; } + private: static constexpr StorageType kNullValue = 0xFF; }; diff --git a/src/app/util/odd-sized-integers.h b/src/app/util/odd-sized-integers.h index f5f1bb50c6b4bf..32f2c8793b2e71 100644 --- a/src/app/util/odd-sized-integers.h +++ b/src/app/util/odd-sized-integers.h @@ -200,35 +200,52 @@ struct NumericAttributeTraits, IsBigEndian> static constexpr bool CanRepresentValue(bool isNullable, WorkingType value) { - // Since WorkingType has at least one extra byte, none of our bitshifts - // overflow. - if (IsSigned) + return MinValue(isNullable) <= value && value <= MaxValue(isNullable); + } + + static CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag, StorageType value) + { + return writer.Put(tag, StorageToWorking(value)); + } + + static uint8_t * ToAttributeStoreRepresentation(StorageType & value) { return value; } + + static WorkingType MinValue(bool isNullable) + { + if constexpr (!IsSigned) { - WorkingType max = (static_cast(1) << (8 * ByteSize - 1)) - 1; - WorkingType min = -max; - if (!isNullable) - { - // We have one more value. - min -= 1; - } - return value >= min && value <= max; + return 0; } - WorkingType max = (static_cast(1) << (8 * ByteSize)) - 1; + // Since WorkingType has at least one extra byte, the bitshift cannot overflow. + constexpr WorkingType signedMin = -(static_cast(1) << (8 * ByteSize - 1)); if (isNullable) { - // we have one less value - max -= 1; + // Smallest negative value is excluded for nullable signed types. + return signedMin + 1; } - return value <= max; + + return signedMin; } - static CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag, StorageType value) + static WorkingType MaxValue(bool isNullable) { - return writer.Put(tag, StorageToWorking(value)); - } + // Since WorkingType has at least one extra byte, none of our bitshifts + // overflow. + if constexpr (IsSigned) + { + return (static_cast(1) << (8 * ByteSize - 1)) - 1; + } - static uint8_t * ToAttributeStoreRepresentation(StorageType & value) { return value; } + constexpr WorkingType unsignedMax = (static_cast(1) << (8 * ByteSize)) - 1; + if (isNullable) + { + // Largest value is excluded for nullable unsigned types. + return unsignedMax - 1; + } + + return unsignedMax; + } }; } // namespace app From a07305590fba74b0b16beb64be72df11ad7197d0 Mon Sep 17 00:00:00 2001 From: Philip Gregor <147669098+pgregorr-amazon@users.noreply.github.com> Date: Thu, 5 Sep 2024 12:42:16 -0400 Subject: [PATCH 05/42] tv-casting-app cancel connection upon CancelPasscode CDC message from TV (#35331) * tv-casting-app cancel connection upon CancelPasscode CDC message from TV * Addressed comments by sharadb-amazon * Fix iOS app crash due to null cpp cluster --- .../MatterTvCastingBridge/MCEndpoint.mm | 72 ++++++++++++++----- ...ionBasicReadVendorIDExampleViewModel.swift | 2 +- ...entLauncherLaunchURLExampleViewModel.swift | 2 +- ...scribeToCurrentStateExampleViewModel.swift | 2 +- .../linux/simple-app-helper.cpp | 2 +- .../tv-casting-common/core/BaseCluster.h | 20 +++++- .../tv-casting-common/core/CastingPlayer.cpp | 35 +++++++-- .../tv-casting-common/core/CastingPlayer.h | 42 ++++++++--- .../core/CommissionerDeclarationHandler.cpp | 39 +++++++++- .../tv-casting-common/core/Endpoint.cpp | 4 +- .../tv-casting-common/core/Endpoint.h | 3 + .../support/CastingStore.cpp | 14 +++- .../support/EndpointListLoader.cpp | 9 ++- 13 files changed, 199 insertions(+), 47 deletions(-) diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MCEndpoint.mm b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MCEndpoint.mm index 24b5c8639aa6e2..5b26e1575e6177 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MCEndpoint.mm +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MCEndpoint.mm @@ -90,27 +90,67 @@ - (MCCastingPlayer * _Nonnull)castingPlayer - (MCCluster * _Nullable)clusterForType:(MCEndpointClusterType)type { switch (type) { - case MCEndpointClusterTypeApplicationBasic: - return [[MCApplicationBasicCluster alloc] initWithCppCluster:_cppEndpoint->GetCluster()]; - - case MCEndpointClusterTypeApplicationLauncher: - return [[MCApplicationLauncherCluster alloc] initWithCppCluster:_cppEndpoint->GetCluster()]; - - case MCEndpointClusterTypeContentLauncher: - return [[MCContentLauncherCluster alloc] initWithCppCluster:_cppEndpoint->GetCluster()]; + case MCEndpointClusterTypeApplicationBasic: { + auto cppCluster = _cppEndpoint->GetCluster(); + if (cppCluster == nullptr) { + ChipLogError(AppServer, "MCEndpoint::clusterForType() MCEndpointClusterTypeApplicationBasic, GetCluster() returned nullptr"); + return nil; + } + return [[MCApplicationBasicCluster alloc] initWithCppCluster:cppCluster]; + } - case MCEndpointClusterTypeKeypadInput: - return [[MCKeypadInputCluster alloc] initWithCppCluster:_cppEndpoint->GetCluster()]; + case MCEndpointClusterTypeApplicationLauncher: { + auto cppCluster = _cppEndpoint->GetCluster(); + if (cppCluster == nullptr) { + ChipLogError(AppServer, "MCEndpoint::clusterForType() MCEndpointClusterTypeApplicationLauncher GetCluster() returned nullptr"); + return nil; + } + return [[MCApplicationLauncherCluster alloc] initWithCppCluster:cppCluster]; + } - case MCEndpointClusterTypeMediaPlayback: - return [[MCMediaPlaybackCluster alloc] initWithCppCluster:_cppEndpoint->GetCluster()]; + case MCEndpointClusterTypeContentLauncher: { + auto cppCluster = _cppEndpoint->GetCluster(); + if (cppCluster == nullptr) { + ChipLogError(AppServer, "MCEndpoint::clusterForType() MCEndpointClusterTypeContentLauncher GetCluster() returned nullptr"); + return nil; + } + return [[MCContentLauncherCluster alloc] initWithCppCluster:cppCluster]; + } - case MCEndpointClusterTypeOnOff: - return [[MCOnOffCluster alloc] initWithCppCluster:_cppEndpoint->GetCluster()]; + case MCEndpointClusterTypeKeypadInput: { + auto cppCluster = _cppEndpoint->GetCluster(); + if (cppCluster == nullptr) { + ChipLogError(AppServer, "MCEndpoint::clusterForType() MCEndpointClusterTypeKeypadInput GetCluster() returned nullptr"); + return nil; + } + return [[MCKeypadInputCluster alloc] initWithCppCluster:cppCluster]; + } - case MCEndpointClusterTypeTargetNavigator: - return [[MCTargetNavigatorCluster alloc] initWithCppCluster:_cppEndpoint->GetCluster()]; + case MCEndpointClusterTypeMediaPlayback: { + auto cppCluster = _cppEndpoint->GetCluster(); + if (cppCluster == nullptr) { + ChipLogError(AppServer, "MCEndpoint::clusterForType() MCEndpointClusterTypeMediaPlayback GetCluster() returned nullptr"); + return nil; + } + return [[MCMediaPlaybackCluster alloc] initWithCppCluster:cppCluster]; + } + case MCEndpointClusterTypeOnOff: { + auto cppCluster = _cppEndpoint->GetCluster(); + if (cppCluster == nullptr) { + ChipLogError(AppServer, "MCEndpoint::clusterForType() MCEndpointClusterTypeOnOff GetCluster() returned nullptr"); + return nil; + } + return [[MCOnOffCluster alloc] initWithCppCluster:cppCluster]; + } + case MCEndpointClusterTypeTargetNavigator: { + auto cppCluster = _cppEndpoint->GetCluster(); + if (cppCluster == nullptr) { + ChipLogError(AppServer, "MCEndpoint::clusterForType() MCEndpointClusterTypeTargetNavigator GetCluster() returned nullptr"); + return nil; + } + return [[MCTargetNavigatorCluster alloc] initWithCppCluster:cppCluster]; + } default: ChipLogError(AppServer, "MCEndpointClusterType not found"); break; diff --git a/examples/tv-casting-app/darwin/TvCasting/TvCasting/MCApplicationBasicReadVendorIDExampleViewModel.swift b/examples/tv-casting-app/darwin/TvCasting/TvCasting/MCApplicationBasicReadVendorIDExampleViewModel.swift index a95580f5aaf7cd..3efed6baa1289a 100644 --- a/examples/tv-casting-app/darwin/TvCasting/TvCasting/MCApplicationBasicReadVendorIDExampleViewModel.swift +++ b/examples/tv-casting-app/darwin/TvCasting/TvCasting/MCApplicationBasicReadVendorIDExampleViewModel.swift @@ -47,7 +47,7 @@ class MCApplicationBasicReadVendorIDExampleViewModel: ObservableObject { // validate that the selected endpoint supports the ApplicationBasic cluster if(!endpoint.hasCluster(MCEndpointClusterTypeApplicationBasic)) { - self.Log.error("No ApplicationBasic cluster supporting endpoint found") + self.Log.error("MCApplicationBasicReadVendorIDExampleViewModel.read() No ApplicationBasic cluster supporting endpoint found") DispatchQueue.main.async { self.status = "No ApplicationBasic cluster supporting endpoint found" diff --git a/examples/tv-casting-app/darwin/TvCasting/TvCasting/MCContentLauncherLaunchURLExampleViewModel.swift b/examples/tv-casting-app/darwin/TvCasting/TvCasting/MCContentLauncherLaunchURLExampleViewModel.swift index aaf18375bb2c82..7f337ed473eb94 100644 --- a/examples/tv-casting-app/darwin/TvCasting/TvCasting/MCContentLauncherLaunchURLExampleViewModel.swift +++ b/examples/tv-casting-app/darwin/TvCasting/TvCasting/MCContentLauncherLaunchURLExampleViewModel.swift @@ -47,7 +47,7 @@ class MCContentLauncherLaunchURLExampleViewModel: ObservableObject { // validate that the selected endpoint supports the ContentLauncher cluster if(!endpoint.hasCluster(MCEndpointClusterTypeContentLauncher)) { - self.Log.error("No ContentLauncher cluster supporting endpoint found") + self.Log.error("MCContentLauncherLaunchURLExampleViewModel.invokeCommand() No ContentLauncher cluster supporting endpoint found") DispatchQueue.main.async { self.status = "No ContentLauncher cluster supporting endpoint found" diff --git a/examples/tv-casting-app/darwin/TvCasting/TvCasting/MCMediaPlaybackSubscribeToCurrentStateExampleViewModel.swift b/examples/tv-casting-app/darwin/TvCasting/TvCasting/MCMediaPlaybackSubscribeToCurrentStateExampleViewModel.swift index 7a4752431e1846..e699240c49af6c 100644 --- a/examples/tv-casting-app/darwin/TvCasting/TvCasting/MCMediaPlaybackSubscribeToCurrentStateExampleViewModel.swift +++ b/examples/tv-casting-app/darwin/TvCasting/TvCasting/MCMediaPlaybackSubscribeToCurrentStateExampleViewModel.swift @@ -47,7 +47,7 @@ class MCMediaPlaybackSubscribeToCurrentStateExampleViewModel: ObservableObject { // validate that the selected endpoint supports the MediaPlayback cluster if(!endpoint.hasCluster(MCEndpointClusterTypeMediaPlayback)) { - self.Log.error("No MediaPlayback cluster supporting endpoint found") + self.Log.error("MCMediaPlaybackSubscribeToCurrentStateExampleViewModel.subscribe() No MediaPlayback cluster supporting endpoint found") DispatchQueue.main.async { self.status = "No MediaPlayback cluster supporting endpoint found" diff --git a/examples/tv-casting-app/linux/simple-app-helper.cpp b/examples/tv-casting-app/linux/simple-app-helper.cpp index ac60b7fb4740f4..115fe9f7869fc9 100644 --- a/examples/tv-casting-app/linux/simple-app-helper.cpp +++ b/examples/tv-casting-app/linux/simple-app-helper.cpp @@ -267,7 +267,7 @@ void ConnectionHandler(CHIP_ERROR err, matter::casting::core::CastingPlayer * ca // For a connection failure, called back with an error and nullptr. VerifyOrReturn( err == CHIP_NO_ERROR, - ChipLogProgress( + ChipLogError( AppServer, "simple-app-helper.cpp::ConnectionHandler(): Failed to connect to CastingPlayer (ID: %s) with err %" CHIP_ERROR_FORMAT, targetCastingPlayer->GetId(), err.Format())); diff --git a/examples/tv-casting-app/tv-casting-common/core/BaseCluster.h b/examples/tv-casting-app/tv-casting-common/core/BaseCluster.h index e98f690cee0087..059bb55ad19800 100644 --- a/examples/tv-casting-app/tv-casting-common/core/BaseCluster.h +++ b/examples/tv-casting-app/tv-casting-common/core/BaseCluster.h @@ -58,12 +58,28 @@ class BaseCluster /** * @return Pointer to the Attribute registered in this cluster, corresponding to attributeId */ - void * GetAttribute(const chip::AttributeId attributeId) { return mAttributes[attributeId]; } + void * GetAttribute(const chip::AttributeId attributeId) + { + if (mAttributes.empty()) + { + ChipLogError(AppServer, "BaseCluster::GetAttribute() mAttributes is empty"); + return nullptr; + } + return mAttributes[attributeId]; + } /** * @return Pointer to the Command registered in this cluster, corresponding to commandId */ - void * GetCommand(const chip::CommandId commandId) { return mCommands[commandId]; } + void * GetCommand(const chip::CommandId commandId) + { + if (mCommands.empty()) + { + ChipLogError(AppServer, "BaseCluster::GetCommand() mCommands is empty"); + return nullptr; + } + return mCommands[commandId]; + } protected: /** diff --git a/examples/tv-casting-app/tv-casting-common/core/CastingPlayer.cpp b/examples/tv-casting-app/tv-casting-common/core/CastingPlayer.cpp index e02e6e7c6946c9..83fc6b4b563a9e 100644 --- a/examples/tv-casting-app/tv-casting-common/core/CastingPlayer.cpp +++ b/examples/tv-casting-app/tv-casting-common/core/CastingPlayer.cpp @@ -68,12 +68,14 @@ void CastingPlayer::VerifyOrEstablishConnection(ConnectionCallbacks connectionCa // Set the callback for handling CommissionerDeclaration messages. matter::casting::core::CommissionerDeclarationHandler::GetInstance()->SetCommissionerDeclarationCallback( connectionCallbacks.mCommissionerDeclarationCallback); + mClientProvidedCommissionerDeclarationCallback = true; } else { ChipLogProgress( AppServer, "CastingPlayer::VerifyOrEstablishConnection() CommissionerDeclarationCallback not provided in ConnectionCallbacks"); + mClientProvidedCommissionerDeclarationCallback = false; } ChipLogProgress(AppServer, "CastingPlayer::VerifyOrEstablishConnection() verifying User Directed Commissioning (UDC) state"); @@ -107,6 +109,7 @@ void CastingPlayer::VerifyOrEstablishConnection(ConnectionCallbacks connectionCa // found the CastingPlayer in cache if (it != cachedCastingPlayers.end()) { + ChipLogProgress(AppServer, "CastingPlayer::VerifyOrEstablishConnection() found this CastingPlayer in app cache"); unsigned index = (unsigned int) std::distance(cachedCastingPlayers.begin(), it); if (ContainsDesiredTargetApp(&cachedCastingPlayers[index], idOptions.getTargetAppInfoList())) { @@ -225,16 +228,24 @@ CHIP_ERROR CastingPlayer::ContinueConnecting() CHIP_ERROR CastingPlayer::StopConnecting() { - ChipLogProgress(AppServer, "CastingPlayer::StopConnecting() called, while ChipDeviceEventHandler.sUdcInProgress: %s", - support::ChipDeviceEventHandler::isUdcInProgress() ? "true" : "false"); - VerifyOrReturnValue(mConnectionState == CASTING_PLAYER_CONNECTING, CHIP_ERROR_INCORRECT_STATE, - ChipLogError(AppServer, "CastingPlayer::StopConnecting() called while not in connecting state");); VerifyOrReturnValue( mIdOptions.mCommissionerPasscode, CHIP_ERROR_INCORRECT_STATE, ChipLogError(AppServer, "CastingPlayer::StopConnecting() mIdOptions.mCommissionerPasscode == false, ContinueConnecting() should only " "be called when the CastingPlayer/Commissioner-Generated passcode commissioning flow is in progress.");); + // Calling the internal StopConnecting() API with the shouldSendIdentificationDeclarationMessage set to true to notify the + // CastingPlayer/Commissioner that the commissioning session was cancelled by the Casting Client/Commissionee user. This will + // result in the Casting Client/Commissionee sending a CancelPasscode IdentificationDeclaration message to the CastingPlayer. + // shouldSendIdentificationDeclarationMessage is true when StopConnecting() is called by the Client. + return this->StopConnecting(true); +} +CHIP_ERROR CastingPlayer::StopConnecting(bool shouldSendIdentificationDeclarationMessage) +{ + ChipLogProgress(AppServer, "CastingPlayer::StopConnecting() called, while ChipDeviceEventHandler.sUdcInProgress: %s", + support::ChipDeviceEventHandler::isUdcInProgress() ? "true" : "false"); + VerifyOrReturnValue(mConnectionState == CASTING_PLAYER_CONNECTING, CHIP_ERROR_INCORRECT_STATE, + ChipLogError(AppServer, "CastingPlayer::StopConnecting() called while not in connecting state");); CHIP_ERROR err = CHIP_NO_ERROR; mIdOptions.resetState(); mIdOptions.mCancelPasscode = true; @@ -243,6 +254,16 @@ CHIP_ERROR CastingPlayer::StopConnecting() mTargetCastingPlayer.reset(); CastingPlayerDiscovery::GetInstance()->ClearCastingPlayersInternal(); + if (!shouldSendIdentificationDeclarationMessage) + { + ChipLogProgress(AppServer, + "CastingPlayer::StopConnecting() shouldSendIdentificationDeclarationMessage: %d, User Directed " + "Commissioning aborted by the CastingPlayer/Commissioner user.", + shouldSendIdentificationDeclarationMessage); + resetState(CHIP_ERROR_CONNECTION_ABORTED); + return err; + } + // If a CastingPlayer::ContinueConnecting() error occurs, StopConnecting() can be called while sUdcInProgress == true. // sUdcInProgress should be set to false before sending the CancelPasscode IdentificationDeclaration message to the // CastingPlayer/Commissioner. @@ -251,9 +272,9 @@ CHIP_ERROR CastingPlayer::StopConnecting() support::ChipDeviceEventHandler::SetUdcStatus(false); } - ChipLogProgress( - AppServer, - "CastingPlayer::StopConnecting() calling SendUserDirectedCommissioningRequest() to indicate user canceled passcode entry"); + ChipLogProgress(AppServer, + "CastingPlayer::StopConnecting() calling SendUserDirectedCommissioningRequest() to indicate " + "Client/Commissionee user canceled passcode entry"); #if CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT err = SendUserDirectedCommissioningRequest(); if (err != CHIP_NO_ERROR) diff --git a/examples/tv-casting-app/tv-casting-common/core/CastingPlayer.h b/examples/tv-casting-app/tv-casting-common/core/CastingPlayer.h index 4fcb1ea5ca60da..b2422b43f5dee6 100644 --- a/examples/tv-casting-app/tv-casting-common/core/CastingPlayer.h +++ b/examples/tv-casting-app/tv-casting-common/core/CastingPlayer.h @@ -102,16 +102,11 @@ class CastingPlayer : public std::enable_shared_from_this */ static CastingPlayer * GetTargetCastingPlayer() { - ChipLogProgress(AppServer, "CastingPlayer::GetTargetCastingPlayer() called"); std::shared_ptr sharedPtr = mTargetCastingPlayer.lock(); CastingPlayer * rawPtr = nullptr; if (sharedPtr) { rawPtr = sharedPtr.get(); - ChipLogProgress( - AppServer, - "CastingPlayer::GetTargetCastingPlayer() Got rawPtr from mTargetCastingPlayer, sharedPtr reference count: %lu", - sharedPtr.use_count()); sharedPtr.reset(); } else @@ -207,12 +202,14 @@ class CastingPlayer : public std::enable_shared_from_this /** * @brief This cancels the CastingPlayer/Commissioner-Generated passcode commissioning flow started via the * VerifyOrEstablishConnection() API above. It constructs and sends an IdentificationDeclaration message to the - * CastingPlayer/Commissioner containing CancelPasscode set to true. It is used to indicate that the user, and thus the - * Client/Commissionee, have cancelled the commissioning process. This indicates that the CastingPlayer/Commissioner can dismiss - * any dialogs corresponding to commissioning, such as a Passcode input dialog or a Passcode display dialog. - * Note: stopConnecting() does not call the ConnectCallback() callback passed to the VerifyOrEstablishConnection() API above - * since no connection is established. - * @return CHIP_NO_ERROR if this function was called with the CastingPlayer in the correct state and an error otherwise. + * CastingPlayer/Commissioner containing CancelPasscode set to true. It is used to indicate that the Client/Commissionee user + * has cancelled the commissioning process. This indicates that the CastingPlayer/Commissioner can dismiss any dialogs + * corresponding to commissioning, such as a Passcode input dialog or a Passcode display dialog. Note: StopConnecting() does not + * call the ConnectCallback() callback passed to the VerifyOrEstablishConnection() API above since no connection is established. + * @return CHIP_NO_ERROR if this function was called with the CastingPlayer in the correct state and CHIP_ERROR_INCORRECT_STATE. + * otherwise. StopConnecting() can only be called by the client during the CastingPlayer/Commissioner-Generated passcode + * commissioning flow. Calling StopConnecting() during the Client/Commissionee-Generated commissioning flow will return a + * CHIP_ERROR_INCORRECT_STATE error. */ CHIP_ERROR StopConnecting(); @@ -295,6 +292,28 @@ class CastingPlayer : public std::enable_shared_from_this static memory::Weak mTargetCastingPlayer; uint16_t mCommissioningWindowTimeoutSec = kCommissioningWindowTimeoutSec; ConnectCallback mOnCompleted = {}; + bool mClientProvidedCommissionerDeclarationCallback; + + /** + * @brief This internal version of the StopConnecting API cancels the Client/Commissionee-Generated passcode or the + * CastingPlayer/Commissioner-Generated passcode commissioning flow started via the VerifyOrEstablishConnection() API above. + * Furthermore, StopConnecting operates in two ways as governed by the shouldSendIdentificationDeclarationMessage flag: + * 1. If shouldSendIdentificationDeclarationMessage is true. StopConnecting constructs and sends an IdentificationDeclaration + * message to the CastingPlayer/Commissioner containing CancelPasscode set to true. The CancelPasscode flag set to true conveys + * that the Client/Commissionee user has cancelled the commissioning session. This indicates that the CastingPlayer/Commissioner + * can dismiss any dialogs corresponding to commissioning, such as a Passcode input dialog or a Passcode display dialog. In this + * case, since StopConnecting was called by the Client/Commissionee, StopConnecting() does not call the ConnectCallback() + * callback passed to the VerifyOrEstablishConnection(). + * 2. If shouldSendIdentificationDeclarationMessage is false. StopConnecting does not send an IdentificationDeclaration message + * to the CastingPlayer/Commissioner since the CastingPlayer/Commissioner notified the Client/Commissionee that the connection + * is aborted. If the (Optional) ConnectionCallbacks mCommissionerDeclarationCallback is not set, it calls ConnectionCallbacks + * mOnConnectionComplete callback with CHIP_ERROR_CONNECTION_ABORTED. + * @param shouldSendIdentificationDeclarationMessage if true, send the IdentificationDeclaration message to the CastingPlayer + * with CancelPasscode set to true. If false, only call the ConnectionCallbacks mCommissionerDeclarationCallback callback passed + * to the VerifyOrEstablishConnection() API above, without sending the IdentificationDeclaration message. + * @return CHIP_NO_ERROR if this function was called with the CastingPlayer in the correct state and an error otherwise. + */ + CHIP_ERROR StopConnecting(bool shouldSendIdentificationDeclarationMessage); /** * @brief resets this CastingPlayer's state and calls mOnCompleted with the CHIP_ERROR. Also, after calling mOnCompleted, it @@ -329,6 +348,7 @@ class CastingPlayer : public std::enable_shared_from_this // and connect to a CastingPlayer friend class support::ChipDeviceEventHandler; + friend class CommissionerDeclarationHandler; friend class ConnectionContext; friend class support::EndpointListLoader; }; 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 22e7d49cdb7a5d..c89b899bf5db43 100644 --- a/examples/tv-casting-app/tv-casting-common/core/CommissionerDeclarationHandler.cpp +++ b/examples/tv-casting-app/tv-casting-common/core/CommissionerDeclarationHandler.cpp @@ -18,6 +18,7 @@ #include "CommissionerDeclarationHandler.h" +#include "CastingPlayer.h" #include "Types.h" #include "support/ChipDeviceEventHandler.h" #include @@ -50,6 +51,39 @@ void CommissionerDeclarationHandler::OnCommissionerDeclarationMessage( 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()) + { + ChipLogProgress(AppServer, + "CommissionerDeclarationHandler::OnCommissionerDeclarationMessage(), Got CancelPasscode parameter, " + "CastingPlayer/Commissioner user has decided to exit the commissioning attempt. Connection aborted."); + // 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 + // CastingPlayer/Commissioner user and the Casting Client/Commissionee user are not necessarily the same user. For example, + // in an enviroment with multiple CastingPlayer/Commissioner TVs, one user 1 might be controlling the Client/Commissionee + // 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 + { + CHIP_ERROR err = targetCastingPlayer->StopConnecting(false); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + AppServer, + "CommissionerDeclarationHandler::OnCommissionerDeclarationMessage() StopConnecting() failed due to error: " + "%" CHIP_ERROR_FORMAT, + err.Format()); + } + } + } + if (mCmmissionerDeclarationCallback_) { mCmmissionerDeclarationCallback_(source, cd); @@ -65,7 +99,10 @@ void CommissionerDeclarationHandler::SetCommissionerDeclarationCallback( matter::casting::core::CommissionerDeclarationCallback callback) { ChipLogProgress(AppServer, "CommissionerDeclarationHandler::SetCommissionerDeclarationCallback()"); - mCmmissionerDeclarationCallback_ = std::move(callback); + if (callback != nullptr) + { + mCmmissionerDeclarationCallback_ = std::move(callback); + } } } // namespace core diff --git a/examples/tv-casting-app/tv-casting-common/core/Endpoint.cpp b/examples/tv-casting-app/tv-casting-common/core/Endpoint.cpp index d2fb12e48daf68..25b9e2850edb56 100644 --- a/examples/tv-casting-app/tv-casting-common/core/Endpoint.cpp +++ b/examples/tv-casting-app/tv-casting-common/core/Endpoint.cpp @@ -28,6 +28,7 @@ void Endpoint::RegisterClusters(std::vector clusters) { for (chip::ClusterId clusterId : clusters) { + ChipLogProgress(AppServer, "Endpoint::RegisterClusters() Registering clusterId %d for endpointId %d", clusterId, GetId()); switch (clusterId) { case chip::app::Clusters::ApplicationBasic::Id: @@ -67,7 +68,8 @@ void Endpoint::RegisterClusters(std::vector clusters) break; default: - ChipLogProgress(AppServer, "Skipping registration of clusterId %d for endpointId %d", clusterId, GetId()); + ChipLogProgress(AppServer, "Endpoint::RegisterClusters() Skipping registration of clusterId %d for endpointId %d", + clusterId, GetId()); break; } } diff --git a/examples/tv-casting-app/tv-casting-common/core/Endpoint.h b/examples/tv-casting-app/tv-casting-common/core/Endpoint.h index fc18267cf466be..734f1e3d5ae140 100644 --- a/examples/tv-casting-app/tv-casting-common/core/Endpoint.h +++ b/examples/tv-casting-app/tv-casting-common/core/Endpoint.h @@ -105,6 +105,7 @@ class Endpoint : public std::enable_shared_from_this */ std::vector GetServerList() { + ChipLogProgress(AppServer, "Endpoint::GetServerList() mClusters.size(): %d", static_cast(mClusters.size())); std::vector serverList; for (auto const & cluster : mClusters) { @@ -122,6 +123,7 @@ class Endpoint : public std::enable_shared_from_this template void RegisterCluster(const chip::ClusterId clusterId) { + ChipLogProgress(AppServer, "Endpoint::RegisterCluster() Registering clusterId %d for endpointId %d", clusterId, GetId()); static_assert(std::is_base_of::value, "T must be derived from BaseCluster"); auto cluster = std::make_shared(shared_from_this()); cluster->SetUp(); @@ -135,6 +137,7 @@ class Endpoint : public std::enable_shared_from_this memory::Strong GetCluster() { static_assert(std::is_base_of::value, "T must be derived from BaseCluster"); + ChipLogProgress(AppServer, "Endpoint::GetCluster() mClusters.size(): %d", static_cast(mClusters.size())); for (const auto & pair : mClusters) { auto cluster = std::dynamic_pointer_cast(pair.second); diff --git a/examples/tv-casting-app/tv-casting-common/support/CastingStore.cpp b/examples/tv-casting-app/tv-casting-common/support/CastingStore.cpp index 2e8561d2e5aab1..93bd00616dac6c 100644 --- a/examples/tv-casting-app/tv-casting-common/support/CastingStore.cpp +++ b/examples/tv-casting-app/tv-casting-common/support/CastingStore.cpp @@ -427,9 +427,14 @@ std::vector CastingStore::ReadAll() for (auto & endpointAttributes : endpointAttributesList) { std::shared_ptr endpoint(new core::Endpoint(castingPlayer, endpointAttributes)); + ChipLogProgress(AppServer, "CastingStore::ReadAll() endpointServerListMap[endpointAttributes.mId].size(): %d", + static_cast(endpointServerListMap[endpointAttributes.mId].size())); endpoint->RegisterClusters(endpointServerListMap[endpointAttributes.mId]); castingPlayer->RegisterEndpoint(endpoint); + ChipLogProgress(AppServer, "CastingStore::ReadAll() Registered endpointID: %d", endpoint->GetId()); } + ChipLogProgress(AppServer, "CastingStore::ReadAll() Created CastingPlayer with deviceName: %s", + castingPlayer->GetDeviceName()); castingPlayers.push_back(*castingPlayer); continue; } @@ -453,7 +458,7 @@ std::vector CastingStore::ReadAll() CHIP_ERROR CastingStore::WriteAll(std::vector castingPlayers) { - ChipLogProgress(AppServer, "CastingStore::WriteAll called"); + ChipLogProgress(AppServer, "CastingStore::WriteAll() called"); chip::TLV::TLVWriter tlvWriter; uint8_t castingStoreData[kCastingStoreDataMaxBytes]; @@ -470,6 +475,7 @@ CHIP_ERROR CastingStore::WriteAll(std::vector castingPlayer for (auto & castingPlayer : castingPlayers) { + ChipLogProgress(AppServer, "CastingStore::WriteAll() writing castingPlayer:"); chip::TLV::TLVType castingPlayerContainerType; // CastingPlayer container starts ReturnErrorOnFailure( @@ -502,6 +508,8 @@ CHIP_ERROR CastingStore::WriteAll(std::vector castingPlayer std::vector> endpoints = core::CastingPlayer::GetTargetCastingPlayer()->GetEndpoints(); for (auto & endpoint : endpoints) { + ChipLogProgress(AppServer, "CastingStore::WriteAll() writing CastingPlayer Endpoint with endpointId: %d", + endpoint->GetId()); chip::TLV::TLVType endpointContainerType; // Endpoint container starts ReturnErrorOnFailure( @@ -539,8 +547,10 @@ CHIP_ERROR CastingStore::WriteAll(std::vector castingPlayer ReturnErrorOnFailure(tlvWriter.StartContainer(chip::TLV::ContextTag(kCastingPlayerEndpointServerListContainerTag), chip::TLV::kTLVType_Structure, serverListContainerType)); std::vector serverList = endpoint->GetServerList(); + ChipLogProgress(AppServer, "CastingStore::WriteAll() writing CastingPlayer Endpoint ServerList:"); for (chip::ClusterId clusterId : serverList) { + ChipLogProgress(AppServer, "CastingStore::WriteAll() clusterId: %d", clusterId); ReturnErrorOnFailure(tlvWriter.Put(chip::TLV::ContextTag(kCastingPlayerEndpointServerClusterIdTag), clusterId)); } // ServerList container ends @@ -562,7 +572,7 @@ CHIP_ERROR CastingStore::WriteAll(std::vector castingPlayer ReturnErrorOnFailure(tlvWriter.Finalize()); ChipLogProgress(AppServer, - "CastingStore::WriteAll TLV(CastingStoreData).LengthWritten: %d bytes, CastingPlayers size: %lu " + "CastingStore::WriteAll() TLV(CastingStoreData).LengthWritten: %d bytes, CastingPlayers size: %lu " "and version: %d", tlvWriter.GetLengthWritten(), static_cast(castingPlayers.size()), kCurrentCastingStoreDataVersion); diff --git a/examples/tv-casting-app/tv-casting-common/support/EndpointListLoader.cpp b/examples/tv-casting-app/tv-casting-common/support/EndpointListLoader.cpp index a7bbfb78d6ad3a..7d32456ad534fc 100644 --- a/examples/tv-casting-app/tv-casting-common/support/EndpointListLoader.cpp +++ b/examples/tv-casting-app/tv-casting-common/support/EndpointListLoader.cpp @@ -90,7 +90,8 @@ CHIP_ERROR EndpointListLoader::Load() if (binding.type == MATTER_UNICAST_BINDING && CastingPlayer::GetTargetCastingPlayer()->GetNodeId() == binding.nodeId) { // if we discovered a new Endpoint from the bindings, read its EndpointAttributes - chip::EndpointId endpointId = binding.remote; + chip::EndpointId endpointId = binding.remote; + ChipLogProgress(AppServer, "EndpointListLoader::Load() Found new endpointId: %d", endpointId); std::vector> endpoints = CastingPlayer::GetTargetCastingPlayer()->GetEndpoints(); if (std::find_if(endpoints.begin(), endpoints.end(), [&endpointId](const memory::Strong & endpoint) { return endpoint->GetId() == endpointId; @@ -128,17 +129,19 @@ void EndpointListLoader::Complete() if (mPendingAttributeReads == 0) { - ChipLogProgress(AppServer, "EndpointListLoader::Complete Loading %lu endpoint(s)", mNewEndpointsToLoad); + ChipLogProgress(AppServer, "EndpointListLoader::Complete() Loading %lu endpoint(s)", mNewEndpointsToLoad); for (unsigned long i = 0; i < mNewEndpointsToLoad; i++) { EndpointAttributes endpointAttributes = mEndpointAttributesList[i]; std::shared_ptr endpoint = std::make_shared(CastingPlayer::GetTargetCastingPlayer(), endpointAttributes); + ChipLogProgress(AppServer, "EndpointListLoader::Complete() mEndpointServerLists[i].size: %lu ", + mEndpointServerLists[i].size()); endpoint->RegisterClusters(mEndpointServerLists[i]); CastingPlayer::GetTargetCastingPlayer()->RegisterEndpoint(endpoint); } - ChipLogProgress(AppServer, "EndpointListLoader::Complete finished Loading %lu endpoints", mNewEndpointsToLoad); + ChipLogProgress(AppServer, "EndpointListLoader::Complete() Finished Loading %lu endpoints", mNewEndpointsToLoad); // TODO cleanup // delete mEndpointAttributesList; From 2bdbc7614fcc513303f469c601f9f3ed9f95f4e0 Mon Sep 17 00:00:00 2001 From: Amine Alami <43780877+Alami-Amine@users.noreply.github.com> Date: Thu, 5 Sep 2024 20:43:16 +0200 Subject: [PATCH 06/42] [Fuzzing] Adding all-clusters-app fuzz test to OSS-Fuzz (#35408) * Added a base38 rountrip Fuzzer to fuzz the encoding and decoding in base38 Added a base38 decoder Fuzzer to fuzz the function decoding base38 strings Added a dependancy in TLV-Reader config to correct the build error * adding all clusters * Restyled by gn * Moving this back * Restyled by gn * Update src/setup_payload/tests/FuzzBase38.cpp Co-authored-by: Boris Zbarsky * Update src/setup_payload/tests/FuzzBase38.cpp Co-authored-by: Boris Zbarsky * Update src/setup_payload/tests/FuzzBase38.cpp Co-authored-by: Boris Zbarsky * Removing this * Updating * Update src/setup_payload/tests/FuzzBase38Decode.cpp Co-authored-by: Boris Zbarsky * restrict activation of enable_fuzz_test_targets --------- Co-authored-by: Justin Wood Co-authored-by: Restyled.io Co-authored-by: Boris Zbarsky --- BUILD.gn | 1 + build/chip/fuzz_test.gni | 7 +++++-- examples/all-clusters-app/linux/BUILD.gn | 11 +++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 4efa25007aa523..9a0654a5dfc0aa 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -52,6 +52,7 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") { if (enable_fuzz_test_targets) { group("fuzz_tests") { deps = [ + "${chip_root}/examples/all-clusters-app/linux:fuzz-chip-all-clusters-app", "${chip_root}/src/credentials/tests:fuzz-chip-cert", "${chip_root}/src/lib/core/tests:fuzz-tlv-reader", "${chip_root}/src/lib/dnssd/minimal_mdns/tests:fuzz-minmdns-packet-parsing", diff --git a/build/chip/fuzz_test.gni b/build/chip/fuzz_test.gni index 98def1dab0463d..b48c3182b1b724 100644 --- a/build/chip/fuzz_test.gni +++ b/build/chip/fuzz_test.gni @@ -21,9 +21,12 @@ import("${chip_root}/build/chip/tests.gni") import("${dir_pw_unit_test}/test.gni") declare_args() { - enable_fuzz_test_targets = is_clang && chip_build_tests && - (current_os == "linux" || current_os == "mac") + #Fuzz testing using libfuzzer + enable_fuzz_test_targets = + (is_libfuzzer || oss_fuzz) && is_clang && chip_build_tests && + (current_os == "linux" || current_os == "mac") + #Fuzz testing using pw_fuzzer and FuzzTest Framework pw_enable_fuzz_test_targets = false } diff --git a/examples/all-clusters-app/linux/BUILD.gn b/examples/all-clusters-app/linux/BUILD.gn index 5c61b4db461942..0e16c64c41de13 100644 --- a/examples/all-clusters-app/linux/BUILD.gn +++ b/examples/all-clusters-app/linux/BUILD.gn @@ -19,6 +19,7 @@ import("${build_root}/config/compiler/compiler.gni") import("${chip_root}/src/lib/lib.gni") import("${chip_root}/src/platform/device.gni") +import("${chip_root}/build/chip/fuzz_test.gni") import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") if (chip_enable_pw_rpc) { @@ -201,3 +202,13 @@ group("linux") { group("default") { deps = [ ":linux" ] } + +if (enable_fuzz_test_targets) { + chip_fuzz_target("fuzz-chip-all-clusters-app") { + sources = [ "fuzzing-main.cpp" ] + public_deps = [ + ":chip-all-clusters-common", + "${chip_root}/examples/platform/linux:app-main", + ] + } +} From 7219ad2f5a0d93157b4d5b6d9f646801e4ee785b Mon Sep 17 00:00:00 2001 From: Philip Gregor <147669098+pgregorr-amazon@users.noreply.github.com> Date: Thu, 5 Sep 2024 16:46:01 -0400 Subject: [PATCH 07/42] Fixing 32-bit vs 64-bit size() log format issue (#35432) --- .../tv-casting-common/support/EndpointListLoader.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/tv-casting-app/tv-casting-common/support/EndpointListLoader.cpp b/examples/tv-casting-app/tv-casting-common/support/EndpointListLoader.cpp index 7d32456ad534fc..44e76f628b5a18 100644 --- a/examples/tv-casting-app/tv-casting-common/support/EndpointListLoader.cpp +++ b/examples/tv-casting-app/tv-casting-common/support/EndpointListLoader.cpp @@ -135,8 +135,8 @@ void EndpointListLoader::Complete() EndpointAttributes endpointAttributes = mEndpointAttributesList[i]; std::shared_ptr endpoint = std::make_shared(CastingPlayer::GetTargetCastingPlayer(), endpointAttributes); - ChipLogProgress(AppServer, "EndpointListLoader::Complete() mEndpointServerLists[i].size: %lu ", - mEndpointServerLists[i].size()); + ChipLogProgress(AppServer, "EndpointListLoader::Complete() mEndpointServerLists[i].size: %lu", + static_cast(mEndpointServerLists[i].size())); endpoint->RegisterClusters(mEndpointServerLists[i]); CastingPlayer::GetTargetCastingPlayer()->RegisterEndpoint(endpoint); } From ae414315832c6e8711cf8bfa83397a8402a4d875 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 5 Sep 2024 18:10:25 -0400 Subject: [PATCH 08/42] Add a suspend/resume API on MTRDeviceController. (#35434) This allows controllers to be suspended temporarily without having to shut them down completely and restart them. --- .../Framework/CHIP/MTRDeviceController.h | 23 +++++++++++ .../Framework/CHIP/MTRDeviceController.mm | 41 +++++++++++++++++-- .../CHIP/MTRDeviceControllerFactory.mm | 5 ++- .../CHIP/MTRDeviceControllerParameters.h | 7 ++++ .../CHIP/MTRDeviceControllerStartupParams.mm | 8 +++- .../CHIP/MTRDeviceController_Concrete.mm | 3 +- .../CHIP/MTRDeviceController_Internal.h | 5 ++- .../Framework/CHIP/MTRDeviceController_XPC.h | 1 - .../Framework/CHIP/MTRDeviceController_XPC.mm | 32 +++++++++------ 9 files changed, 104 insertions(+), 21 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.h b/src/darwin/Framework/CHIP/MTRDeviceController.h index 9e2c833f6ef93b..ad025c87d64043 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.h +++ b/src/darwin/Framework/CHIP/MTRDeviceController.h @@ -65,6 +65,11 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) */ @property (readonly, nonatomic, getter=isRunning) BOOL running; +/** + * If true, the controller has been suspended via `suspend` and not resumed yet. + */ +@property (readonly, nonatomic, getter=isSuspended) BOOL suspended MTR_NEWLY_AVAILABLE; + /** * The ID assigned to this controller at creation time. */ @@ -253,6 +258,24 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) error:(NSError * __autoreleasing *)error MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); +/** + * Suspend the controller. This will attempt to stop all network traffic associated + * with the controller. The controller will remain suspended until it is + * resumed. + * + * Suspending an already-suspended controller has no effect. + */ +- (void)suspend MTR_NEWLY_AVAILABLE; + +/** + * Resume the controller. This has no effect if the controller is not + * suspended. + * + * A resume following any number of suspend calls will resume the controller; + * there does not need to be a resume call to match every suspend call. + */ +- (void)resume MTR_NEWLY_AVAILABLE; + /** * Shut down the controller. Calls to shutdown after the first one are NO-OPs. * This must be called, either directly or via shutting down the diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm index 650aba4b24a700..f6dc54fbc1dd19 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm @@ -131,6 +131,8 @@ @implementation MTRDeviceController { MTRP256KeypairBridge _signingKeypairBridge; MTRP256KeypairBridge _operationalKeypairBridge; + BOOL _suspended; + // Counters to track assertion status and access controlled by the _assertionLock NSUInteger _keepRunningAssertionCounter; BOOL _shutdownPending; @@ -142,7 +144,7 @@ - (os_unfair_lock_t)deviceMapLock return &_underlyingDeviceMapLock; } -- (instancetype)initForSubclasses +- (instancetype)initForSubclasses:(BOOL)startSuspended { if (self = [super init]) { // nothing, as superclass of MTRDeviceController is NSObject @@ -153,15 +155,17 @@ - (instancetype)initForSubclasses _keepRunningAssertionCounter = 0; _shutdownPending = NO; _assertionLock = OS_UNFAIR_LOCK_INIT; + + _suspended = startSuspended; + return self; } - (nullable MTRDeviceController *)initWithParameters:(MTRDeviceControllerAbstractParameters *)parameters error:(NSError * __autoreleasing *)error { if ([parameters isKindOfClass:MTRXPCDeviceControllerParameters.class]) { - MTRXPCDeviceControllerParameters * resolvedParameters = (MTRXPCDeviceControllerParameters *) parameters; MTR_LOG("Starting up with XPC Device Controller Parameters: %@", parameters); - return [[MTRDeviceController_XPC alloc] initWithUniqueIdentifier:resolvedParameters.uniqueIdentifier xpConnectionBlock:resolvedParameters.xpcConnectionBlock]; + return [[MTRDeviceController_XPC alloc] initWithParameters:parameters error:error]; } else if (![parameters isKindOfClass:MTRDeviceControllerParameters.class]) { MTR_LOG_ERROR("Unsupported type of MTRDeviceControllerAbstractParameters: %@", parameters); if (error) { @@ -184,6 +188,7 @@ - (instancetype)initWithFactory:(MTRDeviceControllerFactory *)factory uniqueIdentifier:(NSUUID *)uniqueIdentifier concurrentSubscriptionPoolSize:(NSUInteger)concurrentSubscriptionPoolSize storageBehaviorConfiguration:(MTRDeviceStorageBehaviorConfiguration *)storageBehaviorConfiguration + startSuspended:(BOOL)startSuspended { if (self = [super init]) { // Make sure our storage is all set up to work as early as possible, @@ -195,6 +200,8 @@ - (instancetype)initWithFactory:(MTRDeviceControllerFactory *)factory _shutdownPending = NO; _assertionLock = OS_UNFAIR_LOCK_INIT; + _suspended = startSuspended; + if (storageDelegate != nil) { if (storageDelegateQueue == nil) { MTR_LOG_ERROR("storageDelegate provided without storageDelegateQueue"); @@ -331,6 +338,34 @@ - (BOOL)isRunning return _cppCommissioner != nullptr; } +#pragma mark - Suspend/resume support + +- (BOOL)isSuspended +{ + return _suspended; +} + +- (void)suspend +{ + _suspended = YES; + + // TODO: In the concrete class (which is unused so far!), iterate our + // MTRDevices, tell them to tear down subscriptions. Possibly close all + // CASE sessions for our identity. Possibly try to see whether we can + // change our fabric entry to not advertise and restart advertising. + + // TODO: What should happen with active commissioning sessions? Presumably + // close them? +} + +- (void)resume +{ + _suspended = NO; + + // TODO: In the concrete class (which is unused so far!), iterate our + // MTRDevices, tell them to restart subscriptions. +} + - (BOOL)matchesPendingShutdownControllerWithOperationalCertificate:(nullable MTRCertificateDERBytes)operationalCertificate andRootCertificate:(nullable MTRCertificateDERBytes)rootCertificate { if (!operationalCertificate || !rootCertificate) { diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm index 00b59f525b0f16..e0488f974b13b8 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm @@ -474,6 +474,7 @@ - (MTRDeviceController * _Nullable)_startDeviceController:(MTRDeviceController * dispatch_queue_t _Nullable otaProviderDelegateQueue; NSUInteger concurrentSubscriptionPoolSize = 0; MTRDeviceStorageBehaviorConfiguration * storageBehaviorConfiguration = nil; + BOOL startSuspended = NO; if ([startupParams isKindOfClass:[MTRDeviceControllerParameters class]]) { MTRDeviceControllerParameters * params = startupParams; storageDelegate = params.storageDelegate; @@ -483,6 +484,7 @@ - (MTRDeviceController * _Nullable)_startDeviceController:(MTRDeviceController * otaProviderDelegateQueue = params.otaProviderDelegateQueue; concurrentSubscriptionPoolSize = params.concurrentSubscriptionEstablishmentsAllowedOnThread; storageBehaviorConfiguration = params.storageBehaviorConfiguration; + startSuspended = params.startSuspended; } else if ([startupParams isKindOfClass:[MTRDeviceControllerStartupParams class]]) { MTRDeviceControllerStartupParams * params = startupParams; storageDelegate = nil; @@ -545,7 +547,8 @@ - (MTRDeviceController * _Nullable)_startDeviceController:(MTRDeviceController * otaProviderDelegateQueue:otaProviderDelegateQueue uniqueIdentifier:uniqueIdentifier concurrentSubscriptionPoolSize:concurrentSubscriptionPoolSize - storageBehaviorConfiguration:storageBehaviorConfiguration]; + storageBehaviorConfiguration:storageBehaviorConfiguration + startSuspended:startSuspended]; if (controller == nil) { if (error != nil) { *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INVALID_ARGUMENT]; diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerParameters.h b/src/darwin/Framework/CHIP/MTRDeviceControllerParameters.h index caedc20229eb89..68d725f796a0dd 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerParameters.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerParameters.h @@ -31,6 +31,13 @@ MTR_AVAILABLE(ios(17.6), macos(14.6), watchos(10.6), tvos(17.6)) @interface MTRDeviceControllerAbstractParameters : NSObject - (instancetype)init NS_UNAVAILABLE; + (instancetype)new NS_UNAVAILABLE; + +/** + * Whether the controller should start out suspended. + * + * Defaults to NO. + */ +@property (nonatomic, assign) BOOL startSuspended; @end /** diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm index 5850a8c4efe384..fa2791a908cda7 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm @@ -250,7 +250,13 @@ - (instancetype)initWithOperationalKeypair:(id)operationalKeypair @implementation MTRDeviceControllerAbstractParameters - (instancetype)_initInternal { - return [super init]; + if (!(self = [super init])) { + return nil; + } + + _startSuspended = NO; + + return self; } @end diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm index 0ea7bf9232d766..6e7d056270d1e0 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm @@ -190,8 +190,9 @@ - (instancetype)initWithFactory:(MTRDeviceControllerFactory *)factory uniqueIdentifier:(NSUUID *)uniqueIdentifier concurrentSubscriptionPoolSize:(NSUInteger)concurrentSubscriptionPoolSize storageBehaviorConfiguration:(MTRDeviceStorageBehaviorConfiguration *)storageBehaviorConfiguration + startSuspended:(BOOL)startSuspended { - if (self = [super initForSubclasses]) { + if (self = [super initForSubclasses:startSuspended]) { // Make sure our storage is all set up to work as early as possible, // before we start doing anything else with the controller. _uniqueIdentifier = uniqueIdentifier; diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h b/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h index f37d6fbf08c6d9..5d5acf8063d4c2 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h @@ -73,7 +73,7 @@ NS_ASSUME_NONNULL_BEGIN // (moved here so subclasses can initialize differently) @property (readwrite, retain) dispatch_queue_t chipWorkQueue; -- (instancetype)initForSubclasses; +- (instancetype)initForSubclasses:(BOOL)startSuspended; #pragma mark - MTRDeviceControllerFactory methods @@ -146,7 +146,8 @@ NS_ASSUME_NONNULL_BEGIN otaProviderDelegateQueue:(dispatch_queue_t _Nullable)otaProviderDelegateQueue uniqueIdentifier:(NSUUID *)uniqueIdentifier concurrentSubscriptionPoolSize:(NSUInteger)concurrentSubscriptionPoolSize - storageBehaviorConfiguration:(MTRDeviceStorageBehaviorConfiguration *)storageBehaviorConfiguration; + storageBehaviorConfiguration:(MTRDeviceStorageBehaviorConfiguration *)storageBehaviorConfiguration + startSuspended:(BOOL)startSuspended; /** * Check whether this controller is running on the given fabric, as represented diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_XPC.h b/src/darwin/Framework/CHIP/MTRDeviceController_XPC.h index 574d3eac628f3d..c891c10d726791 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_XPC.h +++ b/src/darwin/Framework/CHIP/MTRDeviceController_XPC.h @@ -23,7 +23,6 @@ NS_ASSUME_NONNULL_BEGIN MTR_TESTABLE @interface MTRDeviceController_XPC : MTRDeviceController -- (id)initWithUniqueIdentifier:(NSUUID *)UUID xpConnectionBlock:(NSXPCConnection * (^)(void) )connectionBlock; #ifdef MTR_HAVE_MACH_SERVICE_NAME_CONSTRUCTOR - (id)initWithUniqueIdentifier:(NSUUID *)UUID machServiceName:(NSString *)machServiceName options:(NSXPCConnectionOptions)options #endif diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm b/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm index d72dc211b70b4f..1bf0888ab3b2b4 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm @@ -83,17 +83,30 @@ - (NSXPCInterface *)_interfaceForClientProtocol return [self.uniqueIdentifier UUIDString]; } -- (id)initWithUniqueIdentifier:(NSUUID *)UUID xpConnectionBlock:(NSXPCConnection * (^)(void) )connectionBlock +- (nullable instancetype)initWithParameters:(MTRDeviceControllerAbstractParameters *)parameters + error:(NSError * __autoreleasing *)error { - if (self = [super initForSubclasses]) { + if (![parameters isKindOfClass:MTRXPCDeviceControllerParameters.class]) { + MTR_LOG_ERROR("Expected MTRXPCDeviceControllerParameters but got: %@", parameters); + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INVALID_ARGUMENT]; + } + return nil; + } + + if (self = [super initForSubclasses:parameters.startSuspended]) { + auto * xpcParameters = static_cast(parameters); + auto connectionBlock = xpcParameters.xpcConnectionBlock; + auto * UUID = xpcParameters.uniqueIdentifier; + MTR_LOG("Setting up XPC Controller for UUID: %@ with connection block: %p", UUID, connectionBlock); if (UUID == nil) { - MTR_LOG_ERROR("MTRDeviceController_XPC initWithUniqueIdentifier failed, nil UUID"); + MTR_LOG_ERROR("MTRDeviceController_XPC initWithParameters failed, nil UUID"); return nil; } if (connectionBlock == nil) { - MTR_LOG_ERROR("MTRDeviceController_XPC initWithUniqueIdentifier failed, nil connectionBlock"); + MTR_LOG_ERROR("MTRDeviceController_XPC initWithParameters failed, nil connectionBlock"); return nil; } @@ -131,7 +144,9 @@ - (id)initWithUniqueIdentifier:(NSUUID *)UUID xpConnectionBlock:(NSXPCConnection #ifdef MTR_HAVE_MACH_SERVICE_NAME_CONSTRUCTOR - (id)initWithUniqueIdentifier:(NSUUID *)UUID machServiceName:(NSString *)machServiceName options:(NSXPCConnectionOptions)options { - if (self = [super initForSubclasses]) { + // TODO: Presumably this should end up doing some sort of + // MTRDeviceControllerAbstractParameters thing eventually? + if (self = [super initForSubclasses:NO]) { MTR_LOG("Setting up XPC Controller for UUID: %@ with machServiceName: %s options: %d", UUID, machServiceName, options); self.xpcConnection = [[NSXPCConnection alloc] initWithMachServiceName:machServiceName options:options]; self.uniqueIdentifier = UUID; @@ -155,13 +170,6 @@ - (id)initWithUniqueIdentifier:(NSUUID *)UUID machServiceName:(NSString *)machSe } #endif // MTR_HAVE_MACH_SERVICE_NAME_CONSTRUCTOR -- (nullable instancetype)initWithParameters:(MTRDeviceControllerAbstractParameters *)parameters - error:(NSError * __autoreleasing *)error -{ - MTR_LOG_ERROR("%s: unimplemented method called", __PRETTY_FUNCTION__); - return nil; -} - // If prefetchedClusterData is not provided, load attributes individually from controller data store - (MTRDevice *)_setupDeviceForNodeID:(NSNumber *)nodeID prefetchedClusterData:(NSDictionary *)prefetchedClusterData { From ad298ea904d06f8691c4a7887760aaf852121add Mon Sep 17 00:00:00 2001 From: Kiel Oleson Date: Thu, 5 Sep 2024 15:56:24 -0700 Subject: [PATCH 09/42] Darwin: Add delegate methods to populate initial state over new XPC (#35422) * log actual class name in `description` * add reg/unreg methods to server protocol for device controllers to indicate interest/disinterest in node id optional to avoid need to lockstep, will become non-optional in time * protocol method to inform XPC MTRDevices of upstream internal state changes optional to avoid need to lockstep, will become non-optional in time * stub internal property to dictionary method * add node ID as parameter for internal state updates * initial work on private internal properties delegate * sketch a way to expose key names to clients * Restyled by clang-format * Adding MTRDevice_XPC private method * don't extern internal property keys * move internal state keys to `MTRDevice_Internal` where it is commonly accessible to both `_Concrete` and `_XPC` * implement vid and pid accessors for internal state dictionary in `MTRDevice_XPC` * prefix private method name with underscore * Restyled by clang-format * fix up preamble for new header * Wrong key * Should be static --------- Co-authored-by: Restyled.io Co-authored-by: Justin Wood --- .../Framework/CHIP/MTRDevice_Concrete.mm | 56 +++++++++++++++++-- .../Framework/CHIP/MTRDevice_Internal.h | 10 ++++ src/darwin/Framework/CHIP/MTRDevice_XPC.mm | 30 +++++++++- .../Framework/CHIP/MTRDevice_XPC_Internal.h | 26 +++++++++ .../CHIP/XPC Protocol/MTRXPCClientProtocol.h | 4 ++ .../CHIP/XPC Protocol/MTRXPCServerProtocol.h | 5 ++ .../Matter.xcodeproj/project.pbxproj | 4 ++ 7 files changed, 128 insertions(+), 7 deletions(-) create mode 100644 src/darwin/Framework/CHIP/MTRDevice_XPC_Internal.h diff --git a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm index 0739b05178cdd2..8d531ffbfadc0b 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm +++ b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm @@ -254,6 +254,8 @@ @interface MTRDevice_Concrete () @property (nonatomic) ReadClient * currentReadClient; @property (nonatomic) SubscriptionCallback * currentSubscriptionCallback; // valid when and only when currentReadClient is valid +@property (nonatomic, weak) id privateInternalStateDelegate; + @end // Declaring selector so compiler won't complain about testing and calling it in _handleReportEnd @@ -461,7 +463,36 @@ - (NSString *)description } return [NSString - stringWithFormat:@"", self, _deviceController.compressedFabricID.unsignedLongLongValue, _nodeID.unsignedLongLongValue, _nodeID.unsignedLongLongValue, vid, pid, wifi, thread, InternalDeviceStateString(internalDeviceState), static_cast(lastSubscriptionAttemptWait), static_cast(_asyncWorkQueue.itemCount), mostRecentReportTime, reportAge, lastSubscriptionFailureTime, subscriptionFailureAge, _deviceController.uniqueIdentifier]; + stringWithFormat:@"<%@: %p, node: %016llX-%016llX (%llu), VID: %@, PID: %@, WiFi: %@, Thread: %@, state: %@, last subscription attempt wait: %lus, queued work: %lu, last report: %@%@, last subscription failure: %@%@, controller: %@>", NSStringFromClass(self.class), self, _deviceController.compressedFabricID.unsignedLongLongValue, _nodeID.unsignedLongLongValue, _nodeID.unsignedLongLongValue, vid, pid, wifi, thread, InternalDeviceStateString(internalDeviceState), static_cast(lastSubscriptionAttemptWait), static_cast(_asyncWorkQueue.itemCount), mostRecentReportTime, reportAge, lastSubscriptionFailureTime, subscriptionFailureAge, _deviceController.uniqueIdentifier]; +} + +- (NSDictionary *)_internalProperties +{ + id vidOrUnknown, pidOrUnknown; + + { + std::lock_guard lock(_descriptionLock); + + vidOrUnknown = _vid ?: @"Unknown"; + pidOrUnknown = _pid ?: @"Unknown"; + // id networkFeatures = _allNetworkFeatures; + // id internalDeviceState = _internalDeviceStateForDescription; + // id lastSubscriptionAttemptWait = _lastSubscriptionAttemptWaitForDescription; + // id mostRecentReportTime = _mostRecentReportTimeForDescription; + // id lastSubscriptionFailureTime = _lastSubscriptionFailureTimeForDescription; + } + + return @{ + kMTRDeviceInternalPropertyKeyVendorID : vidOrUnknown, + kMTRDeviceInternalPropertyKeyProductID : pidOrUnknown, + }; +} + +- (void)_notifyPrivateInternalPropertiesDelegateOfChanges +{ + if ([self.privateInternalStateDelegate respondsToSelector:@selector(device:internalStateUpdated:)]) { + [self.privateInternalStateDelegate device:self.nodeID internalStateUpdated:[self _internalProperties]]; + } } #pragma mark - Time Synchronization @@ -951,6 +982,8 @@ - (void)_changeInternalState:(MTRInternalDeviceState)state } }]; /* END DRAGONS */ + + [self _notifyPrivateInternalPropertiesDelegateOfChanges]; } } @@ -1151,7 +1184,7 @@ - (void)_handleResubscriptionNeededWithDelay:(NSNumber *)resubscriptionDelayMs std::lock_guard lock(_descriptionLock); _lastSubscriptionFailureTimeForDescription = _lastSubscriptionFailureTime; } - + [self _notifyPrivateInternalPropertiesDelegateOfChanges]; deviceUsesThread = [self _deviceUsesThread]; // If a previous resubscription failed, remove the item from the subscription pool. @@ -1197,8 +1230,12 @@ - (void)_setLastSubscriptionAttemptWait:(uint32_t)lastSubscriptionAttemptWait os_unfair_lock_assert_owner(&_lock); _lastSubscriptionAttemptWait = lastSubscriptionAttemptWait; - std::lock_guard lock(_descriptionLock); - _lastSubscriptionAttemptWaitForDescription = lastSubscriptionAttemptWait; + { + std::lock_guard lock(_descriptionLock); + _lastSubscriptionAttemptWaitForDescription = lastSubscriptionAttemptWait; + } + + [self _notifyPrivateInternalPropertiesDelegateOfChanges]; } - (void)_doHandleSubscriptionReset:(NSNumber * _Nullable)retryDelay @@ -1214,6 +1251,7 @@ - (void)_doHandleSubscriptionReset:(NSNumber * _Nullable)retryDelay std::lock_guard lock(_descriptionLock); _lastSubscriptionFailureTimeForDescription = _lastSubscriptionFailureTime; } + [self _notifyPrivateInternalPropertiesDelegateOfChanges]; // if there is no delegate then also do not retry if (![self _delegateExists]) { @@ -1464,8 +1502,11 @@ - (void)unitTestSetMostRecentReportTimes:(NSMutableArray *)mostRecentR { _mostRecentReportTimes = mostRecentReportTimes; - std::lock_guard lock(_descriptionLock); - _mostRecentReportTimeForDescription = [mostRecentReportTimes lastObject]; + { + std::lock_guard lock(_descriptionLock); + _mostRecentReportTimeForDescription = [mostRecentReportTimes lastObject]; + } + [self _notifyPrivateInternalPropertiesDelegateOfChanges]; } #endif @@ -1524,6 +1565,7 @@ - (void)_scheduleClusterDataPersistence std::lock_guard lock(_descriptionLock); _mostRecentReportTimeForDescription = [_mostRecentReportTimes lastObject]; } + [self _notifyPrivateInternalPropertiesDelegateOfChanges]; // Calculate running average and update multiplier - need at least 2 items to calculate intervals if (_mostRecentReportTimes.count > 2) { @@ -1594,6 +1636,8 @@ - (void)_resetStorageBehaviorState std::lock_guard lock(_descriptionLock); _mostRecentReportTimeForDescription = nil; } + [self _notifyPrivateInternalPropertiesDelegateOfChanges]; + _deviceReportingExcessivelyStartTime = nil; _reportToPersistenceDelayCurrentMultiplier = 1; diff --git a/src/darwin/Framework/CHIP/MTRDevice_Internal.h b/src/darwin/Framework/CHIP/MTRDevice_Internal.h index 20d9dd485e8b85..c3b6b60fa6314e 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDevice_Internal.h @@ -204,6 +204,11 @@ MTR_DIRECT_MEMBERS @end +#pragma mark - MTRDevice internal state monitoring +@protocol MTRDeviceInternalStateDelegate +- (void)devicePrivateInternalStateChanged:(MTRDevice *)device internalState:(NSDictionary *)state; +@end + #pragma mark - Constants static NSString * const kDefaultSubscriptionPoolSizeOverrideKey = @"subscriptionPoolSizeOverride"; @@ -217,4 +222,9 @@ static NSString * const sLastInitialSubscribeLatencyKey = @"lastInitialSubscribe // Declared inside platform, but noting here for reference // static NSString * const kSRPTimeoutInMsecsUserDefaultKey = @"SRPTimeoutInMSecsOverride"; +// Concrete to XPC internal state property dictionary keys +static NSString * const kMTRDeviceInternalPropertyKeyVendorID = @"MTRDeviceInternalStateKeyVendorID"; +static NSString * const kMTRDeviceInternalPropertyKeyProductID = @"MTRDeviceInternalStateKeyProductID"; +// TODO: more internal properties + NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/MTRDevice_XPC.mm b/src/darwin/Framework/CHIP/MTRDevice_XPC.mm index 85be0db3436df9..7267eb3a2b4f7e 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_XPC.mm +++ b/src/darwin/Framework/CHIP/MTRDevice_XPC.mm @@ -44,6 +44,7 @@ #import "MTRDeviceController_XPC.h" #import "MTRDevice_Concrete.h" #import "MTRDevice_Internal.h" +#import "MTRDevice_XPC_Internal.h" #import "MTRError_Internal.h" #import "MTRKeypair.h" #import "MTRLogging_Internal.h" @@ -82,6 +83,8 @@ @implementation MTRDevice_XPC +@synthesize _internalState; + - (instancetype)initWithNodeID:(NSNumber *)nodeID controller:(MTRDeviceController *)controller { // TODO: Verify that this is a valid MTRDeviceController_XPC? @@ -93,6 +96,11 @@ - (instancetype)initWithNodeID:(NSNumber *)nodeID controller:(MTRDeviceControlle return self; } +- (void)dealloc +{ + [self _setInternalState:nil]; +} + - (NSString *)description { // TODO: Figure out whether, and if so how, to log: VID, PID, WiFi, Thread, @@ -100,7 +108,27 @@ - (NSString *)description // subscription attempt wait (does that apply to us?) queued work (do we // have any?), last report, last subscription failure (does that apply to us?). return [NSString - stringWithFormat:@"", self, _deviceController.compressedFabricID.unsignedLongLongValue, _nodeID.unsignedLongLongValue, _nodeID.unsignedLongLongValue, _deviceController.uniqueIdentifier]; + stringWithFormat:@"<%@: %p, node: %016llX-%016llX (%llu), VID: %@, PID: %@, controller: %@>", NSStringFromClass(self.class), self, _deviceController.compressedFabricID.unsignedLongLongValue, _nodeID.unsignedLongLongValue, _nodeID.unsignedLongLongValue, [self _vid], [self _pid], _deviceController.uniqueIdentifier]; +} + +- (nullable NSNumber *)_internalStateNumberOrNilForKey:(NSString *)key +{ + if ([_internalState[key] isKindOfClass:NSNumber.class]) { + NSNumber * number = _internalState[key]; + return number; + } else { + return nil; + } +} + +- (nullable NSNumber *)_vid +{ + return [self _internalStateNumberOrNilForKey:kMTRDeviceInternalPropertyKeyVendorID]; +} + +- (nullable NSNumber *)_pid +{ + return [self _internalStateNumberOrNilForKey:kMTRDeviceInternalPropertyKeyProductID]; } #pragma mark - Client Callbacks (MTRDeviceDelegate) diff --git a/src/darwin/Framework/CHIP/MTRDevice_XPC_Internal.h b/src/darwin/Framework/CHIP/MTRDevice_XPC_Internal.h new file mode 100644 index 00000000000000..6cbc82d54cb36c --- /dev/null +++ b/src/darwin/Framework/CHIP/MTRDevice_XPC_Internal.h @@ -0,0 +1,26 @@ +/** + * Copyright (c) 2024 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "MTRDevice_XPC.h" +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface MTRDevice_XPC () +@property (nullable, atomic, readwrite, retain, getter=_internalState, setter=_setInternalState:) NSDictionary * _internalState; +@end + +NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCClientProtocol.h b/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCClientProtocol.h index 3e276eb25f760d..b26b6d88849193 100644 --- a/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCClientProtocol.h +++ b/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCClientProtocol.h @@ -27,6 +27,10 @@ MTR_NEWLY_AVAILABLE - (oneway void)deviceBecameActive:(NSNumber *)nodeID; - (oneway void)deviceCachePrimed:(NSNumber *)nodeID; - (oneway void)deviceConfigurationChanged:(NSNumber *)nodeID; + +@optional +// temporarily optional to avoid lockstep needs +- (oneway void)device:(NSNumber *)nodeID internalStateUpdated:(NSDictionary *)dictionary; @end MTR_NEWLY_AVAILABLE diff --git a/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCServerProtocol.h b/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCServerProtocol.h index 81d6ab930cb6aa..1ebdea5d3757ec 100644 --- a/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCServerProtocol.h +++ b/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCServerProtocol.h @@ -71,6 +71,11 @@ MTR_NEWLY_AVAILABLE - (oneway void)deviceController:(NSUUID *)controller shutdownDeviceController:(NSUUID *)controller; +@optional +// register / unregister temporarily optional to avoid lockstep needs +- (oneway void)deviceController:(NSUUID *)controller registerNodeID:(NSNumber *)nodeID; +- (oneway void)deviceController:(NSUUID *)controller unregisterNodeID:(NSNumber *)nodeID; + @end MTR_NEWLY_AVAILABLE diff --git a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj index 7d0ab045b6a25a..69de347df8341c 100644 --- a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj +++ b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj @@ -379,6 +379,7 @@ B4FCD5722B603A6300832859 /* DownloadLogCommand.mm in Sources */ = {isa = PBXBuildFile; fileRef = B4FCD56F2B603A6300832859 /* DownloadLogCommand.mm */; }; B4FCD5732B611EB300832859 /* MTRDiagnosticLogsDownloader.h in Headers */ = {isa = PBXBuildFile; fileRef = B4C8E6B32B3453AD00FCD54D /* MTRDiagnosticLogsDownloader.h */; }; BA09EB43247477BA00605257 /* libCHIP.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BA09EB3F2474762900605257 /* libCHIP.a */; }; + D4288E872C8A273F002FEC53 /* MTRDevice_XPC_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = D4288E862C8A273F002FEC53 /* MTRDevice_XPC_Internal.h */; }; D444F9A72C6E8F9D007761E5 /* MTRXPCServerProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = D444F9A62C6E8F9D007761E5 /* MTRXPCServerProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; D444F9AA2C6E9A08007761E5 /* MTRXPCClientProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = D444F9A82C6E99CA007761E5 /* MTRXPCClientProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; D4772A46285AE98400383630 /* MTRClusterConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = D4772A45285AE98300383630 /* MTRClusterConstants.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -823,6 +824,7 @@ B4FCD56F2B603A6300832859 /* DownloadLogCommand.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DownloadLogCommand.mm; sourceTree = ""; }; BA09EB3F2474762900605257 /* libCHIP.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libCHIP.a; path = lib/libCHIP.a; sourceTree = BUILT_PRODUCTS_DIR; }; BA107AEE2470CFBB004287EB /* chip_xcode_build_connector.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = chip_xcode_build_connector.sh; sourceTree = ""; }; + D4288E862C8A273F002FEC53 /* MTRDevice_XPC_Internal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRDevice_XPC_Internal.h; sourceTree = ""; }; D437613E285BDC0D0051FEA2 /* MTRErrorTestUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRErrorTestUtils.h; sourceTree = ""; }; D437613F285BDC0D0051FEA2 /* MTRTestKeys.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRTestKeys.h; sourceTree = ""; }; D4376140285BDC0D0051FEA2 /* MTRTestStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRTestStorage.h; sourceTree = ""; }; @@ -1332,6 +1334,7 @@ 7596A84228762729004DAE0E /* MTRDevice.h */, 7596A84328762729004DAE0E /* MTRDevice.mm */, 9B5CCB5A2C6EC890009DD99B /* MTRDevice_XPC.h */, + D4288E862C8A273F002FEC53 /* MTRDevice_XPC_Internal.h */, 9B5CCB5B2C6EC890009DD99B /* MTRDevice_XPC.mm */, 9BDA2A072C5D9AFB00A32BDD /* MTRDevice_Concrete.h */, 9BDA2A052C5D9AF800A32BDD /* MTRDevice_Concrete.mm */, @@ -1632,6 +1635,7 @@ 5173A47729C0E2ED00F67F48 /* MTRFabricInfo.h in Headers */, 517BF3F0282B62B800A8B7DB /* MTRCertificates.h in Headers */, 51E51FBF282AD37A00FC978D /* MTRDeviceControllerStartupParams.h in Headers */, + D4288E872C8A273F002FEC53 /* MTRDevice_XPC_Internal.h in Headers */, 5136661628067D550025EDAE /* MTRDeviceControllerFactory.h in Headers */, 9B5CCB592C6E6FD3009DD99B /* MTRDeviceController_XPC_Internal.h in Headers */, 5178E6812AE098520069DF72 /* MTRCommandTimedCheck.h in Headers */, From eaa4d6207fcf605f4320d4692fdffb67ed342398 Mon Sep 17 00:00:00 2001 From: Jeff Tung <100387939+jtung-apple@users.noreply.github.com> Date: Thu, 5 Sep 2024 16:40:19 -0700 Subject: [PATCH 10/42] [Darwin] Fix for MTRDevice deadlock during subscription reset (#35438) --- src/darwin/Framework/CHIP/MTRDevice_Concrete.mm | 1 + 1 file changed, 1 insertion(+) diff --git a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm index 8d531ffbfadc0b..70824dd9bcd7d1 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm +++ b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm @@ -1004,6 +1004,7 @@ - (void)_handleSubscriptionEstablished // If subscription had reset since this handler was scheduled, do not execute "established" logic below if (!HaveSubscriptionEstablishedRightNow(_internalDeviceState)) { MTR_LOG("%@ _handleSubscriptionEstablished run with internal state %lu - skipping subscription establishment logic", self, static_cast(_internalDeviceState)); + os_unfair_lock_unlock(&self->_lock); return; } From 693b82b0118fd7c50731a146aaab94d546795c3f Mon Sep 17 00:00:00 2001 From: Wang Qixiang <43193572+wqx6@users.noreply.github.com> Date: Fri, 6 Sep 2024 08:00:37 +0800 Subject: [PATCH 11/42] ESP32: check whether the mdns service exists before deleting it (#35397) --- src/platform/ESP32/ESP32DnssdImpl.cpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/platform/ESP32/ESP32DnssdImpl.cpp b/src/platform/ESP32/ESP32DnssdImpl.cpp index e898a9cadf767d..30e0c3e2bcaea8 100644 --- a/src/platform/ESP32/ESP32DnssdImpl.cpp +++ b/src/platform/ESP32/ESP32DnssdImpl.cpp @@ -177,6 +177,12 @@ CHIP_ERROR EspDnssdPublishService(const DnssdService * service, DnssdPublishCall } } + // Remove service before adding it + if (mdns_service_exists(service->mType, GetProtocolString(service->mProtocol), nullptr)) + { + mdns_service_remove_for_host(service->mName, service->mType, GetProtocolString(service->mProtocol), nullptr); + } + espError = mdns_service_add(service->mName, service->mType, GetProtocolString(service->mProtocol), service->mPort, items, service->mTextEntrySize); // The mdns_service_add will return error if we try to add an existing service @@ -205,9 +211,18 @@ CHIP_ERROR EspDnssdPublishService(const DnssdService * service, DnssdPublishCall CHIP_ERROR EspDnssdRemoveServices() { - mdns_service_remove("_matter", "_tcp"); - mdns_service_remove("_matterc", "_udp"); - mdns_service_remove("_matterd", "_udp"); + if (mdns_service_exists("_matter", "_tcp", nullptr)) + { + mdns_service_remove("_matter", "_tcp"); + } + if (mdns_service_exists("_matterc", "_udp", nullptr)) + { + mdns_service_remove("_matterc", "_udp"); + } + if (mdns_service_exists("_matterd", "_udp", nullptr)) + { + mdns_service_remove("_matterd", "_udp"); + } return CHIP_NO_ERROR; } From 36f0c502de6f2ba8a73b71d1eaf09878ae2b5036 Mon Sep 17 00:00:00 2001 From: Karsten Sperling <113487422+ksperling-apple@users.noreply.github.com> Date: Fri, 6 Sep 2024 14:12:41 +1200 Subject: [PATCH 12/42] Add the ability for EventLoopHandlers to participate in a Select-based event loop (#34433) * Darwin: Make it possible to build with chip_system_config_use_dispatch=false Note: This is for unit testing / development purposes only. * Add the ability for EventLoopHandlers to participate in the event loop * Avoid leaking the fallback timer in the test * Expand documentation * Fix GN logic so fake platform tests can run on Darwin * Disable TestEventLoopHandler when chip_device_platform == "fake" The fake PlatformManagerImpl doesn't drive the SystemLayer event loop. --- src/lib/support/BUILD.gn | 5 +- src/lib/support/IntrusiveList.h | 10 ++ src/platform/Darwin/PlatformManagerImpl.cpp | 14 +- src/platform/Darwin/PlatformManagerImpl.h | 15 +- src/platform/Darwin/SystemPlatformConfig.h | 8 -- src/system/SystemLayer.h | 49 +++++++ src/system/SystemLayerImplSelect.cpp | 81 +++++++++-- src/system/SystemLayerImplSelect.h | 9 ++ src/system/system.gni | 4 + src/system/tests/BUILD.gn | 1 + src/system/tests/TestEventLoopHandler.cpp | 148 ++++++++++++++++++++ 11 files changed, 316 insertions(+), 28 deletions(-) create mode 100644 src/system/tests/TestEventLoopHandler.cpp diff --git a/src/lib/support/BUILD.gn b/src/lib/support/BUILD.gn index 38ee31fccb94e5..80b1b6d99dc328 100644 --- a/src/lib/support/BUILD.gn +++ b/src/lib/support/BUILD.gn @@ -23,6 +23,7 @@ import("${chip_root}/build/chip/chip_version.gni") import("${chip_root}/build/chip/java/config.gni") import("${chip_root}/build/chip/tests.gni") import("${chip_root}/src/lib/core/core.gni") +import("${chip_root}/src/platform/device.gni") declare_args() { # Set to true to run the PersistentStorageDelegate API compliance audit @@ -255,7 +256,7 @@ static_library("support") { "verhoeff/Verhoeff10.cpp", ] - if (current_os == "android" || matter_enable_java_compilation) { + if (chip_device_platform == "android" || matter_enable_java_compilation) { if (matter_enable_java_compilation) { include_dirs = java_matter_controller_dependent_paths } @@ -304,7 +305,7 @@ static_library("support") { # Platforms that utilize CHIP_SYSTEM_CONFIG_PLATFORM_LOG need to # be pulled in here as public_deps since they hook into logging at # the macro level rather than just providing a LogV implementation. - if (current_os == "mac" || current_os == "ios") { + if (chip_device_platform == "darwin") { public_deps += [ "${chip_root}/src/platform/Darwin:logging" ] } diff --git a/src/lib/support/IntrusiveList.h b/src/lib/support/IntrusiveList.h index 961113e8d1ee6b..a38516cbfb91c8 100644 --- a/src/lib/support/IntrusiveList.h +++ b/src/lib/support/IntrusiveList.h @@ -414,6 +414,11 @@ class IntrusiveList : public IntrusiveListBase ConstIterator(IntrusiveListBase::ConstIteratorBase && base) : IntrusiveListBase::ConstIteratorBase(std::move(base)) {} const T * operator->() { return Hook::ToObject(mCurrent); } const T & operator*() { return *Hook::ToObject(mCurrent); } + + ConstIterator & operator++() { return static_cast(IntrusiveListBase::ConstIteratorBase::operator++()); } + ConstIterator operator++(int) { return IntrusiveListBase::ConstIteratorBase::operator++(1); } + ConstIterator & operator--() { return static_cast(IntrusiveListBase::ConstIteratorBase::operator--()); } + ConstIterator operator--(int) { return IntrusiveListBase::ConstIteratorBase::operator--(1); } }; class Iterator : public IntrusiveListBase::IteratorBase @@ -426,6 +431,11 @@ class IntrusiveList : public IntrusiveListBase Iterator(IntrusiveListBase::IteratorBase && base) : IntrusiveListBase::IteratorBase(std::move(base)) {} T * operator->() { return Hook::ToObject(mCurrent); } T & operator*() { return *Hook::ToObject(mCurrent); } + + Iterator & operator++() { return static_cast(IntrusiveListBase::IteratorBase::operator++()); } + Iterator operator++(int) { return IntrusiveListBase::IteratorBase::operator++(1); } + Iterator & operator--() { return static_cast(IntrusiveListBase::IteratorBase::operator--()); } + Iterator operator--(int) { return IntrusiveListBase::IteratorBase::operator--(1); } }; ConstIterator begin() const { return IntrusiveListBase::begin(); } diff --git a/src/platform/Darwin/PlatformManagerImpl.cpp b/src/platform/Darwin/PlatformManagerImpl.cpp index d1dc5308c869e9..d68304ef696d30 100644 --- a/src/platform/Darwin/PlatformManagerImpl.cpp +++ b/src/platform/Darwin/PlatformManagerImpl.cpp @@ -35,7 +35,11 @@ #include // Include the non-inline definitions for the GenericPlatformManagerImpl<> template, +#if CHIP_SYSTEM_CONFIG_USE_DISPATCH #include +#else +#include +#endif // CHIP_SYSTEM_CONFIG_USE_DISPATCH #include #include @@ -64,7 +68,7 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack() ReturnErrorOnFailure(Internal::PosixConfig::Init()); #endif // CHIP_DISABLE_PLATFORM_KVS -#if !CHIP_SYSTEM_CONFIG_USE_LIBEV +#if CHIP_SYSTEM_CONFIG_USE_DISPATCH // Ensure there is a dispatch queue available static_cast(DeviceLayer::SystemLayer()).SetDispatchQueue(GetWorkQueue()); #endif @@ -83,6 +87,7 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack() return CHIP_NO_ERROR; } +#if CHIP_SYSTEM_CONFIG_USE_DISPATCH CHIP_ERROR PlatformManagerImpl::_StartEventLoopTask() { auto expected = WorkQueueState::kSuspended; @@ -128,12 +133,6 @@ void PlatformManagerImpl::_RunEventLoop() mRunLoopSem = nullptr; } -void PlatformManagerImpl::_Shutdown() -{ - // Call up to the base class _Shutdown() to perform the bulk of the shutdown. - GenericPlatformManagerImpl::_Shutdown(); -} - CHIP_ERROR PlatformManagerImpl::_PostEvent(const ChipDeviceEvent * event) { const ChipDeviceEvent eventCopy = *event; @@ -142,6 +141,7 @@ CHIP_ERROR PlatformManagerImpl::_PostEvent(const ChipDeviceEvent * event) }); return CHIP_NO_ERROR; } +#endif // CHIP_SYSTEM_CONFIG_USE_DISPATCH #if CHIP_STACK_LOCK_TRACKING_ENABLED bool PlatformManagerImpl::_IsChipStackLockedByCurrentThread() const diff --git a/src/platform/Darwin/PlatformManagerImpl.h b/src/platform/Darwin/PlatformManagerImpl.h index ba37badf4628b5..24357c905f9887 100644 --- a/src/platform/Darwin/PlatformManagerImpl.h +++ b/src/platform/Darwin/PlatformManagerImpl.h @@ -25,7 +25,12 @@ #include #include + +#if CHIP_SYSTEM_CONFIG_USE_DISPATCH #include +#else +#include +#endif // CHIP_SYSTEM_CONFIG_USE_DISPATCH #include #include @@ -38,7 +43,12 @@ class BleScannerDelegate; /** * Concrete implementation of the PlatformManager singleton object for Darwin platforms. */ -class PlatformManagerImpl final : public PlatformManager, public Internal::GenericPlatformManagerImpl +class PlatformManagerImpl final : public PlatformManager, +#if CHIP_SYSTEM_CONFIG_USE_DISPATCH + public Internal::GenericPlatformManagerImpl +#else + public Internal::GenericPlatformManagerImpl_POSIX +#endif // CHIP_SYSTEM_CONFIG_USE_DISPATCH { // Allow the PlatformManager interface class to delegate method calls to // the implementation methods provided by this class. @@ -58,8 +68,8 @@ class PlatformManagerImpl final : public PlatformManager, public Internal::Gener private: // ===== Methods that implement the PlatformManager abstract interface. CHIP_ERROR _InitChipStack(); - void _Shutdown(); +#if CHIP_SYSTEM_CONFIG_USE_DISPATCH CHIP_ERROR _StartChipTimer(System::Clock::Timeout delay) { return CHIP_ERROR_NOT_IMPLEMENTED; }; CHIP_ERROR _StartEventLoopTask(); CHIP_ERROR _StopEventLoopTask(); @@ -69,6 +79,7 @@ class PlatformManagerImpl final : public PlatformManager, public Internal::Gener bool _TryLockChipStack() { return false; }; void _UnlockChipStack(){}; CHIP_ERROR _PostEvent(const ChipDeviceEvent * event); +#endif // CHIP_SYSTEM_CONFIG_USE_DISPATCH #if CHIP_STACK_LOCK_TRACKING_ENABLED bool _IsChipStackLockedByCurrentThread() const; diff --git a/src/platform/Darwin/SystemPlatformConfig.h b/src/platform/Darwin/SystemPlatformConfig.h index 5311b538ed7ea2..242755933c10bb 100644 --- a/src/platform/Darwin/SystemPlatformConfig.h +++ b/src/platform/Darwin/SystemPlatformConfig.h @@ -34,14 +34,6 @@ struct ChipDeviceEvent; // ==================== Platform Adaptations ==================== -#if !CHIP_SYSTEM_CONFIG_USE_LIBEV -// FIXME: these should not be hardcoded here, it is set via build config -// Need to exclude these for now in libev case -#define CHIP_SYSTEM_CONFIG_POSIX_LOCKING 0 -#define CHIP_SYSTEM_CONFIG_FREERTOS_LOCKING 0 -#define CHIP_SYSTEM_CONFIG_NO_LOCKING 1 -#endif - #define CHIP_SYSTEM_CONFIG_PLATFORM_PROVIDES_TIME 1 #define CHIP_SYSTEM_CONFIG_USE_POSIX_TIME_FUNCTS 1 #define CHIP_SYSTEM_CONFIG_POOL_USE_HEAP 1 diff --git a/src/system/SystemLayer.h b/src/system/SystemLayer.h index 76d778a59a6d79..75878ce6a81f50 100644 --- a/src/system/SystemLayer.h +++ b/src/system/SystemLayer.h @@ -41,6 +41,7 @@ #include #if CHIP_SYSTEM_CONFIG_USE_SOCKETS +#include #include #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS @@ -243,6 +244,7 @@ class LayerSockets : public Layer * Initialize watching for events on a file descriptor. * * Returns an opaque token through @a tokenOut that must be passed to subsequent operations for this file descriptor. + * Multiple calls to start watching the same file descriptor will return the same token. * StopWatchingSocket() must be called before closing the file descriptor. */ virtual CHIP_ERROR StartWatchingSocket(int fd, SocketWatchToken * tokenOut) = 0; @@ -288,6 +290,44 @@ class LayerSockets : public Layer virtual SocketWatchToken InvalidSocketWatchToken() = 0; }; +class LayerSocketsLoop; + +/** + * EventLoopHandlers can be registered with a LayerSocketsLoop instance to enable + * participation of those handlers in the processing cycle of the event loop. This makes + * it possible to implement adapters that allow components utilizing a third-party event + * loop API to participate in the Matter event loop, instead of having to run an entirely + * separate event loop on another thread. + * + * Specifically, the `PrepareEvents` and `HandleEvents` methods of registered event loop + * handlers will be called from the LayerSocketsLoop methods of the same names. + * + * @see LayerSocketsLoop::PrepareEvents + * @see LayerSocketsLoop::HandleEvents + */ +class EventLoopHandler : public chip::IntrusiveListNodeBase<> +{ +public: + virtual ~EventLoopHandler() {} + + /** + * Prepares events and returns the next requested wake time. + */ + virtual Clock::Timestamp PrepareEvents(Clock::Timestamp now) { return Clock::Timestamp::max(); } + + /** + * Handles / dispatches pending events. + * Every call to this method will have been preceded by a call to `PrepareEvents`. + */ + virtual void HandleEvents() = 0; + +private: + // mState is provided exclusively for use by the LayerSocketsLoop implementation + // sub-class and can be accessed by it via the LayerSocketsLoop::LoopHandlerState() helper. + friend class LayerSocketsLoop; + intptr_t mState = 0; +}; + class LayerSocketsLoop : public LayerSockets { public: @@ -298,6 +338,11 @@ class LayerSocketsLoop : public LayerSockets virtual void HandleEvents() = 0; virtual void EventLoopEnds() = 0; +#if !CHIP_SYSTEM_CONFIG_USE_DISPATCH + virtual void AddLoopHandler(EventLoopHandler & handler) = 0; + virtual void RemoveLoopHandler(EventLoopHandler & handler) = 0; +#endif // !CHIP_SYSTEM_CONFIG_USE_DISPATCH + #if CHIP_SYSTEM_CONFIG_USE_DISPATCH virtual void SetDispatchQueue(dispatch_queue_t dispatchQueue) = 0; virtual dispatch_queue_t GetDispatchQueue() = 0; @@ -305,6 +350,10 @@ class LayerSocketsLoop : public LayerSockets virtual void SetLibEvLoop(struct ev_loop * aLibEvLoopP) = 0; virtual struct ev_loop * GetLibEvLoop() = 0; #endif // CHIP_SYSTEM_CONFIG_USE_DISPATCH/LIBEV + +protected: + // Expose EventLoopHandler.mState as a non-const reference to sub-classes + decltype(EventLoopHandler::mState) & LoopHandlerState(EventLoopHandler & handler) { return handler.mState; } }; #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS diff --git a/src/system/SystemLayerImplSelect.cpp b/src/system/SystemLayerImplSelect.cpp index 86ff1cb62da42f..3e8a79f7b6e44f 100644 --- a/src/system/SystemLayerImplSelect.cpp +++ b/src/system/SystemLayerImplSelect.cpp @@ -28,6 +28,7 @@ #include #include +#include #include // Choose an approximation of PTHREAD_NULL if pthread.h doesn't define one. @@ -370,8 +371,9 @@ CHIP_ERROR LayerImplSelect::StartWatchingSocket(int fd, SocketWatchToken * token { if (w.mFD == fd) { - // Duplicate registration is an error. - return CHIP_ERROR_INVALID_ARGUMENT; + // Already registered, return the existing token + *tokenOut = reinterpret_cast(&w); + return CHIP_NO_ERROR; } if ((w.mFD == kInvalidFd) && (watch == nullptr)) { @@ -608,6 +610,32 @@ SocketEvents LayerImplSelect::SocketEventsFromFDs(int socket, const fd_set & rea return res; } +#if !CHIP_SYSTEM_CONFIG_USE_DISPATCH +enum : intptr_t +{ + kLoopHandlerInactive = 0, // default value for EventLoopHandler::mState + kLoopHandlerPending, + kLoopHandlerActive, +}; + +void LayerImplSelect::AddLoopHandler(EventLoopHandler & handler) +{ + // Add the handler as pending because this method can be called at any point + // in a PrepareEvents() / WaitForEvents() / HandleEvents() sequence. + // It will be marked active when we call PrepareEvents() on it for the first time. + auto & state = LoopHandlerState(handler); + VerifyOrDie(state == kLoopHandlerInactive); + state = kLoopHandlerPending; + mLoopHandlers.PushBack(&handler); +} + +void LayerImplSelect::RemoveLoopHandler(EventLoopHandler & handler) +{ + mLoopHandlers.Remove(&handler); + LoopHandlerState(handler) = kLoopHandlerInactive; +} +#endif // !CHIP_SYSTEM_CONFIG_USE_DISPATCH + void LayerImplSelect::PrepareEvents() { assertChipStackLockedByCurrentThread(); @@ -616,10 +644,28 @@ void LayerImplSelect::PrepareEvents() Clock::Timestamp awakenTime = currentTime + kDefaultMinSleepPeriod; TimerList::Node * timer = mTimerList.Earliest(); - if (timer && timer->AwakenTime() < awakenTime) + if (timer) + { + awakenTime = std::min(awakenTime, timer->AwakenTime()); + } + +#if !CHIP_SYSTEM_CONFIG_USE_DISPATCH + // Activate added EventLoopHandlers and call PrepareEvents on active handlers. + auto loopIter = mLoopHandlers.begin(); + while (loopIter != mLoopHandlers.end()) { - awakenTime = timer->AwakenTime(); + auto & loop = *loopIter++; // advance before calling out, in case a list modification clobbers the `next` pointer + switch (auto & state = LoopHandlerState(loop)) + { + case kLoopHandlerPending: + state = kLoopHandlerActive; + [[fallthrough]]; + case kLoopHandlerActive: + awakenTime = std::min(awakenTime, loop.PrepareEvents(currentTime)); + break; + } } +#endif // !CHIP_SYSTEM_CONFIG_USE_DISPATCH const Clock::Timestamp sleepTime = (awakenTime > currentTime) ? (awakenTime - currentTime) : Clock::kZero; Clock::ToTimeval(sleepTime, mNextTimeout); @@ -683,18 +729,35 @@ void LayerImplSelect::HandleEvents() mTimerPool.Invoke(timer); } - for (auto & w : mSocketWatchPool) + // Process socket events, if any + if (mSelectResult > 0) { - if (w.mFD != kInvalidFd) + for (auto & w : mSocketWatchPool) { - SocketEvents events = SocketEventsFromFDs(w.mFD, mSelected.mReadSet, mSelected.mWriteSet, mSelected.mErrorSet); - if (events.HasAny() && w.mCallback != nullptr) + if (w.mFD != kInvalidFd && w.mCallback != nullptr) { - w.mCallback(events, w.mCallbackData); + SocketEvents events = SocketEventsFromFDs(w.mFD, mSelected.mReadSet, mSelected.mWriteSet, mSelected.mErrorSet); + if (events.HasAny()) + { + w.mCallback(events, w.mCallbackData); + } } } } +#if !CHIP_SYSTEM_CONFIG_USE_DISPATCH + // Call HandleEvents for active loop handlers + auto loopIter = mLoopHandlers.begin(); + while (loopIter != mLoopHandlers.end()) + { + auto & loop = *loopIter++; // advance before calling out, in case a list modification clobbers the `next` pointer + if (LoopHandlerState(loop) == kLoopHandlerActive) + { + loop.HandleEvents(); + } + } +#endif // !CHIP_SYSTEM_CONFIG_USE_DISPATCH + #if CHIP_SYSTEM_CONFIG_POSIX_LOCKING mHandleSelectThread = PTHREAD_NULL; #endif // CHIP_SYSTEM_CONFIG_POSIX_LOCKING diff --git a/src/system/SystemLayerImplSelect.h b/src/system/SystemLayerImplSelect.h index 1bab3db9b5f39c..ce34ece0115b9b 100644 --- a/src/system/SystemLayerImplSelect.h +++ b/src/system/SystemLayerImplSelect.h @@ -87,6 +87,11 @@ class LayerImplSelect : public LayerSocketsLoop void HandleEvents() override; void EventLoopEnds() override {} +#if !CHIP_SYSTEM_CONFIG_USE_DISPATCH + void AddLoopHandler(EventLoopHandler & handler) override; + void RemoveLoopHandler(EventLoopHandler & handler) override; +#endif // !CHIP_SYSTEM_CONFIG_USE_DISPATCH + #if CHIP_SYSTEM_CONFIG_USE_DISPATCH void SetDispatchQueue(dispatch_queue_t dispatchQueue) override { mDispatchQueue = dispatchQueue; }; dispatch_queue_t GetDispatchQueue() override { return mDispatchQueue; }; @@ -135,6 +140,10 @@ class LayerImplSelect : public LayerSocketsLoop TimerList mExpiredTimers; timeval mNextTimeout; +#if !CHIP_SYSTEM_CONFIG_USE_DISPATCH + IntrusiveList mLoopHandlers; +#endif + // Members for select loop struct SelectSets { diff --git a/src/system/system.gni b/src/system/system.gni index 67bf9b61b8f881..61efb846d89839 100644 --- a/src/system/system.gni +++ b/src/system/system.gni @@ -80,6 +80,10 @@ assert( chip_system_config_locking == "zephyr", "Please select a valid mutex implementation: posix, freertos, mbed, cmsis-rtos, zephyr, none") +assert( + !chip_system_config_use_dispatch || chip_system_config_locking == "none", + "When chip_system_config_use_dispatch is true, chip_system_config_locking must be 'none'") + assert( chip_system_config_clock == "clock_gettime" || chip_system_config_clock == "gettimeofday", diff --git a/src/system/tests/BUILD.gn b/src/system/tests/BUILD.gn index 521a1f34d859b9..8b91690f47a708 100644 --- a/src/system/tests/BUILD.gn +++ b/src/system/tests/BUILD.gn @@ -21,6 +21,7 @@ chip_test_suite("tests") { output_name = "libSystemLayerTests" test_sources = [ + "TestEventLoopHandler.cpp", "TestSystemClock.cpp", "TestSystemErrorStr.cpp", "TestSystemPacketBuffer.cpp", diff --git a/src/system/tests/TestEventLoopHandler.cpp b/src/system/tests/TestEventLoopHandler.cpp new file mode 100644 index 00000000000000..4d5456098efb2f --- /dev/null +++ b/src/system/tests/TestEventLoopHandler.cpp @@ -0,0 +1,148 @@ +/* + * 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. + */ + +#include +#include + +// EventLoopHandlers are only supported by a select-based LayerSocketsLoop +#if CHIP_SYSTEM_CONFIG_USE_SOCKETS && !CHIP_SYSTEM_CONFIG_USE_DISPATCH +// The fake PlatformManagerImpl does not drive the system layer event loop +#if !CHIP_DEVICE_LAYER_TARGET_FAKE + +#include +#include + +#include +#include + +using namespace chip; +using namespace chip::System::Clock; +using namespace chip::System::Clock::Literals; + +class TestEventLoopHandler : public ::testing::Test +{ +public: + static void SetUpTestSuite() + { + ASSERT_EQ(Platform::MemoryInit(), CHIP_NO_ERROR); + ASSERT_EQ(DeviceLayer::PlatformMgr().InitChipStack(), CHIP_NO_ERROR); + } + + static void TearDownTestSuite() + { + DeviceLayer::PlatformMgr().Shutdown(); + Platform::MemoryShutdown(); + } + + static System::LayerSocketsLoop & SystemLayer() { return static_cast(DeviceLayer::SystemLayer()); } + + // Schedules a call to the provided lambda and returns a cancel function. + template + static std::function Schedule(Timeout delay, Lambda lambda) + { + System::TimerCompleteCallback callback = [](System::Layer * layer, void * ctx) { + auto * function = static_cast *>(ctx); + (*function)(); + delete function; + }; + auto * function = new std::function(lambda); + SystemLayer().StartTimer(delay, callback, function); + return [=] { + SystemLayer().CancelTimer(callback, function); + delete function; + }; + } + + template + static void ScheduleNextTick(Lambda lambda) + { + // ScheduleLambda is based on device events, which are greedily processed until the + // queue is empty, so we can't use it to wait for the next event loop tick. Just use + // a timer with a very short delay. + Schedule(1_ms, lambda); + } +}; + +TEST_F(TestEventLoopHandler, EventLoopHandlerSequence) +{ + struct : public System::EventLoopHandler + { + std::string trace; + Timestamp PrepareEvents(Timestamp now) override + { + trace.append("P"); + return Timestamp::max(); + } + void HandleEvents() override { trace.append("H"); } + } loopHandler; + + ScheduleNextTick([&] { + loopHandler.trace.append("1"); + SystemLayer().AddLoopHandler(loopHandler); + loopHandler.trace.append("A"); + ScheduleNextTick([&] { // "P" + loopHandler.trace.append("2"); + ScheduleNextTick([&] { // "H", "P" + loopHandler.trace.append("3"); + SystemLayer().RemoveLoopHandler(loopHandler); + loopHandler.trace.append("R"); + ScheduleNextTick([&] { + loopHandler.trace.append("4"); + DeviceLayer::PlatformMgr().StopEventLoopTask(); + }); + }); + }); + }); + + chip::DeviceLayer::PlatformMgr().RunEventLoop(); + EXPECT_EQ(loopHandler.trace, std::string("1AP2HP3R4")); +} + +TEST_F(TestEventLoopHandler, EventLoopHandlerWake) +{ + struct : public System::EventLoopHandler + { + Timestamp startTimestamp = System::SystemClock().GetMonotonicTimestamp(); + Timestamp wakeTimestamp = Timestamp::max(); + + Timestamp PrepareEvents(Timestamp now) override { return now + 400_ms; } + void HandleEvents() override + { + // StartTimer() (called by Schedule()) is liable to causes an immediate + // wakeup via Signal(), so ignore this call if it's only been a few ms. + auto now = System::SystemClock().GetMonotonicTimestamp(); + if (now - startTimestamp >= 100_ms) + { + wakeTimestamp = now; + DeviceLayer::PlatformMgr().StopEventLoopTask(); + } + } + } loopHandler; + + // Schedule a fallback timer to ensure the test stops + auto cancelFallback = Schedule(1000_ms, [] { DeviceLayer::PlatformMgr().StopEventLoopTask(); }); + SystemLayer().AddLoopHandler(loopHandler); + chip::DeviceLayer::PlatformMgr().RunEventLoop(); + SystemLayer().RemoveLoopHandler(loopHandler); + cancelFallback(); // avoid leaking the fallback timer + + Timestamp sleepDuration = loopHandler.wakeTimestamp - loopHandler.startTimestamp; + EXPECT_GE(sleepDuration.count(), 400u); // loopHandler requested wake-up after 400ms + EXPECT_LE(sleepDuration.count(), 500u); // allow some slack for test machine load +} + +#endif // !CHIP_DEVICE_LAYER_TARGET_FAKE +#endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS && !CHIP_SYSTEM_CONFIG_USE_DISPATCH From 9b58d4cdadf3b1354baea751a0a02f9f2f554616 Mon Sep 17 00:00:00 2001 From: mkardous-silabs <84793247+mkardous-silabs@users.noreply.github.com> Date: Thu, 5 Sep 2024 22:54:16 -0400 Subject: [PATCH 13/42] [ICD] Add ICDM 5.1 Automated Test Script (#34817) * Add ICDM 5.1 Automated Test Script * fix restyle * Restyled by prettier-json * Restyled by isort * Increase discovery timeout * Set log to true to debug CI * Update tests.yaml * Increase discovery timeout * Update manualTests.json * debugging TC_ICDM_5_1.py * dump ufw for mdns discovery in ci * Apply fixes for style and dnssd logic * Remove some debug code * Undo ufw change * One more readability update now that I update this file * Better error message on service not found * A few more updates for logging and logic when to unlock events * Restyle --------- Co-authored-by: Restyled.io Co-authored-by: yunhanw-google Co-authored-by: cjandhyala <68604034+cjandhyala@users.noreply.github.com> Co-authored-by: Andrei Litvin Co-authored-by: Andrei Litvin --- .../certification/Test_TC_ICDM_5_1.yaml | 145 ------------- src/app/tests/suites/manualTests.json | 2 +- src/python_testing/TC_ICDM_5_1.py | 197 ++++++++++++++++++ .../mdns_discovery/mdns_discovery.py | 97 +++++---- 4 files changed, 254 insertions(+), 187 deletions(-) delete mode 100644 src/app/tests/suites/certification/Test_TC_ICDM_5_1.yaml create mode 100644 src/python_testing/TC_ICDM_5_1.py diff --git a/src/app/tests/suites/certification/Test_TC_ICDM_5_1.yaml b/src/app/tests/suites/certification/Test_TC_ICDM_5_1.yaml deleted file mode 100644 index 0e4e0c6b1e793a..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_ICDM_5_1.yaml +++ /dev/null @@ -1,145 +0,0 @@ -# Copyright (c) 2024 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default - -name: 217.2.7. [TC-ICDM-5.1] Functionality with DUT as Client - -PICS: - - ICDM.C - -config: - nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 - -tests: - - label: - "Step 1: DUT issues an C_REGISTER_CLIENT command to the Test Harness." - PICS: ICDM.S.C00.Tx - verification: | - From DUT: - ./chip-tool icdmanagement register-client 1 1 hex:1234567890abcdef1234567890abcdef 1 0 --VerificationKey hex:abcdef1234567890abcdef1234567890 - - From TH: lit-icd-app - [1704407463921] [48858:527745] [DMG] InvokeRequestMessage = - [1704407463921] [48858:527745] [DMG] { - [1704407463921] [48858:527745] [DMG] suppressResponse = false, - [1704407463921] [48858:527745] [DMG] timedRequest = false, - [1704407463921] [48858:527745] [DMG] InvokeRequests = - [1704407463921] [48858:527745] [DMG] [ - [1704407463921] [48858:527745] [DMG] CommandDataIB = - [1704407463921] [48858:527745] [DMG] { - [1704407463921] [48858:527745] [DMG] CommandPathIB = - [1704407463921] [48858:527745] [DMG] { - [1704407463921] [48858:527745] [DMG] EndpointId = 0x0, - [1704407463921] [48858:527745] [DMG] ClusterId = 0x46, - [1704407463921] [48858:527745] [DMG] CommandId = 0x0, - [1704407463921] [48858:527745] [DMG] }, - [1704407463921] [48858:527745] [DMG] - [1704407463921] [48858:527745] [DMG] CommandFields = - [1704407463921] [48858:527745] [DMG] { - [1704407463921] [48858:527745] [DMG] 0x0 = 1, - [1704407463921] [48858:527745] [DMG] 0x1 = 1, - [1704407463921] [48858:527745] [DMG] 0x2 = [ - [1704407463921] [48858:527745] [DMG] 0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef, 0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef, - [1704407463921] [48858:527745] [DMG] ] (16 bytes) - [1704407463921] [48858:527745] [DMG] 0x3 = [ - [1704407463921] [48858:527745] [DMG] 0xab, 0xcd, 0xef, 0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef, 0x12, 0x34, 0x56, 0x78, 0x90, - [1704407463921] [48858:527745] [DMG] ] (16 bytes) - [1704407463921] [48858:527745] [DMG] }, - [1704407463921] [48858:527745] [DMG] }, - [1704407463921] [48858:527745] [DMG] - [1704407463921] [48858:527745] [DMG] ], - [1704407463921] [48858:527745] [DMG] - [1704407463921] [48858:527745] [DMG] InteractionModelRevision = 11 - [1704407463921] [48858:527745] [DMG] }, - disabled: true - - - label: - "Step 2: DUT issues an C_UNREGISTER_CLIENT command to the Test - Harness." - PICS: ICDM.S.C02.Tx - verification: | - From DUT: - ./chip-tool icdmanagement unregister-client 1 1 0 --VerificationKey hex:abcdef1234567890abcdef1234567890 - - From TH: lit-icd-app - [1704407560687] [49015:529245] [DMG] InvokeRequestMessage = - [1704407560687] [49015:529245] [DMG] { - [1704407560687] [49015:529245] [DMG] suppressResponse = false, - [1704407560687] [49015:529245] [DMG] timedRequest = false, - [1704407560687] [49015:529245] [DMG] InvokeRequests = - [1704407560687] [49015:529245] [DMG] [ - [1704407560687] [49015:529245] [DMG] CommandDataIB = - [1704407560687] [49015:529245] [DMG] { - [1704407560687] [49015:529245] [DMG] CommandPathIB = - [1704407560687] [49015:529245] [DMG] { - [1704407560687] [49015:529245] [DMG] EndpointId = 0x0, - [1704407560687] [49015:529245] [DMG] ClusterId = 0x46, - [1704407560687] [49015:529245] [DMG] CommandId = 0x2, - [1704407560687] [49015:529245] [DMG] }, - [1704407560687] [49015:529245] [DMG] - [1704407560687] [49015:529245] [DMG] CommandFields = - [1704407560687] [49015:529245] [DMG] { - [1704407560687] [49015:529245] [DMG] 0x0 = 1, - [1704407560687] [49015:529245] [DMG] 0x1 = [ - [1704407560687] [49015:529245] [DMG] 0xab, 0xcd, 0xef, 0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef, 0x12, 0x34, 0x56, 0x78, 0x90, - [1704407560687] [49015:529245] [DMG] ] (16 bytes) - [1704407560687] [49015:529245] [DMG] }, - [1704407560687] [49015:529245] [DMG] }, - [1704407560687] [49015:529245] [DMG] - [1704407560687] [49015:529245] [DMG] ], - [1704407560687] [49015:529245] [DMG] - [1704407560687] [49015:529245] [DMG] InteractionModelRevision = 11 - [1704407560687] [49015:529245] [DMG] }, - disabled: true - - - label: - "Step 3: DUT issues an C_STAY_ACTIVE_REQUEST command to the Test - Harness." - PICS: ICDM.S.C03.Tx - verification: | - From DUT: - ./chip-tool icdmanagement stay-active-request 1 0 - - From TH: lit-icd-app - [1704406259650] [46741:509053] [DMG] InvokeRequestMessage = - [1704406259650] [46741:509053] [DMG] { - [1704406259650] [46741:509053] [DMG] suppressResponse = false, - [1704406259650] [46741:509053] [DMG] timedRequest = false, - [1704406259650] [46741:509053] [DMG] InvokeRequests = - [1704406259650] [46741:509053] [DMG] [ - [1704406259650] [46741:509053] [DMG] CommandDataIB = - [1704406259650] [46741:509053] [DMG] { - [1704406259650] [46741:509053] [DMG] CommandPathIB = - [1704406259650] [46741:509053] [DMG] { - [1704406259650] [46741:509053] [DMG] EndpointId = 0x0, - [1704406259650] [46741:509053] [DMG] ClusterId = 0x46, - [1704406259650] [46741:509053] [DMG] CommandId = 0x3, - [1704406259650] [46741:509053] [DMG] }, - [1704406259650] [46741:509053] [DMG] - [1704406259650] [46741:509053] [DMG] CommandFields = - [1704406259650] [46741:509053] [DMG] { - [1704406259650] [46741:509053] [DMG] }, - [1704406259650] [46741:509053] [DMG] }, - [1704406259650] [46741:509053] [DMG] - [1704406259650] [46741:509053] [DMG] ], - [1704406259650] [46741:509053] [DMG] - [1704406259650] [46741:509053] [DMG] InteractionModelRevision = 11 - [1704406259650] [46741:509053] [DMG] }, - [1704406259650] [46741:509053] [DMG] AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0046 e=0 p=m - [1704406259650] [46741:509053] [DMG] AccessControl: allowed - [1704406259650] [46741:509053] [DMG] Received command for Endpoint=0 Cluster=0x0000_0046 Command=0x0000_0003 - [1704406259650] [46741:509053] [DMG] Endpoint=0 Cluster=0x0000_0046 Command=0x0000_0003 status 0x81 (UNSUPPORTED_COMMAND) (no additional context) - disabled: true diff --git a/src/app/tests/suites/manualTests.json b/src/app/tests/suites/manualTests.json index 8048c7b3be6e22..3b0b354840e1c6 100644 --- a/src/app/tests/suites/manualTests.json +++ b/src/app/tests/suites/manualTests.json @@ -117,7 +117,7 @@ "GeneralCommissioning": ["Test_TC_CGEN_2_2"], "GeneralDiagnostics": ["Test_TC_DGGEN_2_2"], "Identify": ["Test_TC_I_3_2"], - "IcdManagement": ["Test_TC_ICDM_4_1", "Test_TC_ICDM_5_1"], + "IcdManagement": [], "IlluminanceMeasurement": [], "InteractionDataModel": [ "Test_TC_IDM_1_1", diff --git a/src/python_testing/TC_ICDM_5_1.py b/src/python_testing/TC_ICDM_5_1.py new file mode 100644 index 00000000000000..f9c081b6fe56ce --- /dev/null +++ b/src/python_testing/TC_ICDM_5_1.py @@ -0,0 +1,197 @@ +# +# Copyright (c) 2023 Project CHIP Authors +# All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# See https://github.com/project-chip/connectedhomeip/blob/master/docs/testing/python.md#defining-the-ci-test-arguments +# for details about the block below. +# +# === BEGIN CI TEST ARGUMENTS === +# test-runner-runs: run1 +# test-runner-run/run1/app: ${LIT_ICD_APP} +# test-runner-run/run1/factoryreset: True +# test-runner-run/run1/quiet: True +# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# === END CI TEST ARGUMENTS === + +import logging +from dataclasses import dataclass + +import chip.clusters as Clusters +from chip.interaction_model import InteractionModelError, Status +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from mdns_discovery import mdns_discovery +from mobly import asserts + +Cluster = Clusters.Objects.IcdManagement +Commands = Cluster.Commands +Attributes = Cluster.Attributes +OperatingModeEnum = Cluster.Enums.OperatingModeEnum +ClientTypeEnum = Cluster.Enums.ClientTypeEnum + + +@dataclass +class Client: + checkInNodeID: int + subjectId: int + key: bytes + clientType: ClientTypeEnum + + +logger = logging.getLogger(__name__) +kRootEndpointId = 0 + +client1 = Client( + checkInNodeID=1, + subjectId=1, + key=bytes([x for x in range(0x10, 0x20)]), + clientType=ClientTypeEnum.kEphemeral +) + + +class TC_ICDM_5_1(MatterBaseTest): + + # + # Class Helper functions + # + + async def _read_icdm_attribute_expect_success(self, attribute) -> OperatingModeEnum: + return await self.read_single_attribute_check_success(endpoint=kRootEndpointId, cluster=Cluster, attribute=attribute) + + async def _send_single_icdm_command(self, command): + return await self.send_single_cmd(command, endpoint=kRootEndpointId) + + async def _get_icd_txt_record(self) -> OperatingModeEnum: + discovery = mdns_discovery.MdnsDiscovery(verbose_logging=True) + service = await discovery.get_operational_service( + node_id=self.dut_node_id, + compressed_fabric_id=self.default_controller.GetCompressedFabricId(), + log_output=True, discovery_timeout_sec=240) + + asserts.assert_is_not_none( + service, f"Failed to get operational node service information for {self.dut_node_id} on {self.default_controller.GetCompressedFabricId()}") + + icdTxtRecord = OperatingModeEnum(int(service.txt_record['ICD'])) + if icdTxtRecord.value != int(service.txt_record['ICD']): + raise AttributeError(f'Not a known ICD type: {service.txt_record["ICD"]}') + + return icdTxtRecord + + # + # Test Harness Helpers + # + + def desc_TC_ICDM_5_1(self) -> str: + """Returns a description of this test""" + return "[TC-ICDM-5.1] Operating Mode with DUT as Server" + + def steps_TC_ICDM_5_1(self) -> list[TestStep]: + steps = [ + TestStep(0, "Commissioning, already done", is_commissioning=True), + TestStep(1, "TH reads from the DUT the RegisteredClients attribute"), + TestStep("2a", "TH reads from the DUT the OperatingMode attribute."), + TestStep("2b", "Verify that the ICD DNS-SD TXT key is present."), + TestStep("3a", "TH sends RegisterClient command."), + TestStep("3b", "TH reads from the DUT the OperatingMode attribute."), + TestStep("3c", "Verify that mDNS is advertising ICD key."), + TestStep(4, "TH sends UnregisterClient command with CheckInNodeID1."), + TestStep("5a", "TH reads from the DUT the OperatingMode attribute."), + TestStep("5b", "Verify that the ICD DNS-SD TXT key is present."), + ] + return steps + + def pics_TC_ICDM_5_1(self) -> list[str]: + """ This function returns a list of PICS for this test case that must be True for the test to be run""" + pics = [ + "ICDM.S", + "ICDM.S.F02", + ] + return pics + + # + # ICDM 5.1 Test Body + # + + @async_test_body + async def test_TC_ICDM_5_1(self): + + # Commissioning + self.step(0) + + try: + self.step(1) + registeredClients = await self._read_icdm_attribute_expect_success( + Attributes.RegisteredClients) + + for client in registeredClients: + try: + await self._send_single_icdm_command(Commands.UnregisterClient(checkInNodeID=client.checkInNodeID)) + except InteractionModelError as e: + asserts.assert_equal( + e.status, Status.Success, "Unexpected error returned") + + self.step("2a") + operatingMode = await self._read_icdm_attribute_expect_success(Attributes.OperatingMode) + asserts.assert_equal(operatingMode, OperatingModeEnum.kSit) + + self.step("2b") + icdTxtRecord = await self._get_icd_txt_record() + asserts.assert_equal(icdTxtRecord, OperatingModeEnum.kSit, "OperatingMode Is not in SIT mode.") + + self.step("3a") + try: + await self._send_single_icdm_command(Commands.RegisterClient(checkInNodeID=client1.checkInNodeID, monitoredSubject=client1.subjectId, key=client1.key, clientType=client1.clientType)) + except InteractionModelError as e: + asserts.assert_equal( + e.status, Status.Success, "Unexpected error returned") + + self.step("3b") + operatingMode = await self._read_icdm_attribute_expect_success(Attributes.OperatingMode) + asserts.assert_equal(operatingMode, OperatingModeEnum.kLit) + + self.step("3c") + icdTxtRecord = await self._get_icd_txt_record() + asserts.assert_equal(icdTxtRecord, OperatingModeEnum.kLit, "OperatingMode Is not in Lit mode.") + + self.step(4) + try: + await self._send_single_icdm_command(Commands.UnregisterClient(checkInNodeID=client1.checkInNodeID)) + except InteractionModelError as e: + asserts.assert_equal( + e.status, Status.Success, "Unexpected error returned") + + self.step("5a") + operatingMode = await self._read_icdm_attribute_expect_success(Attributes.OperatingMode) + asserts.assert_equal(operatingMode, OperatingModeEnum.kSit) + + self.step("5b") + icdTxtRecord = await self._get_icd_txt_record() + asserts.assert_equal(icdTxtRecord, OperatingModeEnum.kSit, "OperatingMode Is not in SIT mode.") + + finally: + registeredClients = await self._read_icdm_attribute_expect_success( + Attributes.RegisteredClients) + + for client in registeredClients: + try: + await self._send_single_icdm_command(Commands.UnregisterClient(checkInNodeID=client.checkInNodeID)) + except InteractionModelError as e: + asserts.assert_equal( + e.status, Status.Success, "Unexpected error returned") + + +if __name__ == "__main__": + default_matter_test_main() diff --git a/src/python_testing/mdns_discovery/mdns_discovery.py b/src/python_testing/mdns_discovery/mdns_discovery.py index 86661d65729da3..f8c9d46d70760a 100644 --- a/src/python_testing/mdns_discovery/mdns_discovery.py +++ b/src/python_testing/mdns_discovery/mdns_discovery.py @@ -18,6 +18,7 @@ import asyncio import json +import logging from dataclasses import asdict, dataclass from enum import Enum from typing import Dict, List, Optional @@ -25,6 +26,8 @@ from zeroconf import IPVersion, ServiceStateChange, Zeroconf from zeroconf.asyncio import AsyncServiceBrowser, AsyncServiceInfo, AsyncZeroconfServiceTypes +logger = logging.getLogger(__name__) + @dataclass class MdnsServiceInfo: @@ -79,7 +82,7 @@ class MdnsDiscovery: DISCOVERY_TIMEOUT_SEC = 15 - def __init__(self): + def __init__(self, verbose_logging: bool = False): """ Initializes the MdnsDiscovery instance. @@ -99,9 +102,15 @@ def __init__(self): # A list of service types self._service_types = [] + # Filtering to apply for received data items + self._name_filter = None + # An asyncio Event to signal when a service has been discovered self._event = asyncio.Event() + # Verbose logging + self._verbose_logging = verbose_logging + # Public methods async def get_commissioner_service(self, log_output: bool = False, discovery_timeout_sec: float = DISCOVERY_TIMEOUT_SEC @@ -116,6 +125,7 @@ async def get_commissioner_service(self, log_output: bool = False, Returns: Optional[MdnsServiceInfo]: An instance of MdnsServiceInfo or None if timeout reached. """ + self._name_filter = None return await self._get_service(MdnsServiceType.COMMISSIONER, log_output, discovery_timeout_sec) async def get_commissionable_service(self, log_output: bool = False, @@ -131,10 +141,12 @@ async def get_commissionable_service(self, log_output: bool = False, Returns: Optional[MdnsServiceInfo]: An instance of MdnsServiceInfo or None if timeout reached. """ + self._name_filter = None return await self._get_service(MdnsServiceType.COMMISSIONABLE, log_output, discovery_timeout_sec) - async def get_operational_service(self, service_name: str = None, - service_type: str = None, + async def get_operational_service(self, + node_id: Optional[int] = None, + compressed_fabric_id: Optional[int] = None, discovery_timeout_sec: float = DISCOVERY_TIMEOUT_SEC, log_output: bool = False ) -> Optional[MdnsServiceInfo]: @@ -144,35 +156,16 @@ async def get_operational_service(self, service_name: str = None, Args: log_output (bool): Logs the discovered services to the console. Defaults to False. discovery_timeout_sec (float): Defaults to 15 seconds. - service_name (str): The unique name of the mDNS service. Defaults to None. - service_type (str): The service type of the service. Defaults to None. + node_id: the node id to create the service name from + compressed_fabric_id: the fabric id to create the service name from Returns: Optional[MdnsServiceInfo]: An instance of MdnsServiceInfo or None if timeout reached. """ # Validation to ensure both or none of the parameters are provided - if (service_name is None) != (service_type is None): - raise ValueError("Both service_name and service_type must be provided together or not at all.") - - mdns_service_info = None - - if service_name is None and service_type is None: - mdns_service_info = await self._get_service(MdnsServiceType.OPERATIONAL, log_output, discovery_timeout_sec) - else: - print(f"Looking for MDNS service type '{service_type}', service name '{service_name}'") - # Get service info - service_info = AsyncServiceInfo(service_type, service_name) - is_discovered = await service_info.async_request(self._zc, 3000) - if is_discovered: - mdns_service_info = self._to_mdns_service_info_class(service_info) - self._discovered_services = {} - self._discovered_services[service_type] = [mdns_service_info] - - if log_output: - self._log_output() - - return mdns_service_info + self._name_filter = f'{compressed_fabric_id:016x}-{node_id:016x}.{MdnsServiceType.OPERATIONAL.value}'.upper() + return await self._get_service(MdnsServiceType.OPERATIONAL, log_output, discovery_timeout_sec) async def get_border_router_service(self, log_output: bool = False, discovery_timeout_sec: float = DISCOVERY_TIMEOUT_SEC @@ -237,7 +230,7 @@ async def _discover(self, if all_services: self._service_types = list(await AsyncZeroconfServiceTypes.async_find()) - print(f"Browsing for MDNS service(s) of type: {self._service_types}") + logger.info(f"Browsing for MDNS service(s) of type: {self._service_types}") aiobrowser = AsyncServiceBrowser(zeroconf=self._zc, type_=self._service_types, @@ -247,7 +240,7 @@ async def _discover(self, try: await asyncio.wait_for(self._event.wait(), timeout=discovery_timeout_sec) except asyncio.TimeoutError: - print(f"MDNS service discovery timed out after {discovery_timeout_sec} seconds.") + logger.error("MDNS service discovery timed out after %d seconds.", discovery_timeout_sec) finally: await aiobrowser.async_cancel() @@ -276,13 +269,25 @@ def _on_service_state_change( Returns: None: This method does not return any value. """ - if state_change.value == ServiceStateChange.Added.value: - self._event.set() - asyncio.ensure_future(self._query_service_info( - zeroconf, - service_type, - name) - ) + if self._verbose_logging: + logger.info("Service state change: %s on %s/%s", state_change, name, service_type) + + if state_change.value == ServiceStateChange.Removed.value: + return + + if self._name_filter is not None and name.upper() != self._name_filter: + if self._verbose_logging: + logger.info(" Name does NOT match %s", self._name_filter) + return + + if self._verbose_logging: + logger.info("Received service data. Unlocking service information") + + asyncio.ensure_future(self._query_service_info( + zeroconf, + service_type, + name) + ) async def _query_service_info(self, zeroconf: Zeroconf, service_type: str, service_name: str) -> None: """ @@ -304,12 +309,19 @@ async def _query_service_info(self, zeroconf: Zeroconf, service_type: str, servi service_info.async_clear_cache() if is_service_discovered: + if self._verbose_logging: + logger.warning("Service discovered for %s/%s.", service_name, service_type) + mdns_service_info = self._to_mdns_service_info_class(service_info) if service_type not in self._discovered_services: self._discovered_services[service_type] = [mdns_service_info] else: self._discovered_services[service_type].append(mdns_service_info) + elif self._verbose_logging: + logger.warning("Service information not found.") + + self._event.set() def _to_mdns_service_info_class(self, service_info: AsyncServiceInfo) -> MdnsServiceInfo: """ @@ -355,21 +367,24 @@ async def _get_service(self, service_type: MdnsServiceType, any. Returns None if no service of the specified type is discovered within the timeout period. """ - mdns_service_info = None self._service_types = [service_type.value] await self._discover(discovery_timeout_sec, log_output) - if service_type.value in self._discovered_services: - mdns_service_info = self._discovered_services[service_type.value][0] - return mdns_service_info + if self._verbose_logging: + logger.info("Getting service from discovered services: %s", self._discovered_services) + + if service_type.value in self._discovered_services: + return self._discovered_services[service_type.value][0] + else: + return None def _log_output(self) -> str: """ - Converts the discovered services to a JSON string and prints it. + Converts the discovered services to a JSON string and log it. The method is intended to be used for debugging or informational purposes, providing a clear and comprehensive view of all services discovered during the mDNS service discovery process. """ converted_services = {key: [asdict(item) for item in value] for key, value in self._discovered_services.items()} json_str = json.dumps(converted_services, indent=4) - print(json_str) + logger.info("Discovery data:\n%s", json_str) From 513f2415983e0aedf342896348e133cb8a118c86 Mon Sep 17 00:00:00 2001 From: Arkadiusz Bokowy Date: Fri, 6 Sep 2024 07:22:40 +0200 Subject: [PATCH 14/42] [Linux] Fix potential race when saving storage file (#35428) * [Linux] Do not print misleading KVS init log message * [Linux] Fix race condition when saving comfiguration The mkstemp() call creates a unique file and returns file descriptor for opened file which should be used to write data. However, the previous implementation, instead of using file descriptor opened the temp file by the name, which could fail because of file removal between these calls. * Sync NuttX and WebOS implementation with Linux * Add exception * Improve readability --- scripts/tools/check_includes_config.py | 1 + src/lib/support/BUILD.gn | 2 + src/lib/support/FileDescriptor.h | 62 ++++++++++++ src/lib/support/TemporaryFileStream.h | 107 +++++++++++++++++++++ src/platform/Linux/CHIPLinuxStorage.cpp | 3 +- src/platform/Linux/CHIPLinuxStorageIni.cpp | 46 ++++----- src/platform/NuttX/CHIPLinuxStorageIni.cpp | 50 ++++------ src/platform/webos/CHIPWebOSStorageIni.cpp | 50 ++++------ 8 files changed, 228 insertions(+), 93 deletions(-) create mode 100644 src/lib/support/FileDescriptor.h create mode 100644 src/lib/support/TemporaryFileStream.h diff --git a/scripts/tools/check_includes_config.py b/scripts/tools/check_includes_config.py index b5195f4ab05eda..2e79c6f8f9cfa9 100644 --- a/scripts/tools/check_includes_config.py +++ b/scripts/tools/check_includes_config.py @@ -180,6 +180,7 @@ 'src/lib/support/jsontlv/JsonToTlv.h': {'string'}, 'src/lib/support/jsontlv/TlvToJson.h': {'string'}, 'src/lib/support/jsontlv/TextFormat.h': {'string'}, + 'src/lib/support/TemporaryFileStream.h': {'ostream', 'streambuf', 'string'}, 'src/app/icd/client/DefaultICDClientStorage.cpp': {'vector'}, 'src/app/icd/client/DefaultICDClientStorage.h': {'vector'}, 'src/app/icd/client/DefaultICDStorageKey.h': {'vector'}, diff --git a/src/lib/support/BUILD.gn b/src/lib/support/BUILD.gn index 80b1b6d99dc328..3fd3d7e16754ca 100644 --- a/src/lib/support/BUILD.gn +++ b/src/lib/support/BUILD.gn @@ -206,6 +206,7 @@ static_library("support") { "Defer.h", "FibonacciUtils.cpp", "FibonacciUtils.h", + "FileDescriptor.h", "FixedBufferAllocator.cpp", "FixedBufferAllocator.h", "Fold.h", @@ -239,6 +240,7 @@ static_library("support") { "StringBuilder.cpp", "StringBuilder.h", "StringSplitter.h", + "TemporaryFileStream.h", "ThreadOperationalDataset.cpp", "ThreadOperationalDataset.h", "TimeUtils.cpp", diff --git a/src/lib/support/FileDescriptor.h b/src/lib/support/FileDescriptor.h new file mode 100644 index 00000000000000..8f5a00d6b315ad --- /dev/null +++ b/src/lib/support/FileDescriptor.h @@ -0,0 +1,62 @@ +/* + * + * 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. + */ + +#pragma once + +#include +#include + +namespace chip { + +/// Unix file descriptor wrapper with RAII semantics. +class FileDescriptor +{ +public: + FileDescriptor() = default; + explicit FileDescriptor(int fd) : mFd(fd) {} + ~FileDescriptor() { Close(); } + + /// Disallow copy and assignment. + FileDescriptor(const FileDescriptor &) = delete; + FileDescriptor & operator=(const FileDescriptor &) = delete; + + FileDescriptor(FileDescriptor && other) noexcept : mFd(other.Release()) {} + FileDescriptor & operator=(FileDescriptor && other) noexcept + { + Close(); + mFd = other.Release(); + return *this; + } + + int Get() const { return mFd; } + + int Release() { return std::exchange(mFd, -1); } + + int Close() + { + if (mFd != -1) + { + return close(std::exchange(mFd, -1)); + } + return 0; + } + +private: + int mFd = -1; +}; + +} // namespace chip diff --git a/src/lib/support/TemporaryFileStream.h b/src/lib/support/TemporaryFileStream.h new file mode 100644 index 00000000000000..a96a23917b23ce --- /dev/null +++ b/src/lib/support/TemporaryFileStream.h @@ -0,0 +1,107 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include +#include + +#include + +namespace chip { +namespace DeviceLayer { +namespace Internal { + +class FileDescriptorStreamBuf : public std::streambuf +{ +public: + FileDescriptorStreamBuf() = default; + explicit FileDescriptorStreamBuf(int fd) : mFd(fd) {} + + FileDescriptorStreamBuf(FileDescriptorStreamBuf &) = delete; + FileDescriptorStreamBuf & operator=(FileDescriptorStreamBuf &) = delete; + + FileDescriptorStreamBuf(FileDescriptorStreamBuf && other) = default; + FileDescriptorStreamBuf & operator=(FileDescriptorStreamBuf && other) = default; + +protected: + int overflow(int c) override + { + if (c != EOF) + { + char z = c; + if (write(mFd, &z, 1) != 1) + { + return EOF; + } + } + return c; + } + + std::streamsize xsputn(const char * s, std::streamsize n) override { return write(mFd, s, static_cast(n)); } + +private: + int mFd = -1; +}; + +/// File stream for a temporary file compatible with std::ostream. +class TemporaryFileStream : public std::ostream +{ +public: + TemporaryFileStream() : std::ostream(&mBuf) {} + explicit TemporaryFileStream(std::string nameTemplate) : std::ostream(&mBuf) { Open(std::move(nameTemplate)); }; + + /// Disallow copy and assignment. + TemporaryFileStream(const TemporaryFileStream &) = delete; + TemporaryFileStream & operator=(const TemporaryFileStream &) = delete; + + /// Open a temporary file with a given name template. + /// + /// In order to check if the file was opened successfully, use IsOpen(). + void Open(std::string nameTemplate) + { + mFileName = std::move(nameTemplate); + mFd = FileDescriptor(mkstemp(mFileName.data())); + mBuf = FileDescriptorStreamBuf(mFd.Get()); + } + + /// Check if the file was opened successfully. + /// + /// In case of failure, the error can be retrieved using errno. + bool IsOpen() const { return mFd.Get() != -1; }; + + /// Synchronize the file's contents with the underlying storage device. + /// + /// In case of failure, the error can be retrieved using errno. + bool DataSync() { return fdatasync(mFd.Get()) == 0; } + + /// Get the name of created temporary file. + const std::string & GetFileName() const { return mFileName; } + +private: + FileDescriptor mFd; + FileDescriptorStreamBuf mBuf; + std::string mFileName; +}; + +} // namespace Internal +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/Linux/CHIPLinuxStorage.cpp b/src/platform/Linux/CHIPLinuxStorage.cpp index 9a8afb59d706fa..f1ce35b58cb38c 100644 --- a/src/platform/Linux/CHIPLinuxStorage.cpp +++ b/src/platform/Linux/CHIPLinuxStorage.cpp @@ -53,7 +53,6 @@ CHIP_ERROR ChipLinuxStorage::Init(const char * configFile) { CHIP_ERROR retval = CHIP_NO_ERROR; - ChipLogDetail(DeviceLayer, "ChipLinuxStorage::Init: Using KVS config file: %s", StringOrNullMarker(configFile)); if (mInitialized) { ChipLogError(DeviceLayer, "ChipLinuxStorage::Init: Attempt to re-initialize with KVS config file: %s", @@ -61,6 +60,8 @@ CHIP_ERROR ChipLinuxStorage::Init(const char * configFile) return CHIP_NO_ERROR; } + ChipLogDetail(DeviceLayer, "ChipLinuxStorage::Init: Using KVS config file: %s", StringOrNullMarker(configFile)); + mConfigPath.assign(configFile); retval = ChipLinuxStorageIni::Init(); diff --git a/src/platform/Linux/CHIPLinuxStorageIni.cpp b/src/platform/Linux/CHIPLinuxStorageIni.cpp index 7186fe3d477fbf..6c629d29bd9451 100644 --- a/src/platform/Linux/CHIPLinuxStorageIni.cpp +++ b/src/platform/Linux/CHIPLinuxStorageIni.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -91,34 +92,23 @@ CHIP_ERROR ChipLinuxStorageIni::AddConfig(const std::string & configFile) // 3. Using rename() to overwrite the existing file CHIP_ERROR ChipLinuxStorageIni::CommitConfig(const std::string & configFile) { - CHIP_ERROR retval = CHIP_NO_ERROR; - std::string tmpPath = configFile + "-XXXXXX"; - - int fd = mkstemp(&tmpPath[0]); - if (fd != -1) - { - std::ofstream ofs; - ofs.open(tmpPath, std::ofstream::out | std::ofstream::trunc); - mConfigStore.generate(ofs); - close(fd); - - if (rename(tmpPath.c_str(), configFile.c_str()) == 0) - { - ChipLogDetail(DeviceLayer, "wrote settings to %s", configFile.c_str()); - } - else - { - ChipLogError(DeviceLayer, "failed to rename (%s), %s (%d)", tmpPath.c_str(), strerror(errno), errno); - retval = CHIP_ERROR_WRITE_FAILED; - } - } - else - { - ChipLogError(DeviceLayer, "failed to open file (%s) for writing", tmpPath.c_str()); - retval = CHIP_ERROR_OPEN_FAILED; - } - - return retval; + TemporaryFileStream tmpFile(configFile + "-XXXXXX"); + VerifyOrReturnError( + tmpFile.IsOpen(), CHIP_ERROR_OPEN_FAILED, + ChipLogError(DeviceLayer, "Failed to create temp file %s: %s", tmpFile.GetFileName().c_str(), strerror(errno))); + + mConfigStore.generate(tmpFile); + VerifyOrReturnError( + tmpFile.DataSync(), CHIP_ERROR_WRITE_FAILED, + ChipLogError(DeviceLayer, "Failed to sync temp file %s: %s", tmpFile.GetFileName().c_str(), strerror(errno))); + + int rv = rename(tmpFile.GetFileName().c_str(), configFile.c_str()); + VerifyOrReturnError(rv == 0, CHIP_ERROR_WRITE_FAILED, + ChipLogError(DeviceLayer, "Failed to rename %s to %s: %s", tmpFile.GetFileName().c_str(), + configFile.c_str(), strerror(errno))); + + ChipLogDetail(DeviceLayer, "Wrote settings to %s", configFile.c_str()); + return CHIP_NO_ERROR; } CHIP_ERROR ChipLinuxStorageIni::GetUInt16Value(const char * key, uint16_t & val) diff --git a/src/platform/NuttX/CHIPLinuxStorageIni.cpp b/src/platform/NuttX/CHIPLinuxStorageIni.cpp index e9dbe107ffad9e..686d04fc629e30 100644 --- a/src/platform/NuttX/CHIPLinuxStorageIni.cpp +++ b/src/platform/NuttX/CHIPLinuxStorageIni.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -91,38 +92,23 @@ CHIP_ERROR ChipLinuxStorageIni::AddConfig(const std::string & configFile) // 3. Using rename() to overwrite the existing file CHIP_ERROR ChipLinuxStorageIni::CommitConfig(const std::string & configFile) { - CHIP_ERROR retval = CHIP_NO_ERROR; - std::string tmpPath = configFile + "-XXXXXX"; - - int fd = mkstemp(&tmpPath[0]); - if (fd != -1) - { - std::ofstream ofs; - - ChipLogProgress(DeviceLayer, "writing settings to file (%s)", tmpPath.c_str()); - - ofs.open(tmpPath, std::ofstream::out | std::ofstream::trunc); - mConfigStore.generate(ofs); - - close(fd); - - if (rename(tmpPath.c_str(), configFile.c_str()) == 0) - { - ChipLogProgress(DeviceLayer, "renamed tmp file to file (%s)", configFile.c_str()); - } - else - { - ChipLogError(DeviceLayer, "failed to rename (%s), %s (%d)", tmpPath.c_str(), strerror(errno), errno); - retval = CHIP_ERROR_WRITE_FAILED; - } - } - else - { - ChipLogError(DeviceLayer, "failed to open file (%s) for writing", tmpPath.c_str()); - retval = CHIP_ERROR_OPEN_FAILED; - } - - return retval; + TemporaryFileStream tmpFile(configFile + "-XXXXXX"); + VerifyOrReturnError( + tmpFile.IsOpen(), CHIP_ERROR_OPEN_FAILED, + ChipLogError(DeviceLayer, "Failed to create temp file %s: %s", tmpFile.GetFileName().c_str(), strerror(errno))); + + mConfigStore.generate(tmpFile); + VerifyOrReturnError( + tmpFile.DataSync(), CHIP_ERROR_WRITE_FAILED, + ChipLogError(DeviceLayer, "Failed to sync temp file %s: %s", tmpFile.GetFileName().c_str(), strerror(errno))); + + int rv = rename(tmpFile.GetFileName().c_str(), configFile.c_str()); + VerifyOrReturnError(rv == 0, CHIP_ERROR_WRITE_FAILED, + ChipLogError(DeviceLayer, "Failed to rename %s to %s: %s", tmpFile.GetFileName().c_str(), + configFile.c_str(), strerror(errno))); + + ChipLogDetail(DeviceLayer, "Wrote settings to %s", configFile.c_str()); + return CHIP_NO_ERROR; } CHIP_ERROR ChipLinuxStorageIni::GetUInt16Value(const char * key, uint16_t & val) diff --git a/src/platform/webos/CHIPWebOSStorageIni.cpp b/src/platform/webos/CHIPWebOSStorageIni.cpp index 96a3002f1afeea..cec712da8f2495 100644 --- a/src/platform/webos/CHIPWebOSStorageIni.cpp +++ b/src/platform/webos/CHIPWebOSStorageIni.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -70,38 +71,23 @@ CHIP_ERROR ChipLinuxStorageIni::AddConfig(const std::string & configFile) // 3. Using rename() to overwrite the existing file CHIP_ERROR ChipLinuxStorageIni::CommitConfig(const std::string & configFile) { - CHIP_ERROR retval = CHIP_NO_ERROR; - std::string tmpPath = configFile + "-XXXXXX"; - - int fd = mkstemp(&tmpPath[0]); - if (fd != -1) - { - std::ofstream ofs; - - ChipLogProgress(DeviceLayer, "writing settings to file (%s)", tmpPath.c_str()); - - ofs.open(tmpPath, std::ofstream::out | std::ofstream::trunc); - mConfigStore.generate(ofs); - - close(fd); - - if (rename(tmpPath.c_str(), configFile.c_str()) == 0) - { - ChipLogProgress(DeviceLayer, "renamed tmp file to file (%s)", configFile.c_str()); - } - else - { - ChipLogError(DeviceLayer, "failed to rename (%s), %s (%d)", tmpPath.c_str(), strerror(errno), errno); - retval = CHIP_ERROR_WRITE_FAILED; - } - } - else - { - ChipLogError(DeviceLayer, "failed to open file (%s) for writing", tmpPath.c_str()); - retval = CHIP_ERROR_OPEN_FAILED; - } - - return retval; + TemporaryFileStream tmpFile(configFile + "-XXXXXX"); + VerifyOrReturnError( + tmpFile.IsOpen(), CHIP_ERROR_OPEN_FAILED, + ChipLogError(DeviceLayer, "Failed to create temp file %s: %s", tmpFile.GetFileName().c_str(), strerror(errno))); + + mConfigStore.generate(tmpFile); + VerifyOrReturnError( + tmpFile.DataSync(), CHIP_ERROR_WRITE_FAILED, + ChipLogError(DeviceLayer, "Failed to sync temp file %s: %s", tmpFile.GetFileName().c_str(), strerror(errno))); + + int rv = rename(tmpFile.GetFileName().c_str(), configFile.c_str()); + VerifyOrReturnError(rv == 0, CHIP_ERROR_WRITE_FAILED, + ChipLogError(DeviceLayer, "Failed to rename %s to %s: %s", tmpFile.GetFileName().c_str(), + configFile.c_str(), strerror(errno))); + + ChipLogDetail(DeviceLayer, "Wrote settings to %s", configFile.c_str()); + return CHIP_NO_ERROR; } CHIP_ERROR ChipLinuxStorageIni::GetUInt16Value(const char * key, uint16_t & val) From f89d5b980a1aece608f22602419ef7bd8467f915 Mon Sep 17 00:00:00 2001 From: Justin Wood Date: Thu, 5 Sep 2024 23:18:04 -0700 Subject: [PATCH 15/42] Updating XPC interfaces to pass along context, and fixing some retries (#35441) * Adding diffs * Restyled by clang-format * Cleaning up * Restyled by whitespace * Restyled by clang-format --------- Co-authored-by: Restyled.io --- .../Framework/CHIP/MTRDefines_Internal.h | 53 ++++++ .../Framework/CHIP/MTRDeviceController+XPC.mm | 8 +- .../Framework/CHIP/MTRDeviceController_XPC.h | 2 +- .../Framework/CHIP/MTRDeviceController_XPC.mm | 175 ++++++++++++++---- .../Framework/CHIP/MTRDevice_Concrete.mm | 60 +++--- .../Framework/CHIP/MTRDevice_Internal.h | 6 +- src/darwin/Framework/CHIP/MTRDevice_XPC.mm | 51 ++--- .../CHIP/XPC Protocol/MTRXPCClientProtocol.h | 3 - .../CHIP/XPC Protocol/MTRXPCServerProtocol.h | 3 - 9 files changed, 270 insertions(+), 91 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDefines_Internal.h b/src/darwin/Framework/CHIP/MTRDefines_Internal.h index 7894f31835a142..38de3a95f5d935 100644 --- a/src/darwin/Framework/CHIP/MTRDefines_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDefines_Internal.h @@ -111,3 +111,56 @@ typedef struct {} variable_hidden_by_mtr_hide; \ return outValue; \ } + +#ifndef MTR_OPTIONAL_ATTRIBUTE +#if __has_feature(objc_arc) +#define MTR_OPTIONAL_ATTRIBUTE(ATTRIBUTE, VALUE, DICTIONARY) \ + { \ + id valueToAdd = VALUE; \ + if (valueToAdd != nil) { \ + CFDictionarySetValue((CFMutableDictionaryRef) DICTIONARY, (CFStringRef) (__bridge const void *) ATTRIBUTE, (const void *) valueToAdd); \ + } \ + } +#else +#define MTR_OPTIONAL_ATTRIBUTE(ATTRIBUTE, VALUE, DICTIONARY) \ + { \ + id valueToAdd = VALUE; \ + if (valueToAdd != nil) { \ + CFDictionarySetValue((CFMutableDictionaryRef) DICTIONARY, (CFStringRef) (const void *) ATTRIBUTE, (const void *) valueToAdd); \ + } \ + } +#endif +#endif + +#ifndef MTR_OPTIONAL_COLLECTION_ATTRIBUTE +#define MTR_OPTIONAL_COLLECTION_ATTRIBUTE(ATTRIBUTE, COLLECTION, DICTIONARY) \ + if ([COLLECTION count] > 0) { \ + CFDictionarySetValue((CFMutableDictionaryRef) DICTIONARY, (CFStringRef) ATTRIBUTE, (const void *) COLLECTION); \ + } +#endif + +#ifndef MTR_OPTIONAL_NUMBER_ATTRIBUTE +#define MTR_OPTIONAL_NUMBER_ATTRIBUTE(ATTRIBUTE, NUMBER, DICTIONARY) \ + if ([NUMBER intValue] != 0) { \ + CFDictionarySetValue((CFMutableDictionaryRef) DICTIONARY, (CFStringRef) ATTRIBUTE, (const void *) NUMBER); \ + } +#endif + +#ifndef MTR_REMOVE_ATTRIBUTE +#define MTR_REMOVE_ATTRIBUTE(ATTRIBUTE, DICTIONARY) \ + if (ATTRIBUTE != nil && DICTIONARY) { \ + CFDictionaryRemoveValue((CFMutableDictionaryRef) DICTIONARY, (CFStringRef) ATTRIBUTE); \ + } +#endif + +#ifndef MTR_REQUIRED_ATTRIBUTE +#define MTR_REQUIRED_ATTRIBUTE(ATTRIBUTE, VALUE, DICTIONARY) \ + { \ + id valueToAdd = VALUE; \ + if (valueToAdd != nil) { \ + CFDictionarySetValue((CFMutableDictionaryRef) DICTIONARY, (CFStringRef) ATTRIBUTE, (const void *) valueToAdd); \ + } else { \ + MTR_LOG_ERROR("Warning, missing %@ to add to %s", ATTRIBUTE, #DICTIONARY); \ + } \ + } +#endif diff --git a/src/darwin/Framework/CHIP/MTRDeviceController+XPC.mm b/src/darwin/Framework/CHIP/MTRDeviceController+XPC.mm index 87ce5560381cca..1cd02e24648867 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController+XPC.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController+XPC.mm @@ -34,7 +34,13 @@ static NSSet * GetXPCAllowedClasses() { static NSSet * const sXPCAllowedClasses = [NSSet setWithArray:@[ - [NSString class], [NSNumber class], [NSData class], [NSArray class], [NSDictionary class], [NSError class] + [NSString class], + [NSNumber class], + [NSData class], + [NSArray class], + [NSDictionary class], + [NSError class], + [NSDate class], ]]; return sXPCAllowedClasses; } diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_XPC.h b/src/darwin/Framework/CHIP/MTRDeviceController_XPC.h index c891c10d726791..87218b1f391a66 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_XPC.h +++ b/src/darwin/Framework/CHIP/MTRDeviceController_XPC.h @@ -27,7 +27,7 @@ MTR_TESTABLE - (id)initWithUniqueIdentifier:(NSUUID *)UUID machServiceName:(NSString *)machServiceName options:(NSXPCConnectionOptions)options #endif - @property(atomic, retain, readwrite)NSXPCConnection * xpcConnection; + @property(nullable, atomic, retain, readwrite)NSXPCConnection * xpcConnection; @end diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm b/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm index 1bf0888ab3b2b4..c58514ed2496ec 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm @@ -19,6 +19,7 @@ #import "MTRDefines_Internal.h" #import "MTRDeviceController_Internal.h" #import "MTRDevice_XPC.h" +#import "MTRDevice_XPC_Internal.h" #import "MTRLogging_Internal.h" #import "MTRXPCClientProtocol.h" #import "MTRXPCServerProtocol.h" @@ -33,7 +34,10 @@ @interface MTRDeviceController_XPC () -@property (nonatomic, retain, readwrite) NSUUID * uniqueIdentifier; +@property (nonatomic, readwrite, retain) NSUUID * uniqueIdentifier; +@property (nonnull, atomic, readwrite, retain) MTRXPCDeviceControllerParameters * xpcParameters; +@property (atomic, readwrite, assign) NSTimeInterval xpcRetryTimeInterval; +@property (atomic, readwrite, assign) BOOL xpcConnectedOrConnecting; @end @@ -48,7 +52,15 @@ - (NSXPCInterface *)_interfaceForServerProtocol NSXPCInterface * interface = [NSXPCInterface interfaceWithProtocol:@protocol(MTRXPCServerProtocol)]; NSSet * allowedClasses = [NSSet setWithArray:@[ - [NSString class], [NSNumber class], [NSData class], [NSArray class], [NSDictionary class], [NSError class], [MTRCommandPath class], [MTRAttributePath class] + [NSString class], + [NSNumber class], + [NSData class], + [NSArray class], + [NSDictionary class], + [NSError class], + [MTRCommandPath class], + [MTRAttributePath class], + [NSDate class], ]]; [interface setClasses:allowedClasses @@ -62,7 +74,14 @@ - (NSXPCInterface *)_interfaceForClientProtocol { NSXPCInterface * interface = [NSXPCInterface interfaceWithProtocol:@protocol(MTRXPCClientProtocol)]; NSSet * allowedClasses = [NSSet setWithArray:@[ - [NSString class], [NSNumber class], [NSData class], [NSArray class], [NSDictionary class], [NSError class], [MTRAttributePath class] + [NSString class], + [NSNumber class], + [NSData class], + [NSArray class], + [NSDictionary class], + [NSError class], + [MTRAttributePath class], + [NSDate class], ]]; [interface setClasses:allowedClasses forSelector:@selector(device:receivedAttributeReport:) @@ -83,6 +102,114 @@ - (NSXPCInterface *)_interfaceForClientProtocol return [self.uniqueIdentifier UUIDString]; } +- (void)_startXPCConnectionRetry +{ + if (!self.xpcConnectedOrConnecting) { + MTR_LOG("%@: XPC Connection retry - Starting retry for XPC Connection", self); + self.xpcRetryTimeInterval = 0.5; + mtr_weakify(self); + + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t) (self.xpcRetryTimeInterval * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + mtr_strongify(self); + [self _xpcConnectionRetry]; + }); + } else { + MTR_LOG("%@: XPC Connection retry - Not starting retry for XPC Connection, already trying", self); + } +} + +- (void)_xpcConnectionRetry +{ + MTR_LOG("%@: XPC Connection retry - timer hit", self); + if (!self.xpcConnectedOrConnecting) { + if (![self _setupXPCConnection]) { +#if 0 // FIXME: Not sure why this retry is not working, but I will fix this later + MTR_LOG("%@: XPC Connection retry - Scheduling another retry", self); + self.xpcRetryTimeInterval = self.xpcRetryTimeInterval >= 1 ? self.xpcRetryTimeInterval * 2 : 1; + self.xpcRetryTimeInterval = MIN(60.0, self.xpcRetryTimeInterval); + mtr_weakify(self); + + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(self.xpcRetryTimeInterval * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + mtr_strongify(self); + [self _xpcConnectionRetry]; + }); +#else + MTR_LOG("%@: XPC Connection failed retry - bailing", self); +#endif + } else { + MTR_LOG("%@: XPC Connection retry - connection attempt successful", self); + } + } else { + MTR_LOG("%@: XPC Connection retry - Mid retry, or connected, stopping retry timer", self); + } +} + +- (BOOL)_setupXPCConnection +{ + self.xpcConnection = self.xpcParameters.xpcConnectionBlock(); + + MTR_LOG("%@ Set up XPC Connection: %@", self, self.xpcConnection); + if (self.xpcConnection) { + mtr_weakify(self); + self.xpcConnection.remoteObjectInterface = [self _interfaceForServerProtocol]; + + self.xpcConnection.exportedInterface = [self _interfaceForClientProtocol]; + self.xpcConnection.exportedObject = self; + + self.xpcConnection.interruptionHandler = ^{ + mtr_strongify(self); + MTR_LOG_ERROR("XPC Connection for device controller interrupted: %@", self.xpcParameters.uniqueIdentifier); + self.xpcConnectedOrConnecting = NO; + self.xpcConnection = nil; + [self _startXPCConnectionRetry]; + }; + + self.xpcConnection.invalidationHandler = ^{ + mtr_strongify(self); + MTR_LOG_ERROR("XPC Connection for device controller invalidated: %@", self.xpcParameters.uniqueIdentifier); + self.xpcConnectedOrConnecting = NO; + self.xpcConnection = nil; + [self _startXPCConnectionRetry]; + }; + + MTR_LOG("%@ Activating new XPC connection", self); + [self.xpcConnection activate]; + + [[self.xpcConnection synchronousRemoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) { + MTR_LOG_ERROR("Checkin error: %@", error); + }] deviceController:self.uniqueIdentifier checkInWithContext:[NSDictionary dictionary]]; + + // FIXME: Trying to kick all the MTRDevices attached to this controller to re-establish connections + // This state needs to be stored properly and re-established at connnection time + + MTR_LOG("%@ Starting existing NodeID Registration", self); + for (NSNumber * nodeID in [self.nodeIDToDeviceMap keyEnumerator]) { + MTR_LOG("%@ => Registering nodeID: %@", self, nodeID); + mtr_weakify(self); + + [[self.xpcConnection synchronousRemoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) { + mtr_strongify(self); + MTR_LOG_ERROR("%@ Registration error for device nodeID: %@ : %@", self, nodeID, error); + }] deviceController:self.uniqueIdentifier registerNodeID:nodeID]; + } + + __block BOOL barrierComplete = NO; + + [self.xpcConnection scheduleSendBarrierBlock:^{ + barrierComplete = YES; + MTR_LOG("%@: Barrier complete: %d", self, barrierComplete); + }]; + + MTR_LOG("%@ Done existing NodeID Registration, barrierComplete: %d", self, barrierComplete); + self.xpcConnectedOrConnecting = barrierComplete; + } else { + MTR_LOG_ERROR("%@ Failed to set up XPC Connection", self); + self.xpcConnectedOrConnecting = NO; + } + + return (self.xpcConnectedOrConnecting); +} + - (nullable instancetype)initWithParameters:(MTRDeviceControllerAbstractParameters *)parameters error:(NSError * __autoreleasing *)error { @@ -110,30 +237,12 @@ - (nullable instancetype)initWithParameters:(MTRDeviceControllerAbstractParamete return nil; } - self.xpcConnection = connectionBlock(); - self.uniqueIdentifier = UUID; + self.xpcParameters = xpcParameters; self.chipWorkQueue = dispatch_queue_create("MTRDeviceController_XPC_queue", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); self.nodeIDToDeviceMap = [NSMapTable strongToWeakObjectsMapTable]; + self.uniqueIdentifier = UUID; - MTR_LOG("Set up XPC Connection: %@", self.xpcConnection); - if (self.xpcConnection) { - self.xpcConnection.remoteObjectInterface = [self _interfaceForServerProtocol]; - - self.xpcConnection.exportedInterface = [self _interfaceForClientProtocol]; - self.xpcConnection.exportedObject = self; - - self.xpcConnection.interruptionHandler = ^{ - MTR_LOG_ERROR("XPC Connection for device controller interrupted: %@", UUID); - }; - - self.xpcConnection.invalidationHandler = ^{ - MTR_LOG_ERROR("XPC Connection for device controller invalidated: %@", UUID); - }; - - MTR_LOG("Activating new XPC connection"); - [self.xpcConnection activate]; - } else { - MTR_LOG_ERROR("Failed to set up XPC Connection"); + if (![self _setupXPCConnection]) { return nil; } } @@ -159,7 +268,7 @@ - (id)initWithUniqueIdentifier:(NSUUID *)UUID machServiceName:(NSString *)machSe self.xpcConnection.exportedObject = self; MTR_LOG("%s: resuming new XPC connection"); - [self.xpcConnection resume]; + [self.xpcConnection activate]; } else { MTR_LOG_ERROR("Failed to set up XPC Connection"); return nil; @@ -177,13 +286,7 @@ - (MTRDevice *)_setupDeviceForNodeID:(NSNumber *)nodeID prefetchedClusterData:(N os_unfair_lock_assert_owner(self.deviceMapLock); MTRDevice * deviceToReturn = [[MTRDevice_XPC alloc] initWithNodeID:nodeID controller:self]; - // If we're not running, don't add the device to our map. That would - // create a cycle that nothing would break. Just return the device, - // which will be in exactly the state it would be in if it were created - // while we were running and then we got shut down. - if ([self isRunning]) { - [self.nodeIDToDeviceMap setObject:deviceToReturn forKey:nodeID]; - } + [self.nodeIDToDeviceMap setObject:deviceToReturn forKey:nodeID]; MTR_LOG("%s: returning XPC device for node id %@", __PRETTY_FUNCTION__, nodeID); return deviceToReturn; } @@ -255,6 +358,14 @@ - (oneway void)deviceConfigurationChanged:(NSNumber *)nodeID [device deviceConfigurationChanged:nodeID]; } +- (oneway void)device:(NSNumber *)nodeID internalStateUpdated:(NSDictionary *)dictionary +{ + MTRDevice_XPC * device = (MTRDevice_XPC *) [self deviceForNodeID:nodeID]; + MTR_LOG("Received internalStateUpdated: %@ found device: %@", nodeID, device); + + [device device:nodeID internalStateUpdated:dictionary]; +} + #pragma mark - MTRDeviceController Protocol Client // Not Supported via XPC diff --git a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm index 70824dd9bcd7d1..f554d14f9e7215 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm +++ b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm @@ -254,8 +254,6 @@ @interface MTRDevice_Concrete () @property (nonatomic) ReadClient * currentReadClient; @property (nonatomic) SubscriptionCallback * currentSubscriptionCallback; // valid when and only when currentReadClient is valid -@property (nonatomic, weak) id privateInternalStateDelegate; - @end // Declaring selector so compiler won't complain about testing and calling it in _handleReportEnd @@ -468,31 +466,28 @@ - (NSString *)description - (NSDictionary *)_internalProperties { - id vidOrUnknown, pidOrUnknown; - - { - std::lock_guard lock(_descriptionLock); + NSMutableDictionary * properties = [NSMutableDictionary dictionary]; + std::lock_guard lock(_descriptionLock); - vidOrUnknown = _vid ?: @"Unknown"; - pidOrUnknown = _pid ?: @"Unknown"; - // id networkFeatures = _allNetworkFeatures; - // id internalDeviceState = _internalDeviceStateForDescription; - // id lastSubscriptionAttemptWait = _lastSubscriptionAttemptWaitForDescription; - // id mostRecentReportTime = _mostRecentReportTimeForDescription; - // id lastSubscriptionFailureTime = _lastSubscriptionFailureTimeForDescription; - } + MTR_OPTIONAL_ATTRIBUTE(kMTRDeviceInternalPropertyKeyVendorID, _vid, properties); + MTR_OPTIONAL_ATTRIBUTE(kMTRDeviceInternalPropertyKeyProductID, _pid, properties); + MTR_OPTIONAL_ATTRIBUTE(kMTRDeviceInternalPropertyNetworkFeatures, _allNetworkFeatures, properties); + MTR_OPTIONAL_ATTRIBUTE(kMTRDeviceInternalPropertyDeviceState, [NSNumber numberWithUnsignedInteger:_internalDeviceStateForDescription], properties); + MTR_OPTIONAL_ATTRIBUTE(kMTRDeviceInternalPropertyLastSubscriptionAttemptWait, [NSNumber numberWithUnsignedInt:_lastSubscriptionAttemptWaitForDescription], properties); + MTR_OPTIONAL_ATTRIBUTE(kMTRDeviceInternalPropertyMostRecentReportTime, _mostRecentReportTimeForDescription, properties); + MTR_OPTIONAL_ATTRIBUTE(kMTRDeviceInternalPropertyLastSubscriptionFailureTime, _lastSubscriptionFailureTimeForDescription, properties); - return @{ - kMTRDeviceInternalPropertyKeyVendorID : vidOrUnknown, - kMTRDeviceInternalPropertyKeyProductID : pidOrUnknown, - }; + return properties; } -- (void)_notifyPrivateInternalPropertiesDelegateOfChanges +- (void)_notifyDelegateOfPrivateInternalPropertiesChanges { - if ([self.privateInternalStateDelegate respondsToSelector:@selector(device:internalStateUpdated:)]) { - [self.privateInternalStateDelegate device:self.nodeID internalStateUpdated:[self _internalProperties]]; - } + os_unfair_lock_assert_owner(&self->_lock); + [self _callDelegatesWithBlock:^(id delegate) { + if ([delegate respondsToSelector:@selector(device:internalStateUpdated:)]) { + [delegate performSelector:@selector(device:internalStateUpdated:) withObject:self withObject:[self _internalProperties]]; + } + }]; } #pragma mark - Time Synchronization @@ -760,6 +755,8 @@ - (void)_delegateAdded [self _setupSubscriptionWithReason:@"delegate is set and subscription is needed"]; } } + + [self _notifyDelegateOfPrivateInternalPropertiesChanges]; } - (void)invalidate @@ -983,7 +980,7 @@ - (void)_changeInternalState:(MTRInternalDeviceState)state }]; /* END DRAGONS */ - [self _notifyPrivateInternalPropertiesDelegateOfChanges]; + [self _notifyDelegateOfPrivateInternalPropertiesChanges]; } } @@ -1185,7 +1182,7 @@ - (void)_handleResubscriptionNeededWithDelay:(NSNumber *)resubscriptionDelayMs std::lock_guard lock(_descriptionLock); _lastSubscriptionFailureTimeForDescription = _lastSubscriptionFailureTime; } - [self _notifyPrivateInternalPropertiesDelegateOfChanges]; + [self _notifyDelegateOfPrivateInternalPropertiesChanges]; deviceUsesThread = [self _deviceUsesThread]; // If a previous resubscription failed, remove the item from the subscription pool. @@ -1236,7 +1233,7 @@ - (void)_setLastSubscriptionAttemptWait:(uint32_t)lastSubscriptionAttemptWait _lastSubscriptionAttemptWaitForDescription = lastSubscriptionAttemptWait; } - [self _notifyPrivateInternalPropertiesDelegateOfChanges]; + [self _notifyDelegateOfPrivateInternalPropertiesChanges]; } - (void)_doHandleSubscriptionReset:(NSNumber * _Nullable)retryDelay @@ -1252,7 +1249,7 @@ - (void)_doHandleSubscriptionReset:(NSNumber * _Nullable)retryDelay std::lock_guard lock(_descriptionLock); _lastSubscriptionFailureTimeForDescription = _lastSubscriptionFailureTime; } - [self _notifyPrivateInternalPropertiesDelegateOfChanges]; + [self _notifyDelegateOfPrivateInternalPropertiesChanges]; // if there is no delegate then also do not retry if (![self _delegateExists]) { @@ -1310,6 +1307,7 @@ - (void)_doHandleSubscriptionReset:(NSNumber * _Nullable)retryDelay // For non-Thread-enabled devices, just call the resubscription block after the specified time dispatch_after(dispatch_time(DISPATCH_TIME_NOW, resubscriptionDelayNs), self.queue, resubscriptionBlock); } + [self _notifyDelegateOfPrivateInternalPropertiesChanges]; } - (void)_reattemptSubscriptionNowIfNeededWithReason:(NSString *)reason @@ -1507,7 +1505,7 @@ - (void)unitTestSetMostRecentReportTimes:(NSMutableArray *)mostRecentR std::lock_guard lock(_descriptionLock); _mostRecentReportTimeForDescription = [mostRecentReportTimes lastObject]; } - [self _notifyPrivateInternalPropertiesDelegateOfChanges]; + [self _notifyDelegateOfPrivateInternalPropertiesChanges]; } #endif @@ -1566,7 +1564,6 @@ - (void)_scheduleClusterDataPersistence std::lock_guard lock(_descriptionLock); _mostRecentReportTimeForDescription = [_mostRecentReportTimes lastObject]; } - [self _notifyPrivateInternalPropertiesDelegateOfChanges]; // Calculate running average and update multiplier - need at least 2 items to calculate intervals if (_mostRecentReportTimes.count > 2) { @@ -1613,6 +1610,8 @@ - (void)_scheduleClusterDataPersistence } } + [self _notifyDelegateOfPrivateInternalPropertiesChanges]; + // Do not schedule persistence if device is reporting excessively if ([self _deviceIsReportingExcessively]) { return; @@ -1637,7 +1636,6 @@ - (void)_resetStorageBehaviorState std::lock_guard lock(_descriptionLock); _mostRecentReportTimeForDescription = nil; } - [self _notifyPrivateInternalPropertiesDelegateOfChanges]; _deviceReportingExcessivelyStartTime = nil; _reportToPersistenceDelayCurrentMultiplier = 1; @@ -1646,6 +1644,8 @@ - (void)_resetStorageBehaviorState if ([self _dataStoreExists]) { [self _persistClusterData]; } + + [self _notifyDelegateOfPrivateInternalPropertiesChanges]; } - (void)setStorageBehaviorConfiguration:(MTRDeviceStorageBehaviorConfiguration *)storageBehaviorConfiguration @@ -1699,6 +1699,8 @@ - (void)_handleReportEnd } }]; #endif + + [self _notifyDelegateOfPrivateInternalPropertiesChanges]; } - (BOOL)_interestedPaths:(NSArray * _Nullable)interestedPaths includesAttributePath:(MTRAttributePath *)attributePath diff --git a/src/darwin/Framework/CHIP/MTRDevice_Internal.h b/src/darwin/Framework/CHIP/MTRDevice_Internal.h index c3b6b60fa6314e..baa34399bdb4d4 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDevice_Internal.h @@ -225,6 +225,10 @@ static NSString * const sLastInitialSubscribeLatencyKey = @"lastInitialSubscribe // Concrete to XPC internal state property dictionary keys static NSString * const kMTRDeviceInternalPropertyKeyVendorID = @"MTRDeviceInternalStateKeyVendorID"; static NSString * const kMTRDeviceInternalPropertyKeyProductID = @"MTRDeviceInternalStateKeyProductID"; -// TODO: more internal properties +static NSString * const kMTRDeviceInternalPropertyNetworkFeatures = @"MTRDeviceInternalPropertyNetworkFeatures"; +static NSString * const kMTRDeviceInternalPropertyDeviceState = @"MTRDeviceInternalPropertyDeviceState"; +static NSString * const kMTRDeviceInternalPropertyLastSubscriptionAttemptWait = @"kMTRDeviceInternalPropertyLastSubscriptionAttemptWait"; +static NSString * const kMTRDeviceInternalPropertyMostRecentReportTime = @"MTRDeviceInternalPropertyMostRecentReportTime"; +static NSString * const kMTRDeviceInternalPropertyLastSubscriptionFailureTime = @"MTRDeviceInternalPropertyLastSubscriptionFailureTime"; NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/MTRDevice_XPC.mm b/src/darwin/Framework/CHIP/MTRDevice_XPC.mm index 7267eb3a2b4f7e..5279933104a11c 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_XPC.mm +++ b/src/darwin/Framework/CHIP/MTRDevice_XPC.mm @@ -103,32 +103,35 @@ - (void)dealloc - (NSString *)description { - // TODO: Figure out whether, and if so how, to log: VID, PID, WiFi, Thread, - // internalDeviceState (do we even have such a thing here?), last - // subscription attempt wait (does that apply to us?) queued work (do we - // have any?), last report, last subscription failure (does that apply to us?). - return [NSString - stringWithFormat:@"<%@: %p, node: %016llX-%016llX (%llu), VID: %@, PID: %@, controller: %@>", NSStringFromClass(self.class), self, _deviceController.compressedFabricID.unsignedLongLongValue, _nodeID.unsignedLongLongValue, _nodeID.unsignedLongLongValue, [self _vid], [self _pid], _deviceController.uniqueIdentifier]; -} + NSString * wifi; + NSString * thread; + NSNumber * networkFeatures = [self._internalState objectForKey:kMTRDeviceInternalPropertyNetworkFeatures]; -- (nullable NSNumber *)_internalStateNumberOrNilForKey:(NSString *)key -{ - if ([_internalState[key] isKindOfClass:NSNumber.class]) { - NSNumber * number = _internalState[key]; - return number; + if (networkFeatures == nil) { + wifi = @"NO"; + thread = @"NO"; } else { - return nil; + wifi = YES_NO(networkFeatures.unsignedLongLongValue & MTRNetworkCommissioningFeatureWiFiNetworkInterface); + thread = YES_NO(networkFeatures.unsignedLongLongValue & MTRNetworkCommissioningFeatureThreadNetworkInterface); } -} -- (nullable NSNumber *)_vid -{ - return [self _internalStateNumberOrNilForKey:kMTRDeviceInternalPropertyKeyVendorID]; -} + // TODO: Add these to the description + // MTR_OPTIONAL_ATTRIBUTE(kMTRDeviceInternalPropertyDeviceState, _internalDeviceStateForDescription, properties); + // MTR_OPTIONAL_ATTRIBUTE(kMTRDeviceInternalPropertyLastSubscriptionAttemptWait, _lastSubscriptionAttemptWaitForDescription, properties); + // MTR_OPTIONAL_ATTRIBUTE(kMTRDeviceInternalPropertyMostRecentReportTime, _mostRecentReportTimeForDescription, properties); + // MTR_OPTIONAL_ATTRIBUTE(kMTRDeviceInternalPropertyLastSubscriptionFailureTime, _lastSubscriptionFailureTimeForDescription, properties); -- (nullable NSNumber *)_pid -{ - return [self _internalStateNumberOrNilForKey:kMTRDeviceInternalPropertyKeyProductID]; + return [NSString + stringWithFormat:@"<%@: %p, node: %016llX-%016llX (%llu), VID: %@, PID: %@, WiFi: %@, Thread: %@, controller: %@>", + NSStringFromClass(self.class), self, + _deviceController.compressedFabricID.unsignedLongLongValue, + _nodeID.unsignedLongLongValue, + _nodeID.unsignedLongLongValue, + [self._internalState objectForKey:kMTRDeviceInternalPropertyKeyVendorID], + [self._internalState objectForKey:kMTRDeviceInternalPropertyKeyProductID], + wifi, + thread, + _deviceController.uniqueIdentifier]; } #pragma mark - Client Callbacks (MTRDeviceDelegate) @@ -187,6 +190,12 @@ - (oneway void)deviceConfigurationChanged:(NSNumber *)nodeID }]; } +- (oneway void)device:(NSNumber *)nodeID internalStateUpdated:(NSDictionary *)dictionary +{ + [self _setInternalState:dictionary]; + MTR_LOG("%@ internal state updated", self); +} + #pragma mark - Remote Commands MTR_DEVICE_SIMPLE_REMOTE_XPC_GETTER(state, MTRDeviceState, MTRDeviceStateUnknown, getStateWithReply) diff --git a/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCClientProtocol.h b/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCClientProtocol.h index b26b6d88849193..cfa59db8a73303 100644 --- a/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCClientProtocol.h +++ b/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCClientProtocol.h @@ -27,9 +27,6 @@ MTR_NEWLY_AVAILABLE - (oneway void)deviceBecameActive:(NSNumber *)nodeID; - (oneway void)deviceCachePrimed:(NSNumber *)nodeID; - (oneway void)deviceConfigurationChanged:(NSNumber *)nodeID; - -@optional -// temporarily optional to avoid lockstep needs - (oneway void)device:(NSNumber *)nodeID internalStateUpdated:(NSDictionary *)dictionary; @end diff --git a/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCServerProtocol.h b/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCServerProtocol.h index 1ebdea5d3757ec..52a5d2228fa524 100644 --- a/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCServerProtocol.h +++ b/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCServerProtocol.h @@ -70,9 +70,6 @@ MTR_NEWLY_AVAILABLE //- (oneway void)deviceController:(NSUUID *)controller removeServerEndpoint:(MTRServerEndpoint *)endpoint; - (oneway void)deviceController:(NSUUID *)controller shutdownDeviceController:(NSUUID *)controller; - -@optional -// register / unregister temporarily optional to avoid lockstep needs - (oneway void)deviceController:(NSUUID *)controller registerNodeID:(NSNumber *)nodeID; - (oneway void)deviceController:(NSUUID *)controller unregisterNodeID:(NSNumber *)nodeID; From 0b696d89fa591199e319ca319e821be347806631 Mon Sep 17 00:00:00 2001 From: Wille Backman Date: Fri, 6 Sep 2024 11:22:55 +0300 Subject: [PATCH 16/42] [nrfconnect] Link updates in documentation (#35251) * [nrfconnect] Link updates in documentation The nRF Connect documentation has changed to a new address. This updates all existing links to point there. Signed-off-by: Wille Backman * Restyled by prettier-markdown --------- Signed-off-by: Wille Backman Co-authored-by: Restyled.io --- .../nrfconnect_examples_configuration.md | 8 ++++---- .../nrfconnect_examples_software_update.md | 20 +++++++++---------- .../nrfconnect_factory_data_configuration.md | 6 +++--- docs/guides/nrfconnect_platform_overview.md | 16 +++++++-------- docs/guides/openthread_rcp_nrf_dongle.md | 6 +++--- 5 files changed, 28 insertions(+), 28 deletions(-) diff --git a/docs/guides/nrfconnect_examples_configuration.md b/docs/guides/nrfconnect_examples_configuration.md index 1e74d2f4e097ea..d2a135ebdf6d9a 100644 --- a/docs/guides/nrfconnect_examples_configuration.md +++ b/docs/guides/nrfconnect_examples_configuration.md @@ -25,7 +25,7 @@ Regardless of the option, you will need to rebuild your application. This will require you to provide the build target name of the kit you are using. You can find the build target names in the Requirements section of the example you are building or on the -[Board support](https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/app_dev/board_support/index.html) +[Board support](https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/app_dev/board_support/index.html) page in the nRF Connect SDK documentation. ### Temporary changes to configuration @@ -97,7 +97,7 @@ them values of proper type. Few examples: `CONFIG_SAMPLE_STRING_OPTION="some_text"` For more detailed information, read about -[setting Kconfig values](https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/kconfig/setting.html#setting-configuration-values) +[setting Kconfig values](https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/build/kconfig/setting.html) in the nRF Connect SDK documentation. Because Kconfig configuration files are used in the building process, make sure @@ -150,7 +150,7 @@ from your perspective: $ west build -b build-target -- -DOVERLAY_CONFIG=overlay_file_name Read the -[Kconfig](https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/kconfig/index.html#kconfig) +[Kconfig](https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/build/kconfig/index.html) guide in the nRF Connect SDK's Zephyr documentation if you are interested in getting more advanced and detailed information about the configuration structure. @@ -214,7 +214,7 @@ performance in case it has been polluted with unwanted entries. #### Logging You can enable logging for both the stack and Zephyr’s -[Logging](https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/reference/logging/index.html#logging-api) +[Logging](https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/services/logging/index.html) API by setting the `CONFIG_LOG` option. Zephyr allows you to configure log levels of different software modules diff --git a/docs/guides/nrfconnect_examples_software_update.md b/docs/guides/nrfconnect_examples_software_update.md index 9fc1f6e6e5bd3e..d295bae47667a3 100644 --- a/docs/guides/nrfconnect_examples_software_update.md +++ b/docs/guides/nrfconnect_examples_software_update.md @@ -6,7 +6,7 @@ protocols: - Matter-compliant OTA update protocol that uses the Matter operational network for querying and downloading a new firmware image. -- [Simple Management Protocol](https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/services/device_mgmt/smp_protocol.html) +- [Simple Management Protocol](https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/services/device_mgmt/smp_protocol.html) over Bluetooth LE. In this case, the DFU can be done either using a smartphone application or a PC command line tool. Note that this protocol is not part of the Matter specification. @@ -125,11 +125,9 @@ rebooted to apply the update. To upgrade your device firmware over Bluetooth LE using a smartphone, complete the following steps: -1. Install _one_ of the following applications on your smartphone: - - - [nRF Connect for Mobile](https://www.nordicsemi.com/Software-and-Tools/Development-Tools/nRF-Connect-for-mobile) - - [nRF Toolbox](https://www.nordicsemi.com/Software-and-Tools/Development-Tools/nRF-Toolbox) - +1. Install the + [nRF Connect Device Manager](https://www.nordicsemi.com/Products/Development-tools/nrf-connect-device-manager) + application on your smartphone. 2. Push the appropriate button on the device to enable the software update functionality (if it is not enabled by default) and start the Bluetooth LE advertising of the SMP service. See the user interface section in the example @@ -138,8 +136,10 @@ the following steps: advertising. See the user interface section in the example documentation to check the button number. 4. Follow the instructions about downloading the new image to a device on the - [FOTA upgrades](https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/working_with_nrf/nrf52/developing.html#fota-updates) - page in the nRF Connect SDK documentation. + FOTA updates page for either + [nRF52 Series devices](https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/app_dev/device_guides/nrf52/fota_update.html) + or the + [nRF5340 DK](https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/app_dev/device_guides/nrf53/fota_update_nrf5340.html).
@@ -171,7 +171,7 @@ Complete the following steps to perform DFU using mcumgr: > (for example, `MatterLock`). 1. Install the tool by following the - [mcumgr command line tool installation instructions](https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/device_mgmt/index.html#command-line-tool). + [mcumgr command line tool installation instructions](https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/services/device_mgmt/mcumgr.html#command-line_tool). 2. Push the appropriate button on the device to enable the software update functionality (if it is not enabled by default) and start the Bluetooth LE advertising of SMP service. See the user interface section in the example @@ -342,6 +342,6 @@ Swapping operation can take some time, and after it completes, the new firmware is booted. Visit the -[mcumgr image management](https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/device_mgmt/indexhtml#image-management) +[mcumgr image management](https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/services/device_mgmt/mcumgr.html#image_management) section to get familiar with all image management commands supported by the tool. diff --git a/docs/guides/nrfconnect_factory_data_configuration.md b/docs/guides/nrfconnect_factory_data_configuration.md index 27595e2888d616..886acc9b3049d3 100644 --- a/docs/guides/nrfconnect_factory_data_configuration.md +++ b/docs/guides/nrfconnect_factory_data_configuration.md @@ -24,7 +24,7 @@ data secure by applying hardware write protection. > **Note:** Due to hardware limitations, in the nRF Connect platform, protection > against writing can be applied only to the internal memory partition. The -> [Fprotect](https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/libraries/others/fprotect.html) +> [Fprotect](https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/libraries/security/bootloader/fprotect.html) > is the hardware flash protection driver, and we used it to ensure write > protection of the factory data partition in internal flash memory. @@ -643,7 +643,7 @@ $ west build -b nrf52840dk_nrf52840 -- \ The factory data partition is an area in the device's persistent storage where a factory data set is stored. This area is configured using the -[Partition Manager](https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/scripts/partition_manager/partition_manager.html), +[Partition Manager](https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/scripts/partition_manager/partition_manager.html), within which all partitions are declared in the `pm_static.yml` file. To prepare an example that supports factory data, add a partition called @@ -845,7 +845,7 @@ snippet: > **Note:** To get more information about how to use the interactive Kconfig > interfaces, read the -> [Kconfig documentation](https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/build/kconfig/menuconfig.html). +> [Kconfig documentation](https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/build/kconfig/menuconfig.html). ### Default Kconfig values and developing aspects diff --git a/docs/guides/nrfconnect_platform_overview.md b/docs/guides/nrfconnect_platform_overview.md index ed04f302d72e71..8c570a67899b14 100644 --- a/docs/guides/nrfconnect_platform_overview.md +++ b/docs/guides/nrfconnect_platform_overview.md @@ -18,7 +18,7 @@ communication purposes: ## nRF Connect SDK Nordic Semiconductor's -[nRF Connect SDK](https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/index.html) +[nRF Connect SDK](https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/index.html) allows to build a range of applications, including cellular IoT (LTE-M and NB-IoT), Bluetooth Low Energy, Thread, Zigbee, and Bluetooth mesh. The SDK contains samples, libraries and a full set of drivers for Nordic Semiconductor's @@ -57,8 +57,8 @@ Bluetooth LE concurrently with other stacks on the same radio chip. Read more in the nRF Connect SDK documentation: -- [SoftDevice Controller](https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfxlib/softdevice_controller/README.html) -- [Multiprotocol Service Layer](https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfxlib/mpsl/README.html) +- [SoftDevice Controller](https://docs.nordicsemi.com/bundle/ncs-latest/page/nrfxlib/softdevice_controller/README.html) +- [Multiprotocol Service Layer](https://docs.nordicsemi.com/bundle/ncs-latest/page/nrfxlib/mpsl/README.html)
@@ -72,9 +72,9 @@ network layer functionalities provided by the Zephyr. Read more in the nRF Connect SDK documentation: -- [Multiprotocol Service Layer](https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfxlib/mpsl/README.html) -- [nRF 802.15.4 Radio Driver](https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfxlib/nrf_802154/README.html) -- [OpenThread integration](https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/protocols/thread/overview/ot_integration.html) +- [Multiprotocol Service Layer](https://docs.nordicsemi.com/bundle/ncs-latest/page/nrfxlib/mpsl/README.html) +- [nRF 802.15.4 Radio Driver](https://docs.nordicsemi.com/bundle/ncs-latest/page/nrfxlib/nrf_802154/README.html) +- [OpenThread integration](https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/protocols/thread/overview/ot_integration.html)
@@ -105,7 +105,7 @@ agnostic interfaces and no additional platform-related actions are needed to perform communication through the Matter stack. For more information, see the -[Matter integration in the nRF Connect SDK](https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/protocols/matter/overview/integration.html) +[Matter integration in the nRF Connect SDK](https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/protocols/matter/overview/integration.html) page in the SDK documentation.
@@ -126,5 +126,5 @@ library file is imported during the compilation process. For more information about the build system in Zephyr and the nRF Connect SDK, see the -[Build and configuration system](https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/app_dev/build_and_config_system/index.html) +[Build and configuration system](https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/app_dev/config_and_build/config_and_build_system.html) page in the SDK documentation. diff --git a/docs/guides/openthread_rcp_nrf_dongle.md b/docs/guides/openthread_rcp_nrf_dongle.md index 57bb716a3ff0d0..e1a9f90a0509b6 100644 --- a/docs/guides/openthread_rcp_nrf_dongle.md +++ b/docs/guides/openthread_rcp_nrf_dongle.md @@ -13,14 +13,14 @@ Once programmed, the dongle can be used for ## Requirements You need to set up the -[nRF Connect SDK](https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/index.html) +[nRF Connect SDK](https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/index.html) to build and program the OpenThread Radio Co-Processor to the nRF52840 Dongle. Read the -[nRF Connect SDK Getting started](https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/getting_started.html) +[nRF Connect SDK installation](https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/installation.html) documentation for more information. ## Building and programming the RCP firmware onto an nRF52840 Dongle After you set up the nRF Connect SDK, follow the steps in the -[Configuring a radio co-processor](https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/ug_thread_tools.html#configuring-a-radio-co-processor) +[Configuring a radio co-processor](https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/protocols/thread/tools.html#configuring_a_radio_co-processor) section for the nRF52840 Dongle (USB transport). From d5f0606e2eabc51b5dba216800f87ac2aee3e30e Mon Sep 17 00:00:00 2001 From: C Freeman Date: Fri, 6 Sep 2024 08:16:16 -0400 Subject: [PATCH 17/42] Switch: Fix cluster revision in XML to match new spec (#35440) * Change XML file * Zap regen --- .../all-clusters-common/all-clusters-app.matter | 2 +- .../all-clusters-common/all-clusters-minimal-app.matter | 2 +- examples/bridge-app/bridge-common/bridge-app.matter | 2 +- .../chef/devices/rootnode_genericswitch_2dfff6e516.matter | 2 +- .../chef/devices/rootnode_genericswitch_9866e35d0b.matter | 2 +- .../light-switch-common/light-switch-app.matter | 2 +- examples/light-switch-app/qpg/zap/switch.matter | 2 +- .../lighting-common/lighting-app.matter | 2 +- examples/lighting-app/lighting-common/lighting-app.matter | 2 +- examples/placeholder/linux/apps/app1/config.matter | 4 ++-- examples/placeholder/linux/apps/app2/config.matter | 4 ++-- src/app/zap-templates/zcl/data-model/chip/switch-cluster.xml | 2 +- src/controller/data_model/controller-clusters.matter | 2 +- 13 files changed, 15 insertions(+), 15 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 8debb1a4930f33..06a034512fc199 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -2554,7 +2554,7 @@ cluster TimeSynchronization = 56 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ cluster Switch = 59 { - revision 1; + revision 2; bitmap Feature : bitmap32 { kLatchingSwitch = 0x1; diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter index 7c209b80465f18..77ad5a9fc5d0a5 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter @@ -2286,7 +2286,7 @@ cluster EthernetNetworkDiagnostics = 55 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ cluster Switch = 59 { - revision 1; + revision 2; bitmap Feature : bitmap32 { kLatchingSwitch = 0x1; diff --git a/examples/bridge-app/bridge-common/bridge-app.matter b/examples/bridge-app/bridge-common/bridge-app.matter index f1cdf949a70524..d64624281236cc 100644 --- a/examples/bridge-app/bridge-common/bridge-app.matter +++ b/examples/bridge-app/bridge-common/bridge-app.matter @@ -1921,7 +1921,7 @@ cluster EthernetNetworkDiagnostics = 55 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ cluster Switch = 59 { - revision 1; + revision 2; bitmap Feature : bitmap32 { kLatchingSwitch = 0x1; diff --git a/examples/chef/devices/rootnode_genericswitch_2dfff6e516.matter b/examples/chef/devices/rootnode_genericswitch_2dfff6e516.matter index 9c8d9477b2c0ef..98e363345d855c 100644 --- a/examples/chef/devices/rootnode_genericswitch_2dfff6e516.matter +++ b/examples/chef/devices/rootnode_genericswitch_2dfff6e516.matter @@ -1251,7 +1251,7 @@ cluster GeneralDiagnostics = 51 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ cluster Switch = 59 { - revision 1; + revision 2; bitmap Feature : bitmap32 { kLatchingSwitch = 0x1; diff --git a/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter b/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter index a083afc80331bc..57040749ebc510 100644 --- a/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter +++ b/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter @@ -1251,7 +1251,7 @@ cluster GeneralDiagnostics = 51 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ cluster Switch = 59 { - revision 1; + revision 2; bitmap Feature : bitmap32 { kLatchingSwitch = 0x1; diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.matter b/examples/light-switch-app/light-switch-common/light-switch-app.matter index a18f0c9724cda2..46dd0d70bf43da 100644 --- a/examples/light-switch-app/light-switch-common/light-switch-app.matter +++ b/examples/light-switch-app/light-switch-common/light-switch-app.matter @@ -1897,7 +1897,7 @@ cluster TimeSynchronization = 56 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ cluster Switch = 59 { - revision 1; + revision 2; bitmap Feature : bitmap32 { kLatchingSwitch = 0x1; diff --git a/examples/light-switch-app/qpg/zap/switch.matter b/examples/light-switch-app/qpg/zap/switch.matter index 23033c78bffda8..dd41fdbcad9541 100644 --- a/examples/light-switch-app/qpg/zap/switch.matter +++ b/examples/light-switch-app/qpg/zap/switch.matter @@ -1953,7 +1953,7 @@ cluster ThreadNetworkDiagnostics = 53 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ cluster Switch = 59 { - revision 1; + revision 2; bitmap Feature : bitmap32 { kLatchingSwitch = 0x1; diff --git a/examples/lighting-app-data-mode-no-unique-id/lighting-common/lighting-app.matter b/examples/lighting-app-data-mode-no-unique-id/lighting-common/lighting-app.matter index c19c7d7bf8e67a..8b88e7d961fe5f 100644 --- a/examples/lighting-app-data-mode-no-unique-id/lighting-common/lighting-app.matter +++ b/examples/lighting-app-data-mode-no-unique-id/lighting-common/lighting-app.matter @@ -1803,7 +1803,7 @@ cluster EthernetNetworkDiagnostics = 55 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ cluster Switch = 59 { - revision 1; + revision 2; bitmap Feature : bitmap32 { kLatchingSwitch = 0x1; diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index 16e722d746b3d1..1fe4d7929d37fa 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -1803,7 +1803,7 @@ cluster EthernetNetworkDiagnostics = 55 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ cluster Switch = 59 { - revision 1; + revision 2; bitmap Feature : bitmap32 { kLatchingSwitch = 0x1; diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index bf5e6d6b75af16..de9603d2627962 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -2711,7 +2711,7 @@ cluster BridgedDeviceBasicInformation = 57 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ cluster Switch = 59 { - revision 1; + revision 2; bitmap Feature : bitmap32 { kLatchingSwitch = 0x1; @@ -2767,7 +2767,7 @@ cluster Switch = 59 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ cluster Switch = 59 { - revision 1; + revision 2; bitmap Feature : bitmap32 { kLatchingSwitch = 0x1; diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 26651684750454..2b6528d55ad018 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -2668,7 +2668,7 @@ cluster BridgedDeviceBasicInformation = 57 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ cluster Switch = 59 { - revision 1; + revision 2; bitmap Feature : bitmap32 { kLatchingSwitch = 0x1; @@ -2724,7 +2724,7 @@ cluster Switch = 59 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ cluster Switch = 59 { - revision 1; + revision 2; bitmap Feature : bitmap32 { kLatchingSwitch = 0x1; diff --git a/src/app/zap-templates/zcl/data-model/chip/switch-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/switch-cluster.xml index 72630933a26479..176163fae7fce6 100644 --- a/src/app/zap-templates/zcl/data-model/chip/switch-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/switch-cluster.xml @@ -28,7 +28,7 @@ Two types of switch devices are supported: latching switch (e.g. rocker switch) Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. - + diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index ea7ab01b39d2dd..412550214b68ec 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -2594,7 +2594,7 @@ cluster BridgedDeviceBasicInformation = 57 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ cluster Switch = 59 { - revision 1; + revision 2; bitmap Feature : bitmap32 { kLatchingSwitch = 0x1; From 48de74cd707bb289f75d9ea6c79c9cb9d181372a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Fri, 6 Sep 2024 14:32:22 +0200 Subject: [PATCH 18/42] Fix contact-sensor-app example binary name (#35436) * Update README.md Fix contact-sensor-app example binary name * Update README.md --- examples/contact-sensor-app/linux/README.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/examples/contact-sensor-app/linux/README.md b/examples/contact-sensor-app/linux/README.md index f99162f4fdee10..e71ea89feb7eab 100644 --- a/examples/contact-sensor-app/linux/README.md +++ b/examples/contact-sensor-app/linux/README.md @@ -69,11 +69,6 @@ details. ## Running the Complete Example on Raspberry Pi 4 -> If you want to test Echo protocol, please enable Echo handler -> -> gn gen out/debug --args='chip_app_use_echo=true' -> ninja -C out/debug - - Prerequisites 1. A Raspberry Pi 4 board @@ -112,7 +107,7 @@ details. $ cd ~/connectedhomeip/examples/contact-sensor-app/linux $ sudo out/debug/chip-contact-sensor-app --ble-device [bluetooth device number] # In this example, the device we want to use is hci1 - $ sudo out/debug/chip-contact-sensor-app --ble-device 1 + $ sudo out/debug/contact-sensor-app --ble-device 1 - Test the device using ChipDeviceController on your laptop / workstation etc. From 6b60ea8308aa1d116b5796dae2f934fec4bcdea3 Mon Sep 17 00:00:00 2001 From: C Freeman Date: Fri, 6 Sep 2024 09:02:27 -0400 Subject: [PATCH 19/42] MACL followup: addressing review comments in last PR (#35423) https://github.com/project-chip/connectedhomeip/pull/35413#discussion_r1744623732 --- src/python_testing/TC_ACL_2_11.py | 6 ++-- src/python_testing/TestConformanceTest.py | 30 +++++++++---------- .../basic_composition_support.py | 21 ++++++++----- 3 files changed, 32 insertions(+), 25 deletions(-) diff --git a/src/python_testing/TC_ACL_2_11.py b/src/python_testing/TC_ACL_2_11.py index a580cc2575017e..f5ebed221b272b 100644 --- a/src/python_testing/TC_ACL_2_11.py +++ b/src/python_testing/TC_ACL_2_11.py @@ -105,11 +105,11 @@ async def test_TC_ACL_2_11(self): self.step(1) wildcard_read = (await dev_ctrl.Read(self.dut_node_id, [()])) - has_arl, has_carl = arls_populated(wildcard_read.tlvAttributes) + arl_data = arls_populated(wildcard_read.tlvAttributes) asserts.assert_true( - has_arl, "ARL attribute must contain at least one restriction to run this test. Please follow manufacturer-specific steps to add access restrictions and re-run this test") + arl_data.have_arl, "ARL attribute must contain at least one restriction to run this test. Please follow manufacturer-specific steps to add access restrictions and re-run this test") asserts.assert_true( - has_carl, "CommissioningARL attribute must contain at least one restriction to run this test. Please follow manufacturer-specific steps to add access restrictions and re-run this test") + arl_data.have_carl, "CommissioningARL attribute must contain at least one restriction to run this test. Please follow manufacturer-specific steps to add access restrictions and re-run this test") self.step(2) await self.read_single_attribute_check_success( diff --git a/src/python_testing/TestConformanceTest.py b/src/python_testing/TestConformanceTest.py index 12ecb25fef6f0c..f0ff8032eab519 100644 --- a/src/python_testing/TestConformanceTest.py +++ b/src/python_testing/TestConformanceTest.py @@ -251,33 +251,33 @@ async def test_macl_restrictions(self): self.endpoints_tlv = {0: root, 1: nim} # device with no macl - have_arl, have_carl = arls_populated(self.endpoints_tlv) - asserts.assert_false(have_arl, "Unexpected ARL found") - asserts.assert_false(have_carl, "Unexpected CommissioningARL found") + arl_data = arls_populated(self.endpoints_tlv) + asserts.assert_false(arl_data.have_arl, "Unexpected ARL found") + asserts.assert_false(arl_data.have_carl, "Unexpected CommissioningARL found") # device with unpopulated macl self.add_macl(root) - have_arl, have_carl = arls_populated(self.endpoints_tlv) - asserts.assert_false(have_arl, "Unexpected ARL found") - asserts.assert_false(have_carl, "Unexpected CommissioningARL found") + arl_data = arls_populated(self.endpoints_tlv) + asserts.assert_false(arl_data.have_arl, "Unexpected ARL found") + asserts.assert_false(arl_data.have_carl, "Unexpected CommissioningARL found") # device with populated ARL self.add_macl(root, populate_arl=True) - have_arl, have_carl = arls_populated(self.endpoints_tlv) - asserts.assert_true(have_arl, "Did not find expected ARL") - asserts.assert_false(have_carl, "Unexpected CommissioningARL found") + arl_data = arls_populated(self.endpoints_tlv) + asserts.assert_true(arl_data.have_arl, "Did not find expected ARL") + asserts.assert_false(arl_data.have_carl, "Unexpected CommissioningARL found") # device with populated commissioning ARL self.add_macl(root, populate_commissioning_arl=True) - have_arl, have_carl = arls_populated(self.endpoints_tlv) - asserts.assert_false(have_arl, "Unexpected ARL found") - asserts.assert_true(have_carl, "Did not find expected Commissioning ARL") + arl_data = arls_populated(self.endpoints_tlv) + asserts.assert_false(arl_data.have_arl, "Unexpected ARL found") + asserts.assert_true(arl_data.have_carl, "Did not find expected Commissioning ARL") # device with both self.add_macl(root, populate_arl=True, populate_commissioning_arl=True) - have_arl, have_carl = arls_populated(self.endpoints_tlv) - asserts.assert_true(have_arl, "Did not find expected ARL") - asserts.assert_true(have_carl, "Did not find expected Commissioning ARL") + arl_data = arls_populated(self.endpoints_tlv) + asserts.assert_true(arl_data.have_arl, "Did not find expected ARL") + asserts.assert_true(arl_data.have_carl, "Did not find expected Commissioning ARL") if __name__ == "__main__": diff --git a/src/python_testing/basic_composition_support.py b/src/python_testing/basic_composition_support.py index 781007cdbdf685..debf902e76a414 100644 --- a/src/python_testing/basic_composition_support.py +++ b/src/python_testing/basic_composition_support.py @@ -23,6 +23,7 @@ import pathlib import sys import typing +from dataclasses import dataclass from pprint import pformat, pprint from typing import Any, Optional @@ -33,21 +34,27 @@ from mobly import asserts -def arls_populated(tlv_data: dict[int, Any]) -> tuple[bool, bool]: +@dataclass +class ArlData: + have_arl: bool + have_carl: bool + + +def arls_populated(tlv_data: dict[int, Any]) -> ArlData: """ Returns a tuple indicating if the ARL and CommissioningARL are populated. Requires a wildcard read of the device TLV. """ # ACL is always on endpoint 0 if 0 not in tlv_data or Clusters.AccessControl.id not in tlv_data[0]: - return (False, False) + return ArlData(have_arl=False, have_carl=False) # Both attributes are mandatory for this feature, so if one doesn't exist, neither should the other. if Clusters.AccessControl.Attributes.Arl.attribute_id not in tlv_data[0][Clusters.AccessControl.id][Clusters.AccessControl.Attributes.AttributeList.attribute_id]: - return (False, False) + return ArlData(have_arl=False, have_carl=False) have_arl = tlv_data[0][Clusters.AccessControl.id][Clusters.AccessControl.Attributes.Arl.attribute_id] have_carl = tlv_data[0][Clusters.AccessControl.id][Clusters.AccessControl.Attributes.CommissioningARL.attribute_id] - return (have_arl, have_carl) + return ArlData(have_arl=have_arl, have_carl=have_carl) def MatterTlvToJson(tlv_data: dict[int, Any]) -> dict[str, Any]: @@ -187,11 +194,11 @@ async def setup_class_helper(self, allow_pase: bool = True): logging.info("Start of actual tests") logging.info("###########################################################") - have_arl, have_carl = arls_populated(self.endpoints_tlv) + arl_data = arls_populated(self.endpoints_tlv) asserts.assert_false( - have_arl, "ARL cannot be populated for this test - Please follow manufacturer-specific steps to remove the access restrictions and re-run this test") + arl_data.have_arl, "ARL cannot be populated for this test - Please follow manufacturer-specific steps to remove the access restrictions and re-run this test") asserts.assert_false( - have_carl, "CommissioningARL cannot be populated for this test - Please follow manufacturer-specific steps to remove the access restrictions and re-run this test") + arl_data.have_carl, "CommissioningARL cannot be populated for this test - Please follow manufacturer-specific steps to remove the access restrictions and re-run this test") def get_test_name(self) -> str: """Return the function name of the caller. Used to create logging entries.""" From 7a04ec94fd83caf1073a2ab5be4dd7ff687d394f Mon Sep 17 00:00:00 2001 From: Jake Ororke Date: Fri, 6 Sep 2024 06:03:44 -0700 Subject: [PATCH 20/42] Removing yaml for TC CADMIN 1.9 as per https://github.com/project-chip/matter-test-scripts/issues/363: (#35389) - Removing test Test_TC_CADMIN_1_9.yaml as per request in ticket issue https://github.com/project-chip/matter-test-scripts/issues/363. --- .../certification/Test_TC_CADMIN_1_9.yaml | 603 ------------------ 1 file changed, 603 deletions(-) delete mode 100644 src/app/tests/suites/certification/Test_TC_CADMIN_1_9.yaml diff --git a/src/app/tests/suites/certification/Test_TC_CADMIN_1_9.yaml b/src/app/tests/suites/certification/Test_TC_CADMIN_1_9.yaml deleted file mode 100644 index 5ee85f98a48a72..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_CADMIN_1_9.yaml +++ /dev/null @@ -1,603 +0,0 @@ -# Copyright (c) 2023 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: - 24.1.9. [TC-CADMIN-1.9] Device exit commissioning mode after 20 failed - commission attempts [ECM] [DUT - Commissionee] - -PICS: - - CADMIN.S - -config: - nodeId: 0x12344321 - timeout: 700 - nodeIdForDuplicateCommissioning: - type: node_id - defaultValue: 0x11 - nodeId2: - type: node_id - defaultValue: 0xCAFE - nodeId3: - type: node_id - defaultValue: 0xC00FEE - endpoint: 0 - waitAfterCommissioning: - type: int16u - defaultValue: 5000 - discriminator: - type: int16u - defaultValue: 3840 - correctPayload: - type: char_string - defaultValue: "MT:-24J0AFN00KA0648G00" - incorrectSetupCodePayload: - type: char_string - defaultValue: "MT:-24J0AFN00I.0648G00" - PakeVerifier: - type: octet_string - defaultValue: "hex:b96170aae803346884724fe9a3b287c30330c2a660375d17bb205a8cf1aecb350457f8ab79ee253ab6a8e46bb09e543ae422736de501e3db37d441fe344920d09548e4c18240630c4ff4913c53513839b7c07fcc0627a1b8573a149fcd1fa466cf" - PIXIT.CADMIN.CwDuration: - type: int16u - defaultValue: 900 - -tests: - - label: "Precondition: Reset Devices to factory defaults" - PICS: PICS_SDK_CI_ONLY - cluster: "SystemCommands" - command: "FactoryReset" - - - label: "Precondition: Reset Devices to factory defaults" - verification: | - Reset Devices to factory defaults - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_SKIP_SAMPLE_APP - arguments: - values: - - name: "message" - value: "Factory Reset the DUT and enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: "Step 1a: TH_CR1 starts a commissioning process with DUT_CE" - cluster: "CommissionerCommands" - command: "PairWithCode" - PICS: CADMIN.S - arguments: - values: - - name: "nodeId" - value: nodeId - - name: "payload" - value: correctPayload - - - label: "Step 1b: TH_CR1 commissioned with DUT_CE" - cluster: "DelayCommands" - command: "WaitForCommissionee" - PICS: CADMIN.S - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: - "Step 2: TH_CR1 opens a commissioning window on DUT_CE using a - commissioning timeout of PIXIT.CADMIN.CwDuration seconds using ECM" - cluster: "Administrator Commissioning" - command: "OpenCommissioningWindow" - timedInteractionTimeoutMs: 10000 - PICS: CADMIN.S.C00.Rsp && PICS_SDK_CI_ONLY - arguments: - values: - - name: "CommissioningTimeout" - value: PIXIT.CADMIN.CwDuration - - name: "PAKEPasscodeVerifier" - value: PakeVerifier - - name: "Discriminator" - value: discriminator - - name: "Iterations" - value: 1000 - - name: "Salt" - value: "SPAKE2P Key Salt" - - - label: "Waiting after opening commissioning window" - PICS: CADMIN.S.C00.Rsp && PICS_SDK_CI_ONLY - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: waitAfterCommissioning - - #Issue https://github.com/project-chip/connectedhomeip/issues/26127 - - label: - "Step 2: TH_CR1 opens a commissioning window on DUT_CE using a - commissioning timeout of PIXIT.CADMIN.CwDuration seconds using ECM" - verification: | - On TH_CR1 send the below command - - ./chip-tool pairing open-commissioning-window 1 1 PIXIT.CADMIN.CwDuration 1000 3841 - - Verify the Open commisioning window on the DUT_CE(all-cluster-app) Log: - - [1660904553.796857][3537:3537] CHIP:DMG: Received command for Endpoint=0 Cluster=0x0000_003C Command=0x0000_0000 - [1660904553.796951][3537:3537] CHIP:ZCL: Received command to open commissioning window - [1660904553.797255][3537:3537] CHIP:IN: SecureSession[0xaaab142ef7f0]: Allocated Type:1 LSID:34523 - - Verify the Manual pairing code on the TH_CR1(chip-tool) Log: - - [1635864513.699433][3850:3855] CHIP:DMG: ICR moving to [CommandSen] - [1635864513.699489][3850:3855] CHIP:CTL: Manual pairing code: [36177160937] - [1635864513.699566][3850:3855] CHIP:CTL: SetupQRCode: [MT:00000CQM00YZN476420] - [1635864513.699636][3850:3855] CHIP:EM: Sending Standalone Ack for MessageCounter:2599714227 on exchange 60688i - [1635864513.699685][3850:3855] CHIP:IN: Prepared plaintext message 0xffff8a7cd960 to 0x0000000000000000 of type - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_SKIP_SAMPLE_APP && CADMIN.S.C00.Rsp - arguments: - values: - - name: "message" - value: "Enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: - "Step 3: DNS-SD records shows DUT_CE advertising. Verify that the - DNS-SD advertisement shows CM=2" - PICS: CADMIN.S.C00.Rsp - cluster: "DiscoveryCommands" - command: "FindCommissionable" - response: - values: - - name: "commissioningMode" - value: 2 - - - label: - "Step 4.1: TH_CR2 starts a commissioning process with DUT_CE using - Invalid setup code" - identity: "beta" - cluster: "CommissionerCommands" - command: "PairWithCode" - PICS: CADMIN.S - arguments: - values: - - name: "nodeId" - value: nodeId2 - - name: "payload" - value: incorrectSetupCodePayload - - name: discoverOnce - value: true - response: - error: FAILURE - - - label: - "Step 4.2: TH_CR2 starts a commissioning process with DUT_CE using - Invalid setup code" - identity: "beta" - cluster: "CommissionerCommands" - command: "PairWithCode" - PICS: CADMIN.S - arguments: - values: - - name: "nodeId" - value: nodeId2 - - name: "payload" - value: incorrectSetupCodePayload - - name: discoverOnce - value: true - response: - error: FAILURE - - - label: - "Step 4.3: TH_CR2 starts a commissioning process with DUT_CE using - Invalid setup code" - identity: "beta" - cluster: "CommissionerCommands" - command: "PairWithCode" - PICS: CADMIN.S - arguments: - values: - - name: "nodeId" - value: nodeId2 - - name: "payload" - value: incorrectSetupCodePayload - - name: discoverOnce - value: true - response: - error: FAILURE - - - label: - "Step 4.4: TH_CR2 starts a commissioning process with DUT_CE using - Invalid setup code" - identity: "beta" - cluster: "CommissionerCommands" - command: "PairWithCode" - PICS: CADMIN.S - arguments: - values: - - name: "nodeId" - value: nodeId2 - - name: "payload" - value: incorrectSetupCodePayload - - name: discoverOnce - value: true - response: - error: FAILURE - - - label: - "Step 4.5: TH_CR2 starts a commissioning process with DUT_CE using - Invalid setup code" - identity: "beta" - cluster: "CommissionerCommands" - command: "PairWithCode" - PICS: CADMIN.S - arguments: - values: - - name: "nodeId" - value: nodeId2 - - name: "payload" - value: incorrectSetupCodePayload - - name: discoverOnce - value: true - response: - error: FAILURE - - - label: - "Step 4.6: TH_CR2 starts a commissioning process with DUT_CE using - Invalid setup code" - identity: "beta" - cluster: "CommissionerCommands" - command: "PairWithCode" - PICS: CADMIN.S - arguments: - values: - - name: "nodeId" - value: nodeId2 - - name: "payload" - value: incorrectSetupCodePayload - - name: discoverOnce - value: true - response: - error: FAILURE - - - label: - "Step 4.7: TH_CR2 starts a commissioning process with DUT_CE using - Invalid setup code" - identity: "beta" - cluster: "CommissionerCommands" - command: "PairWithCode" - PICS: CADMIN.S - arguments: - values: - - name: "nodeId" - value: nodeId2 - - name: "payload" - value: incorrectSetupCodePayload - - name: discoverOnce - value: true - response: - error: FAILURE - - - label: - "Step 4.8: TH_CR2 starts a commissioning process with DUT_CE using - Invalid setup code" - identity: "beta" - cluster: "CommissionerCommands" - command: "PairWithCode" - PICS: CADMIN.S - arguments: - values: - - name: "nodeId" - value: nodeId2 - - name: "payload" - value: incorrectSetupCodePayload - - name: discoverOnce - value: true - response: - error: FAILURE - - - label: - "Step 4.9: TH_CR2 starts a commissioning process with DUT_CE using - Invalid setup code" - identity: "beta" - cluster: "CommissionerCommands" - command: "PairWithCode" - PICS: CADMIN.S - arguments: - values: - - name: "nodeId" - value: nodeId2 - - name: "payload" - value: incorrectSetupCodePayload - - name: discoverOnce - value: true - response: - error: FAILURE - - - label: - "Step 4.10: TH_CR2 starts a commissioning process with DUT_CE using - Invalid setup code" - identity: "beta" - cluster: "CommissionerCommands" - command: "PairWithCode" - PICS: CADMIN.S - arguments: - values: - - name: "nodeId" - value: nodeId2 - - name: "payload" - value: incorrectSetupCodePayload - - name: discoverOnce - value: true - response: - error: FAILURE - - - label: - "Step 4.11: TH_CR2 starts a commissioning process with DUT_CE using - Invalid setup code" - identity: "beta" - cluster: "CommissionerCommands" - command: "PairWithCode" - PICS: CADMIN.S - arguments: - values: - - name: "nodeId" - value: nodeId2 - - name: "payload" - value: incorrectSetupCodePayload - - name: discoverOnce - value: true - response: - error: FAILURE - - - label: - "Step 4.12: TH_CR2 starts a commissioning process with DUT_CE using - Invalid setup code" - identity: "beta" - cluster: "CommissionerCommands" - command: "PairWithCode" - PICS: CADMIN.S - arguments: - values: - - name: "nodeId" - value: nodeId2 - - name: "payload" - value: incorrectSetupCodePayload - - name: discoverOnce - value: true - response: - error: FAILURE - - - label: - "Step 4.13: TH_CR2 starts a commissioning process with DUT_CE using - Invalid setup code" - identity: "beta" - cluster: "CommissionerCommands" - command: "PairWithCode" - PICS: CADMIN.S - arguments: - values: - - name: "nodeId" - value: nodeId2 - - name: "payload" - value: incorrectSetupCodePayload - - name: discoverOnce - value: true - response: - error: FAILURE - - - label: - "Step 4.14: TH_CR2 starts a commissioning process with DUT_CE using - Invalid setup code" - identity: "beta" - cluster: "CommissionerCommands" - command: "PairWithCode" - PICS: CADMIN.S - arguments: - values: - - name: "nodeId" - value: nodeId2 - - name: "payload" - value: incorrectSetupCodePayload - - name: discoverOnce - value: true - response: - error: FAILURE - - - label: - "Step 4.15: TH_CR2 starts a commissioning process with DUT_CE using - Invalid setup code" - identity: "beta" - cluster: "CommissionerCommands" - command: "PairWithCode" - PICS: CADMIN.S - arguments: - values: - - name: "nodeId" - value: nodeId2 - - name: "payload" - value: incorrectSetupCodePayload - - name: discoverOnce - value: true - response: - error: FAILURE - - - label: - "Step 4.16: TH_CR2 starts a commissioning process with DUT_CE using - Invalid setup code" - identity: "beta" - cluster: "CommissionerCommands" - command: "PairWithCode" - PICS: CADMIN.S - arguments: - values: - - name: "nodeId" - value: nodeId2 - - name: "payload" - value: incorrectSetupCodePayload - - name: discoverOnce - value: true - response: - error: FAILURE - - - label: - "Step 4.17: TH_CR2 starts a commissioning process with DUT_CE using - Invalid setup code" - identity: "beta" - cluster: "CommissionerCommands" - command: "PairWithCode" - PICS: CADMIN.S - arguments: - values: - - name: "nodeId" - value: nodeId2 - - name: "payload" - value: incorrectSetupCodePayload - - name: discoverOnce - value: true - response: - error: FAILURE - - - label: - "Step 4.18: TH_CR2 starts a commissioning process with DUT_CE using - Invalid setup code" - identity: "beta" - cluster: "CommissionerCommands" - command: "PairWithCode" - PICS: CADMIN.S - arguments: - values: - - name: "nodeId" - value: nodeId2 - - name: "payload" - value: incorrectSetupCodePayload - - name: discoverOnce - value: true - response: - error: FAILURE - - - label: - "Step 4.19: TH_CR2 starts a commissioning process with DUT_CE using - Invalid setup code" - identity: "beta" - cluster: "CommissionerCommands" - command: "PairWithCode" - PICS: CADMIN.S - arguments: - values: - - name: "nodeId" - value: nodeId2 - - name: "payload" - value: incorrectSetupCodePayload - - name: discoverOnce - value: true - response: - error: FAILURE - - - label: - "Step 4.20: TH_CR2 starts a commissioning process with DUT_CE using - Invalid setup code" - identity: "beta" - cluster: "CommissionerCommands" - command: "PairWithCode" - PICS: CADMIN.S - arguments: - values: - - name: "nodeId" - value: nodeId2 - - name: "payload" - value: incorrectSetupCodePayload - - name: discoverOnce - value: true - response: - error: FAILURE - - # This step must match the verification step above where we checked `payload` - - label: - "Step 5: TH_CR2 starts a commissioning process with DUT_CE using valid - setup code" - identity: "beta" - cluster: "CommissionerCommands" - command: "PairWithCode" - PICS: CADMIN.S && PICS_SDK_CI_ONLY - arguments: - values: - - name: "nodeId" - value: nodeId2 - - name: "payload" - value: correctPayload - response: - error: FAILURE - - #Issue https://github.com/project-chip/connectedhomeip/issues/26127 - - label: "Step 5: TH_CR2 starts a commissioning process with DUT_CE" - verification: | - On TH_CR2 send the below command (with correct passcode) - - ./chip-tool pairing code 0xCAFE 36177160937 --commissioner-name beta - - Verify the following error on 21st attempt using correct passcode in TH_CR2(chip-tool) - - [1665484807.015876][5399:5399] CHIP:DL: renamed tmp file to file (/tmp/chip_counters.ini) - [1665484807.016042][5399:5399] CHIP:DL: NVS set: chip-counters/total-operational-hours = 0 (0x0) - [1665484807.016108][5399:5399] CHIP:DL: Inet Layer shutdown - [1665484807.016163][5399:5399] CHIP:DL: BLE Layer shutdown - [1665484807.016215][5399:5399] CHIP:DL: System Layer shutdown - [1665484807.016460][5399:5399] CHIP:TOO: Run command failure: ../../commands/pairing/PairingCommand.cpp:164: CHIP Error 0x00000003: Incorrect state - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_SKIP_SAMPLE_APP && CADMIN.S.C00.Rsp - arguments: - values: - - name: "message" - value: "Enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: "Step 6: TH_CR3 starts a commissioning process with DUT_CE" - identity: "gamma" - cluster: "CommissionerCommands" - command: "PairWithCode" - PICS: CADMIN.S && PICS_SDK_CI_ONLY - arguments: - values: - - name: "nodeId" - value: nodeId3 - - name: "payload" - value: correctPayload - response: - error: FAILURE - - #Issue https://github.com/project-chip/connectedhomeip/issues/26127 - - label: "Step 6: TH_CR2 starts a commissioning process with DUT_CE" - verification: | - On TH_CR3 send the below command (with correct passcode) - - ./chip-tool pairing code 0xC00FEE 36177160938 (With correct passcode) --commissioner-name gamma - - Verify the following error on correct passcode in TH_CR3(chip-tool) - [1665484807.015876][5399:5399] CHIP:DL: renamed tmp file to file (/tmp/chip_counters.ini) - [1665484807.016042][5399:5399] CHIP:DL: NVS set: chip-counters/total-operational-hours = 0 (0x0) - [1665484807.016108][5399:5399] CHIP:DL: Inet Layer shutdown - [1665484807.016163][5399:5399] CHIP:DL: BLE Layer shutdown - [1665484807.016215][5399:5399] CHIP:DL: System Layer shutdown - [1665484807.016460][5399:5399] CHIP:TOO: Run command failure: ../../commands/pairing/PairingCommand.cpp:164: CHIP Error 0x00000003: Incorrect state - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_SKIP_SAMPLE_APP && CADMIN.S.C00.Rsp - arguments: - values: - - name: "message" - value: "Enter 'y' after success" - - name: "expectedValue" - value: "y" From e96ddd98305cfe275f9ac27fc7360c51fdc9b5de Mon Sep 17 00:00:00 2001 From: Shubham Patil Date: Fri, 6 Sep 2024 18:36:24 +0530 Subject: [PATCH 21/42] [ESP32] Support total operational hours (#35425) * [ESP32] support for total operational hour * remove stale TODOs * Restyled by clang-format --------- Co-authored-by: Restyled.io --- .../ESP32/ConfigurationManagerImpl.cpp | 40 ++++++++++++++++--- src/platform/ESP32/ConfigurationManagerImpl.h | 3 ++ 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/src/platform/ESP32/ConfigurationManagerImpl.cpp b/src/platform/ESP32/ConfigurationManagerImpl.cpp index e03ec70ce8192b..31c7cb714f96c0 100644 --- a/src/platform/ESP32/ConfigurationManagerImpl.cpp +++ b/src/platform/ESP32/ConfigurationManagerImpl.cpp @@ -45,14 +45,26 @@ namespace DeviceLayer { using namespace ::chip::DeviceLayer::Internal; -// TODO: Define a Singleton instance of CHIP Group Key Store here (#1266) - ConfigurationManagerImpl & ConfigurationManagerImpl::GetDefaultInstance() { static ConfigurationManagerImpl sInstance; return sInstance; } +uint32_t ConfigurationManagerImpl::mTotalOperationalHours = 0; + +void ConfigurationManagerImpl::TotalOperationalHoursTimerCallback(TimerHandle_t timer) +{ + mTotalOperationalHours++; + + CHIP_ERROR err = ConfigurationMgrImpl().StoreTotalOperationalHours(mTotalOperationalHours); + + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "Failed to store total operational hours: %" CHIP_ERROR_FORMAT, err.Format()); + } +} + CHIP_ERROR ConfigurationManagerImpl::Init() { CHIP_ERROR err; @@ -161,18 +173,34 @@ CHIP_ERROR ConfigurationManagerImpl::Init() SuccessOrExit(err); } - if (!ESP32Config::ConfigValueExists(ESP32Config::kCounterKey_TotalOperationalHours)) + if (CHIP_NO_ERROR != GetTotalOperationalHours(mTotalOperationalHours)) { - err = StoreTotalOperationalHours(0); + err = StoreTotalOperationalHours(mTotalOperationalHours); SuccessOrExit(err); } + { + // Start a timer which reloads every one hour and bumps the total operational hours + TickType_t reloadPeriod = (1000 * 60 * 60) / portTICK_PERIOD_MS; + TimerHandle_t timerHandle = xTimerCreate("tOpHrs", reloadPeriod, pdPASS, nullptr, TotalOperationalHoursTimerCallback); + if (timerHandle == nullptr) + { + err = CHIP_ERROR_NO_MEMORY; + ExitNow(ChipLogError(DeviceLayer, "total operational hours Timer creation failed")); + } + + BaseType_t timerStartStatus = xTimerStart(timerHandle, 0); + if (timerStartStatus == pdFAIL) + { + err = CHIP_ERROR_INTERNAL; + ExitNow(ChipLogError(DeviceLayer, "total operational hours Timer start failed")); + } + } + // Initialize the generic implementation base class. err = Internal::GenericConfigurationManagerImpl::Init(); SuccessOrExit(err); - // TODO: Initialize the global GroupKeyStore object here (#1266) - err = CHIP_NO_ERROR; exit: diff --git a/src/platform/ESP32/ConfigurationManagerImpl.h b/src/platform/ESP32/ConfigurationManagerImpl.h index 1416df35d93b65..63b3e094763a75 100644 --- a/src/platform/ESP32/ConfigurationManagerImpl.h +++ b/src/platform/ESP32/ConfigurationManagerImpl.h @@ -98,6 +98,9 @@ class ConfigurationManagerImpl : public Internal::GenericConfigurationManagerImp // ===== Private members reserved for use by this class only. static void DoFactoryReset(intptr_t arg); + + static uint32_t mTotalOperationalHours; + static void TotalOperationalHoursTimerCallback(TimerHandle_t timer); }; /** From 96e687bfe3e570330556af9c542e548863b7a7c3 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 6 Sep 2024 15:13:50 -0400 Subject: [PATCH 22/42] Revert "Updating XPC interfaces to pass along context, and fixing some retries (#35441)" (#35457) This reverts commit f89d5b980a1aece608f22602419ef7bd8467f915. Co-authored-by: Andrei Litvin --- .../Framework/CHIP/MTRDefines_Internal.h | 53 ------ .../Framework/CHIP/MTRDeviceController+XPC.mm | 8 +- .../Framework/CHIP/MTRDeviceController_XPC.h | 2 +- .../Framework/CHIP/MTRDeviceController_XPC.mm | 175 ++++-------------- .../Framework/CHIP/MTRDevice_Concrete.mm | 60 +++--- .../Framework/CHIP/MTRDevice_Internal.h | 6 +- src/darwin/Framework/CHIP/MTRDevice_XPC.mm | 51 +++-- .../CHIP/XPC Protocol/MTRXPCClientProtocol.h | 3 + .../CHIP/XPC Protocol/MTRXPCServerProtocol.h | 3 + 9 files changed, 91 insertions(+), 270 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDefines_Internal.h b/src/darwin/Framework/CHIP/MTRDefines_Internal.h index 38de3a95f5d935..7894f31835a142 100644 --- a/src/darwin/Framework/CHIP/MTRDefines_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDefines_Internal.h @@ -111,56 +111,3 @@ typedef struct {} variable_hidden_by_mtr_hide; \ return outValue; \ } - -#ifndef MTR_OPTIONAL_ATTRIBUTE -#if __has_feature(objc_arc) -#define MTR_OPTIONAL_ATTRIBUTE(ATTRIBUTE, VALUE, DICTIONARY) \ - { \ - id valueToAdd = VALUE; \ - if (valueToAdd != nil) { \ - CFDictionarySetValue((CFMutableDictionaryRef) DICTIONARY, (CFStringRef) (__bridge const void *) ATTRIBUTE, (const void *) valueToAdd); \ - } \ - } -#else -#define MTR_OPTIONAL_ATTRIBUTE(ATTRIBUTE, VALUE, DICTIONARY) \ - { \ - id valueToAdd = VALUE; \ - if (valueToAdd != nil) { \ - CFDictionarySetValue((CFMutableDictionaryRef) DICTIONARY, (CFStringRef) (const void *) ATTRIBUTE, (const void *) valueToAdd); \ - } \ - } -#endif -#endif - -#ifndef MTR_OPTIONAL_COLLECTION_ATTRIBUTE -#define MTR_OPTIONAL_COLLECTION_ATTRIBUTE(ATTRIBUTE, COLLECTION, DICTIONARY) \ - if ([COLLECTION count] > 0) { \ - CFDictionarySetValue((CFMutableDictionaryRef) DICTIONARY, (CFStringRef) ATTRIBUTE, (const void *) COLLECTION); \ - } -#endif - -#ifndef MTR_OPTIONAL_NUMBER_ATTRIBUTE -#define MTR_OPTIONAL_NUMBER_ATTRIBUTE(ATTRIBUTE, NUMBER, DICTIONARY) \ - if ([NUMBER intValue] != 0) { \ - CFDictionarySetValue((CFMutableDictionaryRef) DICTIONARY, (CFStringRef) ATTRIBUTE, (const void *) NUMBER); \ - } -#endif - -#ifndef MTR_REMOVE_ATTRIBUTE -#define MTR_REMOVE_ATTRIBUTE(ATTRIBUTE, DICTIONARY) \ - if (ATTRIBUTE != nil && DICTIONARY) { \ - CFDictionaryRemoveValue((CFMutableDictionaryRef) DICTIONARY, (CFStringRef) ATTRIBUTE); \ - } -#endif - -#ifndef MTR_REQUIRED_ATTRIBUTE -#define MTR_REQUIRED_ATTRIBUTE(ATTRIBUTE, VALUE, DICTIONARY) \ - { \ - id valueToAdd = VALUE; \ - if (valueToAdd != nil) { \ - CFDictionarySetValue((CFMutableDictionaryRef) DICTIONARY, (CFStringRef) ATTRIBUTE, (const void *) valueToAdd); \ - } else { \ - MTR_LOG_ERROR("Warning, missing %@ to add to %s", ATTRIBUTE, #DICTIONARY); \ - } \ - } -#endif diff --git a/src/darwin/Framework/CHIP/MTRDeviceController+XPC.mm b/src/darwin/Framework/CHIP/MTRDeviceController+XPC.mm index 1cd02e24648867..87ce5560381cca 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController+XPC.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController+XPC.mm @@ -34,13 +34,7 @@ static NSSet * GetXPCAllowedClasses() { static NSSet * const sXPCAllowedClasses = [NSSet setWithArray:@[ - [NSString class], - [NSNumber class], - [NSData class], - [NSArray class], - [NSDictionary class], - [NSError class], - [NSDate class], + [NSString class], [NSNumber class], [NSData class], [NSArray class], [NSDictionary class], [NSError class] ]]; return sXPCAllowedClasses; } diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_XPC.h b/src/darwin/Framework/CHIP/MTRDeviceController_XPC.h index 87218b1f391a66..c891c10d726791 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_XPC.h +++ b/src/darwin/Framework/CHIP/MTRDeviceController_XPC.h @@ -27,7 +27,7 @@ MTR_TESTABLE - (id)initWithUniqueIdentifier:(NSUUID *)UUID machServiceName:(NSString *)machServiceName options:(NSXPCConnectionOptions)options #endif - @property(nullable, atomic, retain, readwrite)NSXPCConnection * xpcConnection; + @property(atomic, retain, readwrite)NSXPCConnection * xpcConnection; @end diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm b/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm index c58514ed2496ec..1bf0888ab3b2b4 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm @@ -19,7 +19,6 @@ #import "MTRDefines_Internal.h" #import "MTRDeviceController_Internal.h" #import "MTRDevice_XPC.h" -#import "MTRDevice_XPC_Internal.h" #import "MTRLogging_Internal.h" #import "MTRXPCClientProtocol.h" #import "MTRXPCServerProtocol.h" @@ -34,10 +33,7 @@ @interface MTRDeviceController_XPC () -@property (nonatomic, readwrite, retain) NSUUID * uniqueIdentifier; -@property (nonnull, atomic, readwrite, retain) MTRXPCDeviceControllerParameters * xpcParameters; -@property (atomic, readwrite, assign) NSTimeInterval xpcRetryTimeInterval; -@property (atomic, readwrite, assign) BOOL xpcConnectedOrConnecting; +@property (nonatomic, retain, readwrite) NSUUID * uniqueIdentifier; @end @@ -52,15 +48,7 @@ - (NSXPCInterface *)_interfaceForServerProtocol NSXPCInterface * interface = [NSXPCInterface interfaceWithProtocol:@protocol(MTRXPCServerProtocol)]; NSSet * allowedClasses = [NSSet setWithArray:@[ - [NSString class], - [NSNumber class], - [NSData class], - [NSArray class], - [NSDictionary class], - [NSError class], - [MTRCommandPath class], - [MTRAttributePath class], - [NSDate class], + [NSString class], [NSNumber class], [NSData class], [NSArray class], [NSDictionary class], [NSError class], [MTRCommandPath class], [MTRAttributePath class] ]]; [interface setClasses:allowedClasses @@ -74,14 +62,7 @@ - (NSXPCInterface *)_interfaceForClientProtocol { NSXPCInterface * interface = [NSXPCInterface interfaceWithProtocol:@protocol(MTRXPCClientProtocol)]; NSSet * allowedClasses = [NSSet setWithArray:@[ - [NSString class], - [NSNumber class], - [NSData class], - [NSArray class], - [NSDictionary class], - [NSError class], - [MTRAttributePath class], - [NSDate class], + [NSString class], [NSNumber class], [NSData class], [NSArray class], [NSDictionary class], [NSError class], [MTRAttributePath class] ]]; [interface setClasses:allowedClasses forSelector:@selector(device:receivedAttributeReport:) @@ -102,114 +83,6 @@ - (NSXPCInterface *)_interfaceForClientProtocol return [self.uniqueIdentifier UUIDString]; } -- (void)_startXPCConnectionRetry -{ - if (!self.xpcConnectedOrConnecting) { - MTR_LOG("%@: XPC Connection retry - Starting retry for XPC Connection", self); - self.xpcRetryTimeInterval = 0.5; - mtr_weakify(self); - - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t) (self.xpcRetryTimeInterval * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - mtr_strongify(self); - [self _xpcConnectionRetry]; - }); - } else { - MTR_LOG("%@: XPC Connection retry - Not starting retry for XPC Connection, already trying", self); - } -} - -- (void)_xpcConnectionRetry -{ - MTR_LOG("%@: XPC Connection retry - timer hit", self); - if (!self.xpcConnectedOrConnecting) { - if (![self _setupXPCConnection]) { -#if 0 // FIXME: Not sure why this retry is not working, but I will fix this later - MTR_LOG("%@: XPC Connection retry - Scheduling another retry", self); - self.xpcRetryTimeInterval = self.xpcRetryTimeInterval >= 1 ? self.xpcRetryTimeInterval * 2 : 1; - self.xpcRetryTimeInterval = MIN(60.0, self.xpcRetryTimeInterval); - mtr_weakify(self); - - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(self.xpcRetryTimeInterval * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - mtr_strongify(self); - [self _xpcConnectionRetry]; - }); -#else - MTR_LOG("%@: XPC Connection failed retry - bailing", self); -#endif - } else { - MTR_LOG("%@: XPC Connection retry - connection attempt successful", self); - } - } else { - MTR_LOG("%@: XPC Connection retry - Mid retry, or connected, stopping retry timer", self); - } -} - -- (BOOL)_setupXPCConnection -{ - self.xpcConnection = self.xpcParameters.xpcConnectionBlock(); - - MTR_LOG("%@ Set up XPC Connection: %@", self, self.xpcConnection); - if (self.xpcConnection) { - mtr_weakify(self); - self.xpcConnection.remoteObjectInterface = [self _interfaceForServerProtocol]; - - self.xpcConnection.exportedInterface = [self _interfaceForClientProtocol]; - self.xpcConnection.exportedObject = self; - - self.xpcConnection.interruptionHandler = ^{ - mtr_strongify(self); - MTR_LOG_ERROR("XPC Connection for device controller interrupted: %@", self.xpcParameters.uniqueIdentifier); - self.xpcConnectedOrConnecting = NO; - self.xpcConnection = nil; - [self _startXPCConnectionRetry]; - }; - - self.xpcConnection.invalidationHandler = ^{ - mtr_strongify(self); - MTR_LOG_ERROR("XPC Connection for device controller invalidated: %@", self.xpcParameters.uniqueIdentifier); - self.xpcConnectedOrConnecting = NO; - self.xpcConnection = nil; - [self _startXPCConnectionRetry]; - }; - - MTR_LOG("%@ Activating new XPC connection", self); - [self.xpcConnection activate]; - - [[self.xpcConnection synchronousRemoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) { - MTR_LOG_ERROR("Checkin error: %@", error); - }] deviceController:self.uniqueIdentifier checkInWithContext:[NSDictionary dictionary]]; - - // FIXME: Trying to kick all the MTRDevices attached to this controller to re-establish connections - // This state needs to be stored properly and re-established at connnection time - - MTR_LOG("%@ Starting existing NodeID Registration", self); - for (NSNumber * nodeID in [self.nodeIDToDeviceMap keyEnumerator]) { - MTR_LOG("%@ => Registering nodeID: %@", self, nodeID); - mtr_weakify(self); - - [[self.xpcConnection synchronousRemoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) { - mtr_strongify(self); - MTR_LOG_ERROR("%@ Registration error for device nodeID: %@ : %@", self, nodeID, error); - }] deviceController:self.uniqueIdentifier registerNodeID:nodeID]; - } - - __block BOOL barrierComplete = NO; - - [self.xpcConnection scheduleSendBarrierBlock:^{ - barrierComplete = YES; - MTR_LOG("%@: Barrier complete: %d", self, barrierComplete); - }]; - - MTR_LOG("%@ Done existing NodeID Registration, barrierComplete: %d", self, barrierComplete); - self.xpcConnectedOrConnecting = barrierComplete; - } else { - MTR_LOG_ERROR("%@ Failed to set up XPC Connection", self); - self.xpcConnectedOrConnecting = NO; - } - - return (self.xpcConnectedOrConnecting); -} - - (nullable instancetype)initWithParameters:(MTRDeviceControllerAbstractParameters *)parameters error:(NSError * __autoreleasing *)error { @@ -237,12 +110,30 @@ - (nullable instancetype)initWithParameters:(MTRDeviceControllerAbstractParamete return nil; } - self.xpcParameters = xpcParameters; + self.xpcConnection = connectionBlock(); + self.uniqueIdentifier = UUID; self.chipWorkQueue = dispatch_queue_create("MTRDeviceController_XPC_queue", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); self.nodeIDToDeviceMap = [NSMapTable strongToWeakObjectsMapTable]; - self.uniqueIdentifier = UUID; - if (![self _setupXPCConnection]) { + MTR_LOG("Set up XPC Connection: %@", self.xpcConnection); + if (self.xpcConnection) { + self.xpcConnection.remoteObjectInterface = [self _interfaceForServerProtocol]; + + self.xpcConnection.exportedInterface = [self _interfaceForClientProtocol]; + self.xpcConnection.exportedObject = self; + + self.xpcConnection.interruptionHandler = ^{ + MTR_LOG_ERROR("XPC Connection for device controller interrupted: %@", UUID); + }; + + self.xpcConnection.invalidationHandler = ^{ + MTR_LOG_ERROR("XPC Connection for device controller invalidated: %@", UUID); + }; + + MTR_LOG("Activating new XPC connection"); + [self.xpcConnection activate]; + } else { + MTR_LOG_ERROR("Failed to set up XPC Connection"); return nil; } } @@ -268,7 +159,7 @@ - (id)initWithUniqueIdentifier:(NSUUID *)UUID machServiceName:(NSString *)machSe self.xpcConnection.exportedObject = self; MTR_LOG("%s: resuming new XPC connection"); - [self.xpcConnection activate]; + [self.xpcConnection resume]; } else { MTR_LOG_ERROR("Failed to set up XPC Connection"); return nil; @@ -286,7 +177,13 @@ - (MTRDevice *)_setupDeviceForNodeID:(NSNumber *)nodeID prefetchedClusterData:(N os_unfair_lock_assert_owner(self.deviceMapLock); MTRDevice * deviceToReturn = [[MTRDevice_XPC alloc] initWithNodeID:nodeID controller:self]; - [self.nodeIDToDeviceMap setObject:deviceToReturn forKey:nodeID]; + // If we're not running, don't add the device to our map. That would + // create a cycle that nothing would break. Just return the device, + // which will be in exactly the state it would be in if it were created + // while we were running and then we got shut down. + if ([self isRunning]) { + [self.nodeIDToDeviceMap setObject:deviceToReturn forKey:nodeID]; + } MTR_LOG("%s: returning XPC device for node id %@", __PRETTY_FUNCTION__, nodeID); return deviceToReturn; } @@ -358,14 +255,6 @@ - (oneway void)deviceConfigurationChanged:(NSNumber *)nodeID [device deviceConfigurationChanged:nodeID]; } -- (oneway void)device:(NSNumber *)nodeID internalStateUpdated:(NSDictionary *)dictionary -{ - MTRDevice_XPC * device = (MTRDevice_XPC *) [self deviceForNodeID:nodeID]; - MTR_LOG("Received internalStateUpdated: %@ found device: %@", nodeID, device); - - [device device:nodeID internalStateUpdated:dictionary]; -} - #pragma mark - MTRDeviceController Protocol Client // Not Supported via XPC diff --git a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm index f554d14f9e7215..70824dd9bcd7d1 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm +++ b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm @@ -254,6 +254,8 @@ @interface MTRDevice_Concrete () @property (nonatomic) ReadClient * currentReadClient; @property (nonatomic) SubscriptionCallback * currentSubscriptionCallback; // valid when and only when currentReadClient is valid +@property (nonatomic, weak) id privateInternalStateDelegate; + @end // Declaring selector so compiler won't complain about testing and calling it in _handleReportEnd @@ -466,28 +468,31 @@ - (NSString *)description - (NSDictionary *)_internalProperties { - NSMutableDictionary * properties = [NSMutableDictionary dictionary]; - std::lock_guard lock(_descriptionLock); + id vidOrUnknown, pidOrUnknown; + + { + std::lock_guard lock(_descriptionLock); - MTR_OPTIONAL_ATTRIBUTE(kMTRDeviceInternalPropertyKeyVendorID, _vid, properties); - MTR_OPTIONAL_ATTRIBUTE(kMTRDeviceInternalPropertyKeyProductID, _pid, properties); - MTR_OPTIONAL_ATTRIBUTE(kMTRDeviceInternalPropertyNetworkFeatures, _allNetworkFeatures, properties); - MTR_OPTIONAL_ATTRIBUTE(kMTRDeviceInternalPropertyDeviceState, [NSNumber numberWithUnsignedInteger:_internalDeviceStateForDescription], properties); - MTR_OPTIONAL_ATTRIBUTE(kMTRDeviceInternalPropertyLastSubscriptionAttemptWait, [NSNumber numberWithUnsignedInt:_lastSubscriptionAttemptWaitForDescription], properties); - MTR_OPTIONAL_ATTRIBUTE(kMTRDeviceInternalPropertyMostRecentReportTime, _mostRecentReportTimeForDescription, properties); - MTR_OPTIONAL_ATTRIBUTE(kMTRDeviceInternalPropertyLastSubscriptionFailureTime, _lastSubscriptionFailureTimeForDescription, properties); + vidOrUnknown = _vid ?: @"Unknown"; + pidOrUnknown = _pid ?: @"Unknown"; + // id networkFeatures = _allNetworkFeatures; + // id internalDeviceState = _internalDeviceStateForDescription; + // id lastSubscriptionAttemptWait = _lastSubscriptionAttemptWaitForDescription; + // id mostRecentReportTime = _mostRecentReportTimeForDescription; + // id lastSubscriptionFailureTime = _lastSubscriptionFailureTimeForDescription; + } - return properties; + return @{ + kMTRDeviceInternalPropertyKeyVendorID : vidOrUnknown, + kMTRDeviceInternalPropertyKeyProductID : pidOrUnknown, + }; } -- (void)_notifyDelegateOfPrivateInternalPropertiesChanges +- (void)_notifyPrivateInternalPropertiesDelegateOfChanges { - os_unfair_lock_assert_owner(&self->_lock); - [self _callDelegatesWithBlock:^(id delegate) { - if ([delegate respondsToSelector:@selector(device:internalStateUpdated:)]) { - [delegate performSelector:@selector(device:internalStateUpdated:) withObject:self withObject:[self _internalProperties]]; - } - }]; + if ([self.privateInternalStateDelegate respondsToSelector:@selector(device:internalStateUpdated:)]) { + [self.privateInternalStateDelegate device:self.nodeID internalStateUpdated:[self _internalProperties]]; + } } #pragma mark - Time Synchronization @@ -755,8 +760,6 @@ - (void)_delegateAdded [self _setupSubscriptionWithReason:@"delegate is set and subscription is needed"]; } } - - [self _notifyDelegateOfPrivateInternalPropertiesChanges]; } - (void)invalidate @@ -980,7 +983,7 @@ - (void)_changeInternalState:(MTRInternalDeviceState)state }]; /* END DRAGONS */ - [self _notifyDelegateOfPrivateInternalPropertiesChanges]; + [self _notifyPrivateInternalPropertiesDelegateOfChanges]; } } @@ -1182,7 +1185,7 @@ - (void)_handleResubscriptionNeededWithDelay:(NSNumber *)resubscriptionDelayMs std::lock_guard lock(_descriptionLock); _lastSubscriptionFailureTimeForDescription = _lastSubscriptionFailureTime; } - [self _notifyDelegateOfPrivateInternalPropertiesChanges]; + [self _notifyPrivateInternalPropertiesDelegateOfChanges]; deviceUsesThread = [self _deviceUsesThread]; // If a previous resubscription failed, remove the item from the subscription pool. @@ -1233,7 +1236,7 @@ - (void)_setLastSubscriptionAttemptWait:(uint32_t)lastSubscriptionAttemptWait _lastSubscriptionAttemptWaitForDescription = lastSubscriptionAttemptWait; } - [self _notifyDelegateOfPrivateInternalPropertiesChanges]; + [self _notifyPrivateInternalPropertiesDelegateOfChanges]; } - (void)_doHandleSubscriptionReset:(NSNumber * _Nullable)retryDelay @@ -1249,7 +1252,7 @@ - (void)_doHandleSubscriptionReset:(NSNumber * _Nullable)retryDelay std::lock_guard lock(_descriptionLock); _lastSubscriptionFailureTimeForDescription = _lastSubscriptionFailureTime; } - [self _notifyDelegateOfPrivateInternalPropertiesChanges]; + [self _notifyPrivateInternalPropertiesDelegateOfChanges]; // if there is no delegate then also do not retry if (![self _delegateExists]) { @@ -1307,7 +1310,6 @@ - (void)_doHandleSubscriptionReset:(NSNumber * _Nullable)retryDelay // For non-Thread-enabled devices, just call the resubscription block after the specified time dispatch_after(dispatch_time(DISPATCH_TIME_NOW, resubscriptionDelayNs), self.queue, resubscriptionBlock); } - [self _notifyDelegateOfPrivateInternalPropertiesChanges]; } - (void)_reattemptSubscriptionNowIfNeededWithReason:(NSString *)reason @@ -1505,7 +1507,7 @@ - (void)unitTestSetMostRecentReportTimes:(NSMutableArray *)mostRecentR std::lock_guard lock(_descriptionLock); _mostRecentReportTimeForDescription = [mostRecentReportTimes lastObject]; } - [self _notifyDelegateOfPrivateInternalPropertiesChanges]; + [self _notifyPrivateInternalPropertiesDelegateOfChanges]; } #endif @@ -1564,6 +1566,7 @@ - (void)_scheduleClusterDataPersistence std::lock_guard lock(_descriptionLock); _mostRecentReportTimeForDescription = [_mostRecentReportTimes lastObject]; } + [self _notifyPrivateInternalPropertiesDelegateOfChanges]; // Calculate running average and update multiplier - need at least 2 items to calculate intervals if (_mostRecentReportTimes.count > 2) { @@ -1610,8 +1613,6 @@ - (void)_scheduleClusterDataPersistence } } - [self _notifyDelegateOfPrivateInternalPropertiesChanges]; - // Do not schedule persistence if device is reporting excessively if ([self _deviceIsReportingExcessively]) { return; @@ -1636,6 +1637,7 @@ - (void)_resetStorageBehaviorState std::lock_guard lock(_descriptionLock); _mostRecentReportTimeForDescription = nil; } + [self _notifyPrivateInternalPropertiesDelegateOfChanges]; _deviceReportingExcessivelyStartTime = nil; _reportToPersistenceDelayCurrentMultiplier = 1; @@ -1644,8 +1646,6 @@ - (void)_resetStorageBehaviorState if ([self _dataStoreExists]) { [self _persistClusterData]; } - - [self _notifyDelegateOfPrivateInternalPropertiesChanges]; } - (void)setStorageBehaviorConfiguration:(MTRDeviceStorageBehaviorConfiguration *)storageBehaviorConfiguration @@ -1699,8 +1699,6 @@ - (void)_handleReportEnd } }]; #endif - - [self _notifyDelegateOfPrivateInternalPropertiesChanges]; } - (BOOL)_interestedPaths:(NSArray * _Nullable)interestedPaths includesAttributePath:(MTRAttributePath *)attributePath diff --git a/src/darwin/Framework/CHIP/MTRDevice_Internal.h b/src/darwin/Framework/CHIP/MTRDevice_Internal.h index baa34399bdb4d4..c3b6b60fa6314e 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDevice_Internal.h @@ -225,10 +225,6 @@ static NSString * const sLastInitialSubscribeLatencyKey = @"lastInitialSubscribe // Concrete to XPC internal state property dictionary keys static NSString * const kMTRDeviceInternalPropertyKeyVendorID = @"MTRDeviceInternalStateKeyVendorID"; static NSString * const kMTRDeviceInternalPropertyKeyProductID = @"MTRDeviceInternalStateKeyProductID"; -static NSString * const kMTRDeviceInternalPropertyNetworkFeatures = @"MTRDeviceInternalPropertyNetworkFeatures"; -static NSString * const kMTRDeviceInternalPropertyDeviceState = @"MTRDeviceInternalPropertyDeviceState"; -static NSString * const kMTRDeviceInternalPropertyLastSubscriptionAttemptWait = @"kMTRDeviceInternalPropertyLastSubscriptionAttemptWait"; -static NSString * const kMTRDeviceInternalPropertyMostRecentReportTime = @"MTRDeviceInternalPropertyMostRecentReportTime"; -static NSString * const kMTRDeviceInternalPropertyLastSubscriptionFailureTime = @"MTRDeviceInternalPropertyLastSubscriptionFailureTime"; +// TODO: more internal properties NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/MTRDevice_XPC.mm b/src/darwin/Framework/CHIP/MTRDevice_XPC.mm index 5279933104a11c..7267eb3a2b4f7e 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_XPC.mm +++ b/src/darwin/Framework/CHIP/MTRDevice_XPC.mm @@ -103,35 +103,32 @@ - (void)dealloc - (NSString *)description { - NSString * wifi; - NSString * thread; - NSNumber * networkFeatures = [self._internalState objectForKey:kMTRDeviceInternalPropertyNetworkFeatures]; + // TODO: Figure out whether, and if so how, to log: VID, PID, WiFi, Thread, + // internalDeviceState (do we even have such a thing here?), last + // subscription attempt wait (does that apply to us?) queued work (do we + // have any?), last report, last subscription failure (does that apply to us?). + return [NSString + stringWithFormat:@"<%@: %p, node: %016llX-%016llX (%llu), VID: %@, PID: %@, controller: %@>", NSStringFromClass(self.class), self, _deviceController.compressedFabricID.unsignedLongLongValue, _nodeID.unsignedLongLongValue, _nodeID.unsignedLongLongValue, [self _vid], [self _pid], _deviceController.uniqueIdentifier]; +} - if (networkFeatures == nil) { - wifi = @"NO"; - thread = @"NO"; +- (nullable NSNumber *)_internalStateNumberOrNilForKey:(NSString *)key +{ + if ([_internalState[key] isKindOfClass:NSNumber.class]) { + NSNumber * number = _internalState[key]; + return number; } else { - wifi = YES_NO(networkFeatures.unsignedLongLongValue & MTRNetworkCommissioningFeatureWiFiNetworkInterface); - thread = YES_NO(networkFeatures.unsignedLongLongValue & MTRNetworkCommissioningFeatureThreadNetworkInterface); + return nil; } +} - // TODO: Add these to the description - // MTR_OPTIONAL_ATTRIBUTE(kMTRDeviceInternalPropertyDeviceState, _internalDeviceStateForDescription, properties); - // MTR_OPTIONAL_ATTRIBUTE(kMTRDeviceInternalPropertyLastSubscriptionAttemptWait, _lastSubscriptionAttemptWaitForDescription, properties); - // MTR_OPTIONAL_ATTRIBUTE(kMTRDeviceInternalPropertyMostRecentReportTime, _mostRecentReportTimeForDescription, properties); - // MTR_OPTIONAL_ATTRIBUTE(kMTRDeviceInternalPropertyLastSubscriptionFailureTime, _lastSubscriptionFailureTimeForDescription, properties); +- (nullable NSNumber *)_vid +{ + return [self _internalStateNumberOrNilForKey:kMTRDeviceInternalPropertyKeyVendorID]; +} - return [NSString - stringWithFormat:@"<%@: %p, node: %016llX-%016llX (%llu), VID: %@, PID: %@, WiFi: %@, Thread: %@, controller: %@>", - NSStringFromClass(self.class), self, - _deviceController.compressedFabricID.unsignedLongLongValue, - _nodeID.unsignedLongLongValue, - _nodeID.unsignedLongLongValue, - [self._internalState objectForKey:kMTRDeviceInternalPropertyKeyVendorID], - [self._internalState objectForKey:kMTRDeviceInternalPropertyKeyProductID], - wifi, - thread, - _deviceController.uniqueIdentifier]; +- (nullable NSNumber *)_pid +{ + return [self _internalStateNumberOrNilForKey:kMTRDeviceInternalPropertyKeyProductID]; } #pragma mark - Client Callbacks (MTRDeviceDelegate) @@ -190,12 +187,6 @@ - (oneway void)deviceConfigurationChanged:(NSNumber *)nodeID }]; } -- (oneway void)device:(NSNumber *)nodeID internalStateUpdated:(NSDictionary *)dictionary -{ - [self _setInternalState:dictionary]; - MTR_LOG("%@ internal state updated", self); -} - #pragma mark - Remote Commands MTR_DEVICE_SIMPLE_REMOTE_XPC_GETTER(state, MTRDeviceState, MTRDeviceStateUnknown, getStateWithReply) diff --git a/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCClientProtocol.h b/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCClientProtocol.h index cfa59db8a73303..b26b6d88849193 100644 --- a/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCClientProtocol.h +++ b/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCClientProtocol.h @@ -27,6 +27,9 @@ MTR_NEWLY_AVAILABLE - (oneway void)deviceBecameActive:(NSNumber *)nodeID; - (oneway void)deviceCachePrimed:(NSNumber *)nodeID; - (oneway void)deviceConfigurationChanged:(NSNumber *)nodeID; + +@optional +// temporarily optional to avoid lockstep needs - (oneway void)device:(NSNumber *)nodeID internalStateUpdated:(NSDictionary *)dictionary; @end diff --git a/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCServerProtocol.h b/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCServerProtocol.h index 52a5d2228fa524..1ebdea5d3757ec 100644 --- a/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCServerProtocol.h +++ b/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCServerProtocol.h @@ -70,6 +70,9 @@ MTR_NEWLY_AVAILABLE //- (oneway void)deviceController:(NSUUID *)controller removeServerEndpoint:(MTRServerEndpoint *)endpoint; - (oneway void)deviceController:(NSUUID *)controller shutdownDeviceController:(NSUUID *)controller; + +@optional +// register / unregister temporarily optional to avoid lockstep needs - (oneway void)deviceController:(NSUUID *)controller registerNodeID:(NSNumber *)nodeID; - (oneway void)deviceController:(NSUUID *)controller unregisterNodeID:(NSNumber *)nodeID; From 4e18174be501c7fdbebc2e846751f2df246ef62f Mon Sep 17 00:00:00 2001 From: Vatsal Ghelani <152916324+vatsalghelani-csa@users.noreply.github.com> Date: Fri, 6 Sep 2024 17:48:21 -0400 Subject: [PATCH 23/42] Improve logging via flush of stdout (#35447) Co-authored-by: Andrei Litvin --- src/python_testing/execute_python_tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/python_testing/execute_python_tests.py b/src/python_testing/execute_python_tests.py index 956e252de6c8c2..de8908ca13be25 100644 --- a/src/python_testing/execute_python_tests.py +++ b/src/python_testing/execute_python_tests.py @@ -124,7 +124,7 @@ def main(search_directory, env_file): # Run each script with the base command for script in python_files: full_command = f"{base_command} --load-from-env {env_file} --script {script}" - print(f"Running command: {full_command}") + print(f"Running command: {full_command}", flush=True) # Flush print to stdout immediately subprocess.run(full_command, shell=True, check=True) From 2231f28a08e6f853f24fe2ed492b401db37162d8 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Fri, 6 Sep 2024 15:18:06 -0700 Subject: [PATCH 24/42] [Fabric-Sync] Enhance the startup script for improved diagnostics. (#35452) * Align the build images with CI * Restyled by whitespace --------- Co-authored-by: Restyled.io --- examples/fabric-admin/scripts/run_fabric_sync.sh | 2 ++ examples/fabric-bridge-app/linux/README.md | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/fabric-admin/scripts/run_fabric_sync.sh b/examples/fabric-admin/scripts/run_fabric_sync.sh index 957fe5f3cf16e9..49182f7ce92825 100755 --- a/examples/fabric-admin/scripts/run_fabric_sync.sh +++ b/examples/fabric-admin/scripts/run_fabric_sync.sh @@ -14,7 +14,9 @@ DEFAULT_BRIDGE_CHOICES=( "./fabric-bridge-app" "out/debug/standalone/fabric-bridge-app" "out/linux-x64-fabric-bridge-rpc/fabric-bridge-app" + "out/linux-x64-fabric-bridge-rpc-no-ble/fabric-bridge-app" "out/darwin-arm64-fabric-bridge-rpc/fabric-bridge-app" + "out/darwin-arm64-fabric-bridge-rpc-no-ble/fabric-bridge-app" ) FABRIC_ADMIN_LOG="/tmp/fabric_admin.log" FABRIC_BRIDGE_APP_LOG="/tmp/fabric_bridge_app.log" diff --git a/examples/fabric-bridge-app/linux/README.md b/examples/fabric-bridge-app/linux/README.md index 96e8a2924a65bc..27a01d9ffec60a 100644 --- a/examples/fabric-bridge-app/linux/README.md +++ b/examples/fabric-bridge-app/linux/README.md @@ -92,7 +92,7 @@ defined: ``` source scripts/activate.sh - ./scripts/build/build_examples.py --target linux-x64-fabric-bridge-rpc build + ./scripts/build/build_examples.py --target linux-x64-fabric-bridge-rpc-no-ble build ``` ### For Raspberry Pi 4 example: From 8a691ae4fb146d363b70b0b8379d4593ac1d6afd Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 6 Sep 2024 18:37:36 -0400 Subject: [PATCH 25/42] Make it easier to start "cross-test" helper apps in Darwin tests. (#35435) * Make it easier to start "cross-test" helper apps in Darwin tests. We shouldn't require a testcase instance to start such an app, since it's associated with the test suite, not a specific test. * Address review comment. Switch to just having app-starting functionality as a category on MTRTestCase. This is much easier to use. * Rename MTRTestServerAppRunner to MTRTestCase+ServerAppRunner. --- .../CHIPTests/MTRCommissionableBrowserTests.m | 30 ++++---- .../Framework/CHIPTests/MTROTAProviderTests.m | 9 +-- .../Framework/CHIPTests/MTRPairingTests.m | 17 +++-- .../CHIPTests/MTRPerControllerStorageTests.m | 11 ++- .../CHIPTests/MTRSwiftPairingTests.swift | 2 +- ...Runner.h => MTRTestCase+ServerAppRunner.h} | 21 ++---- ...Runner.m => MTRTestCase+ServerAppRunner.m} | 69 +++++++++---------- .../CHIPTests/TestHelpers/MTRTestCase.h | 12 +++- .../CHIPTests/TestHelpers/MTRTestCase.mm | 16 ++++- .../Matter.xcodeproj/project.pbxproj | 12 ++-- 10 files changed, 99 insertions(+), 100 deletions(-) rename src/darwin/Framework/CHIPTests/TestHelpers/{MTRTestServerAppRunner.h => MTRTestCase+ServerAppRunner.h} (64%) rename src/darwin/Framework/CHIPTests/TestHelpers/{MTRTestServerAppRunner.m => MTRTestCase+ServerAppRunner.m} (64%) diff --git a/src/darwin/Framework/CHIPTests/MTRCommissionableBrowserTests.m b/src/darwin/Framework/CHIPTests/MTRCommissionableBrowserTests.m index 185f4981cff405..15ef7a839de97a 100644 --- a/src/darwin/Framework/CHIPTests/MTRCommissionableBrowserTests.m +++ b/src/darwin/Framework/CHIPTests/MTRCommissionableBrowserTests.m @@ -17,9 +17,9 @@ #import +#import "MTRTestCase+ServerAppRunner.h" #import "MTRTestCase.h" #import "MTRTestKeys.h" -#import "MTRTestServerAppRunner.h" #import "MTRTestStorage.h" // Fixture 1: chip-all-clusters-app --KVS "$(mktemp -t chip-test-kvs)" --interface-id -1 @@ -31,8 +31,6 @@ static const uint16_t kDiscoverDeviceTimeoutInSeconds = 10; static const uint16_t kExpectedDiscoveredDevicesCount = 3; -static bool sHelperAppsStarted = false; - // Singleton controller we use. static MTRDeviceController * sController = nil; @@ -180,6 +178,17 @@ + (void)setUp XCTAssertNotNil(controller); sController = controller; + + // Start the helper apps our tests use. + for (NSString * payload in @[ + @"MT:Y.K90SO527JA0648G00", + @"MT:-24J0AFN00I40648G00", + ]) { + BOOL started = [self startAppWithName:@"all-clusters" + arguments:@[] + payload:payload]; + XCTAssertTrue(started); + } } + (void)tearDown @@ -197,21 +206,6 @@ + (void)tearDown - (void)setUp { [super setUp]; - - if (!sHelperAppsStarted) { - for (NSString * payload in @[ - @"MT:Y.K90SO527JA0648G00", - @"MT:-24J0AFN00I40648G00", - ]) { - __auto_type * appRunner = [[MTRTestServerAppRunner alloc] initCrossTestWithAppName:@"all-clusters" - arguments:@[] - payload:payload - testcase:self]; - XCTAssertNotNil(appRunner); - } - sHelperAppsStarted = true; - } - [self setContinueAfterFailure:NO]; } diff --git a/src/darwin/Framework/CHIPTests/MTROTAProviderTests.m b/src/darwin/Framework/CHIPTests/MTROTAProviderTests.m index 3c8cad690ad83b..f2deba2f1ddda6 100644 --- a/src/darwin/Framework/CHIPTests/MTROTAProviderTests.m +++ b/src/darwin/Framework/CHIPTests/MTROTAProviderTests.m @@ -20,10 +20,10 @@ #import "MTRDeviceTestDelegate.h" #import "MTRErrorTestUtils.h" +#import "MTRTestCase+ServerAppRunner.h" #import "MTRTestCase.h" #import "MTRTestKeys.h" #import "MTRTestResetCommissioneeHelper.h" -#import "MTRTestServerAppRunner.h" #import "MTRTestStorage.h" // system dependencies @@ -80,7 +80,7 @@ - (NSString *)createImageFromRawImage:(NSString *)rawImage withVersion:(NSNumber - (MTRDevice *)commissionDeviceWithPayload:(NSString *)payloadString nodeID:(NSNumber *)nodeID; @end -@interface MTROTARequestorAppRunner : MTRTestServerAppRunner +@interface MTROTARequestorAppRunner : NSObject @property (nonatomic, copy) NSString * downloadFilePath; - (instancetype)initWithPayload:(NSString *)payload testcase:(MTROTAProviderTests *)testcase; @@ -99,14 +99,15 @@ - (MTRDevice *)commissionWithNodeID:(NSNumber *)nodeID - (instancetype)initWithPayload:(NSString *)payload testcase:(MTROTAProviderTests *)testcase { - __auto_type * downloadFilePath = [NSString stringWithFormat:@"/tmp/chip-ota-requestor-downloaded-image%u", [MTRTestServerAppRunner nextUniqueIndex]]; + __auto_type * downloadFilePath = [NSString stringWithFormat:@"/tmp/chip-ota-requestor-downloaded-image%u", [MTROTAProviderTests nextUniqueIndex]]; __auto_type * extraArguments = @[ @"--otaDownloadPath", downloadFilePath, @"--autoApplyImage", ]; - if (!(self = [super initWithAppName:@"ota-requestor" arguments:extraArguments payload:payload testcase:testcase])) { + BOOL started = [testcase startAppWithName:@"ota-requestor" arguments:extraArguments payload:payload]; + if (!started) { return nil; } diff --git a/src/darwin/Framework/CHIPTests/MTRPairingTests.m b/src/darwin/Framework/CHIPTests/MTRPairingTests.m index 38f7667590bca7..cd1802dff3dd47 100644 --- a/src/darwin/Framework/CHIPTests/MTRPairingTests.m +++ b/src/darwin/Framework/CHIPTests/MTRPairingTests.m @@ -19,9 +19,9 @@ #import #import "MTRErrorTestUtils.h" +#import "MTRTestCase+ServerAppRunner.h" #import "MTRTestCase.h" #import "MTRTestKeys.h" -#import "MTRTestServerAppRunner.h" #import "MTRTestStorage.h" static const uint16_t kPairingTimeoutInSeconds = 10; @@ -186,14 +186,13 @@ - (void)tearDown - (void)startServerApp { // For manual testing, CASE retry code paths can be tested by adding --faults chip_CASEServerBusy_f1 (or similar) - __auto_type * appRunner = [[MTRTestServerAppRunner alloc] initWithAppName:@"all-clusters" - arguments:@[ - @"--dac_provider", - [self absolutePathFor:@"credentials/development/commissioner_dut/struct_cd_origin_pid_vid_correct/test_case_vector.json"], - ] - payload:kOnboardingPayload - testcase:self]; - XCTAssertNotNil(appRunner); + BOOL started = [self startAppWithName:@"all-clusters" + arguments:@[ + @"--dac_provider", + [self absolutePathFor:@"credentials/development/commissioner_dut/struct_cd_origin_pid_vid_correct/test_case_vector.json"], + ] + payload:kOnboardingPayload]; + XCTAssertTrue(started); } // attestationDelegate and failSafeExtension can both be nil diff --git a/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m b/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m index db8bd300df94e1..35df3471e43338 100644 --- a/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m +++ b/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m @@ -24,12 +24,12 @@ #import "MTRDevice_Internal.h" #import "MTRErrorTestUtils.h" #import "MTRFabricInfoChecker.h" +#import "MTRTestCase+ServerAppRunner.h" #import "MTRTestCase.h" #import "MTRTestDeclarations.h" #import "MTRTestKeys.h" #import "MTRTestPerControllerStorage.h" #import "MTRTestResetCommissioneeHelper.h" -#import "MTRTestServerAppRunner.h" static const uint16_t kPairingTimeoutInSeconds = 10; static const uint16_t kTimeoutInSeconds = 3; @@ -2437,11 +2437,10 @@ - (void)testSubscriptionPool // Start our helper apps. __auto_type * sortedKeys = [[deviceOnboardingPayloads allKeys] sortedArrayUsingSelector:@selector(compare:)]; for (NSNumber * deviceID in sortedKeys) { - __auto_type * appRunner = [[MTRTestServerAppRunner alloc] initWithAppName:@"all-clusters" - arguments:@[] - payload:deviceOnboardingPayloads[deviceID] - testcase:self]; - XCTAssertNotNil(appRunner); + BOOL started = [self startAppWithName:@"all-clusters" + arguments:@[] + payload:deviceOnboardingPayloads[deviceID]]; + XCTAssertTrue(started); } [self doTestSubscriptionPoolWithSize:1 deviceOnboardingPayloads:deviceOnboardingPayloads]; diff --git a/src/darwin/Framework/CHIPTests/MTRSwiftPairingTests.swift b/src/darwin/Framework/CHIPTests/MTRSwiftPairingTests.swift index 31ecb93236429c..907b9a2761673c 100644 --- a/src/darwin/Framework/CHIPTests/MTRSwiftPairingTests.swift +++ b/src/darwin/Framework/CHIPTests/MTRSwiftPairingTests.swift @@ -3,7 +3,7 @@ import XCTest // This more or less parallels the "no delegate" case in MTRPairingTests, but uses the "normal" // all-clusters-app, since it does not do any of the "interesting" VID/PID notification so far. If -// it ever starts needing to do that, we should figure out a way to use MTRTestServerAppRunner from +// it ever starts needing to do that, we should figure out a way to use MTRTestCase+ServerAppRunner from // here. struct PairingConstants { diff --git a/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestServerAppRunner.h b/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestCase+ServerAppRunner.h similarity index 64% rename from src/darwin/Framework/CHIPTests/TestHelpers/MTRTestServerAppRunner.h rename to src/darwin/Framework/CHIPTests/TestHelpers/MTRTestCase+ServerAppRunner.h index b54b7dbd78cfce..8eb9384f67e01e 100644 --- a/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestServerAppRunner.h +++ b/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestCase+ServerAppRunner.h @@ -16,21 +16,14 @@ #import -@class MTRTestCase; +#import "MTRTestCase.h" NS_ASSUME_NONNULL_BEGIN -/** - * A representation of a server application instance. - * - * Server applications are assumed to be compiled into out/debug/${APPNAME}-app, - * with the binary being out/debug/${APPNAME}-app/chip-${APPNAME}-app. - */ -@interface MTRTestServerAppRunner : NSObject +@interface MTRTestCase (ServerAppRunner) /** - * Initialize the app runner with the given app name, arguments, setup payload, and testcase - * instance. + * Start a server app with the given app name, arguments, and setup payload. * * The payload will be used to determine the discriminator and passcode * arguments the app should use, in addition to the provided arguments. @@ -43,13 +36,13 @@ NS_ASSUME_NONNULL_BEGIN * subtracting 1111 from the discriminator and adding 5542 (so as not to collide * with any existing Matter things running on 5540/5541). */ -- (instancetype)initWithAppName:(NSString *)name arguments:(NSArray *)arguments payload:(NSString *)payload testcase:(MTRTestCase *)testcase; +- (BOOL)startAppWithName:(NSString *)name arguments:(NSArray *)arguments payload:(NSString *)payload; /** - * Same thing, but initialize as a "cross test" helper, which is not killed at - * the end of the current test (but is killed at the end of the current suite). + * Same thing, but the server will be killed at the end of the current suite, + * and is not bound to a particular test in the suite. */ -- (instancetype)initCrossTestWithAppName:(NSString *)name arguments:(NSArray *)arguments payload:(NSString *)payload testcase:(MTRTestCase *)testcase; ++ (BOOL)startAppWithName:(NSString *)name arguments:(NSArray *)arguments payload:(NSString *)payload; /** * Get the unique index that will be used for the next initialization. This diff --git a/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestServerAppRunner.m b/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestCase+ServerAppRunner.m similarity index 64% rename from src/darwin/Framework/CHIPTests/TestHelpers/MTRTestServerAppRunner.m rename to src/darwin/Framework/CHIPTests/TestHelpers/MTRTestCase+ServerAppRunner.m index cc64d62e71d516..82d9cf114238a3 100644 --- a/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestServerAppRunner.m +++ b/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestCase+ServerAppRunner.m @@ -16,8 +16,7 @@ #import -#import "MTRTestCase.h" -#import "MTRTestServerAppRunner.h" +#import "MTRTestCase+ServerAppRunner.h" static unsigned sAppRunnerIndex = 1; @@ -29,24 +28,12 @@ static const uint16_t kBasePort = 5542 - kMinDiscriminator; #endif // HAVE_NSTASK -@implementation MTRTestServerAppRunner { - unsigned _uniqueIndex; -#if HAVE_NSTASK - NSTask * _appTask; -#endif -} +@implementation MTRTestCase (ServerAppRunner) -- (instancetype)initInternalWithAppName:(NSString *)name arguments:(NSArray *)arguments payload:(NSString *)payload testcase:(MTRTestCase *)testcase isCrossTest:(BOOL)isCrossTest +#if HAVE_NSTASK ++ (NSTask *)doStartAppWithName:(NSString *)name arguments:(NSArray *)arguments payload:(NSString *)payload { -#if !HAVE_NSTASK - XCTFail("Unable to start server app when we do not have NSTask"); - return nil; -#else // HAVE_NSTASK - if (!(self = [super init])) { - return nil; - } - - _uniqueIndex = sAppRunnerIndex++; + __auto_type uniqueIndex = sAppRunnerIndex++; NSError * error; __auto_type * parsedPayload = [MTRSetupPayload setupPayloadWithOnboardingPayload:payload error:&error]; @@ -61,7 +48,7 @@ - (instancetype)initInternalWithAppName:(NSString *)name arguments:(NSArray *)arguments payload:(NSString *)payload testcase:(MTRTestCase *)testcase +- (BOOL)startAppWithName:(NSString *)name arguments:(NSArray *)arguments payload:(NSString *)payload { - return [self initInternalWithAppName:name arguments:arguments payload:payload testcase:testcase isCrossTest:NO]; +#if !HAVE_NSTASK + XCTFail("Unable to start server app when we do not have NSTask"); + return NO; +#else + [self launchTask:[self.class doStartAppWithName:name arguments:arguments payload:payload]]; + return YES; +#endif // HAVE_NSTASK } -- (instancetype)initCrossTestWithAppName:(NSString *)name arguments:(NSArray *)arguments payload:(NSString *)payload testcase:(MTRTestCase *)testcase ++ (BOOL)startAppWithName:(NSString *)name arguments:(NSArray *)arguments payload:(NSString *)payload { - return [self initInternalWithAppName:name arguments:arguments payload:payload testcase:testcase isCrossTest:YES]; +#if !HAVE_NSTASK + XCTFail("Unable to start server app when we do not have NSTask"); + return NO; +#else + [self launchTask:[self doStartAppWithName:name arguments:arguments payload:payload]]; + return YES; +#endif // HAVE_NSTASK } + (unsigned)nextUniqueIndex diff --git a/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestCase.h b/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestCase.h index e3668bb90e1fca..3b404f6f05b1f4 100644 --- a/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestCase.h +++ b/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestCase.h @@ -37,6 +37,11 @@ NS_ASSUME_NONNULL_BEGIN */ - (NSTask *)createTaskForPath:(NSString *)path; +/** + * Same thing, but not tied to a specific testcase instance. + */ ++ (NSTask *)createTaskForPath:(NSString *)path; + /** * Run a task to completion and make sure it succeeds. */ @@ -52,7 +57,7 @@ NS_ASSUME_NONNULL_BEGIN * Launch a cross-test task. The task will be automatically terminated when the testsuite * tearDown happens. */ -- (void)launchCrossTestTask:(NSTask *)task; ++ (void)launchTask:(NSTask *)task; #endif // HAVE_NSTASK /** @@ -60,6 +65,11 @@ NS_ASSUME_NONNULL_BEGIN */ - (NSString *)absolutePathFor:(NSString *)matterRootRelativePath; +/** + * Same thing, but not tied to a specific testcase instance. + */ ++ (NSString *)absolutePathFor:(NSString *)matterRootRelativePath; + @end NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestCase.mm b/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestCase.mm index fc615cc927d06b..a418393a0fca79 100644 --- a/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestCase.mm +++ b/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestCase.mm @@ -86,6 +86,11 @@ - (void)tearDown #if HAVE_NSTASK - (NSTask *)createTaskForPath:(NSString *)path +{ + return [self.class createTaskForPath:path]; +} + ++ (NSTask *)createTaskForPath:(NSString *)path { NSTask * task = [[NSTask alloc] init]; [task setLaunchPath:[self absolutePathFor:path]]; @@ -102,7 +107,7 @@ - (void)runTask:(NSTask *)task XCTAssertEqual([task terminationStatus], 0); } -- (void)doLaunchTask:(NSTask *)task ++ (void)doLaunchTask:(NSTask *)task { NSError * launchError; [task launchAndReturnError:&launchError]; @@ -111,12 +116,12 @@ - (void)doLaunchTask:(NSTask *)task - (void)launchTask:(NSTask *)task { - [self doLaunchTask:task]; + [self.class doLaunchTask:task]; [_runningTasks addObject:task]; } -- (void)launchCrossTestTask:(NSTask *)task ++ (void)launchTask:(NSTask *)task { [self doLaunchTask:task]; @@ -125,6 +130,11 @@ - (void)launchCrossTestTask:(NSTask *)task #endif // HAVE_NSTASK - (NSString *)absolutePathFor:(NSString *)matterRootRelativePath +{ + return [self.class absolutePathFor:matterRootRelativePath]; +} + ++ (NSString *)absolutePathFor:(NSString *)matterRootRelativePath { // Start with the absolute path to our file, then remove the suffix that // comes after the path to the Matter SDK root. diff --git a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj index 69de347df8341c..afc1df19338b46 100644 --- a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj +++ b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj @@ -232,7 +232,7 @@ 51EF279F2A2A3EB100E33F75 /* MTRBackwardsCompatShims.h in Headers */ = {isa = PBXBuildFile; fileRef = 51EF279E2A2A3EB100E33F75 /* MTRBackwardsCompatShims.h */; settings = {ATTRIBUTES = (Public, ); }; }; 51F522682AE70734000C4050 /* MTRDeviceTypeMetadata.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51F522672AE70734000C4050 /* MTRDeviceTypeMetadata.mm */; }; 51F5226A2AE70761000C4050 /* MTRDeviceTypeMetadata.h in Headers */ = {isa = PBXBuildFile; fileRef = 51F522692AE70761000C4050 /* MTRDeviceTypeMetadata.h */; }; - 51F9F9D52BF7A9EE00FEA0E2 /* MTRTestServerAppRunner.m in Sources */ = {isa = PBXBuildFile; fileRef = 51F9F9D42BF7A9EE00FEA0E2 /* MTRTestServerAppRunner.m */; }; + 51F9F9D52BF7A9EE00FEA0E2 /* MTRTestCase+ServerAppRunner.m in Sources */ = {isa = PBXBuildFile; fileRef = 51F9F9D42BF7A9EE00FEA0E2 /* MTRTestCase+ServerAppRunner.m */; }; 51FE72352ACDB40000437032 /* MTRCommandPayloads_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 51FE72342ACDB40000437032 /* MTRCommandPayloads_Internal.h */; }; 51FE723F2ACDEF3E00437032 /* MTRCommandPayloadExtensions_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 51FE723E2ACDEF3E00437032 /* MTRCommandPayloadExtensions_Internal.h */; }; 5A60370827EA1FF60020DB79 /* MTRClusterStateCacheContainer+XPC.h in Headers */ = {isa = PBXBuildFile; fileRef = 5A60370727EA1FF60020DB79 /* MTRClusterStateCacheContainer+XPC.h */; }; @@ -670,8 +670,8 @@ 51F522662AE7071E000C4050 /* MTRDeviceTypeMetadata-src.zapt */ = {isa = PBXFileReference; lastKnownFileType = text; path = "MTRDeviceTypeMetadata-src.zapt"; sourceTree = ""; }; 51F522672AE70734000C4050 /* MTRDeviceTypeMetadata.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRDeviceTypeMetadata.mm; sourceTree = ""; }; 51F522692AE70761000C4050 /* MTRDeviceTypeMetadata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRDeviceTypeMetadata.h; sourceTree = ""; }; - 51F9F9D32BF7A9EE00FEA0E2 /* MTRTestServerAppRunner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRTestServerAppRunner.h; sourceTree = ""; }; - 51F9F9D42BF7A9EE00FEA0E2 /* MTRTestServerAppRunner.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MTRTestServerAppRunner.m; sourceTree = ""; }; + 51F9F9D32BF7A9EE00FEA0E2 /* MTRTestCase+ServerAppRunner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MTRTestCase+ServerAppRunner.h"; sourceTree = ""; }; + 51F9F9D42BF7A9EE00FEA0E2 /* MTRTestCase+ServerAppRunner.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MTRTestCase+ServerAppRunner.m"; sourceTree = ""; }; 51FE72342ACDB40000437032 /* MTRCommandPayloads_Internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRCommandPayloads_Internal.h; sourceTree = ""; }; 51FE723E2ACDEF3E00437032 /* MTRCommandPayloadExtensions_Internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRCommandPayloadExtensions_Internal.h; sourceTree = ""; }; 5A60370727EA1FF60020DB79 /* MTRClusterStateCacheContainer+XPC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MTRClusterStateCacheContainer+XPC.h"; sourceTree = ""; }; @@ -1177,8 +1177,8 @@ 5131BF642BE2E1B000D5D6BC /* MTRTestCase.mm */, D437613F285BDC0D0051FEA2 /* MTRTestKeys.h */, 51C8E3F72825CDB600D47D00 /* MTRTestKeys.m */, - 51F9F9D32BF7A9EE00FEA0E2 /* MTRTestServerAppRunner.h */, - 51F9F9D42BF7A9EE00FEA0E2 /* MTRTestServerAppRunner.m */, + 51F9F9D32BF7A9EE00FEA0E2 /* MTRTestCase+ServerAppRunner.h */, + 51F9F9D42BF7A9EE00FEA0E2 /* MTRTestCase+ServerAppRunner.m */, D4376140285BDC0D0051FEA2 /* MTRTestStorage.h */, 51D10D2D2808E2CA00E8CA3D /* MTRTestStorage.m */, D437613E285BDC0D0051FEA2 /* MTRErrorTestUtils.h */, @@ -2111,7 +2111,7 @@ 510CECA8297F72970064E0B3 /* MTROperationalCertificateIssuerTests.m in Sources */, 5A7947DE27BEC3F500434CF2 /* MTRXPCListenerSampleTests.m in Sources */, 3DFCB3292966684500332B35 /* MTRCertificateInfoTests.m in Sources */, - 51F9F9D52BF7A9EE00FEA0E2 /* MTRTestServerAppRunner.m in Sources */, + 51F9F9D52BF7A9EE00FEA0E2 /* MTRTestCase+ServerAppRunner.m in Sources */, 517BF3F3282B62CB00A8B7DB /* MTRCertificateTests.m in Sources */, 5142E39829D377F000A206F0 /* MTROTAProviderTests.m in Sources */, 51E0FC102ACBBF230001E197 /* MTRSwiftDeviceTests.swift in Sources */, From 6f1663fbc308f35a1879f91da08afefcadaa74df Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 6 Sep 2024 18:41:43 -0400 Subject: [PATCH 26/42] Remove mentions of client-side global attributes in the ZAP XML. (#35449) Client-side attributes do not exist in Matter. --- src/app/zap-templates/zcl/data-model/chip/global-attributes.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/app/zap-templates/zcl/data-model/chip/global-attributes.xml b/src/app/zap-templates/zcl/data-model/chip/global-attributes.xml index 4b473a8ea26037..bad94e46df67bf 100644 --- a/src/app/zap-templates/zcl/data-model/chip/global-attributes.xml +++ b/src/app/zap-templates/zcl/data-model/chip/global-attributes.xml @@ -16,9 +16,7 @@ limitations under the License. --> - ClusterRevision ClusterRevision - FeatureMap FeatureMap AttributeList EventList From d5a3b4f388bfc8c36b17199816b845b1b8b6cc6b Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 6 Sep 2024 19:49:03 -0400 Subject: [PATCH 27/42] Sync up MTRDeviceController and MTRDeviceController_Concrete and actually start using the latter. (#35453) Specific changes: * Fix includes in MTRDeviceController_Concrete, since it uses std::optional and os_unfair_lock, and includes MTRDeviceController.h via MTRDeviceController_Concrete.h already (and has to, because of the inheritance). * Copy the assertion counter machinery into MTRDeviceController_Concrete for now. This includes the storage of the variables that machinery relies on. * Remove incorrect deviceMapLock @synthesize: this is just implemented by the superclass, no need to do anything with it in the subclass. * Switch the places that are starting a non-XPC controller to create instances of MTRDeviceController_Concrete, not MTRDeviceController. --- .../Framework/CHIP/MTRDeviceController.mm | 11 +- .../CHIP/MTRDeviceControllerFactory.mm | 5 +- .../CHIP/MTRDeviceController_Concrete.mm | 130 +++++++++++++++--- 3 files changed, 123 insertions(+), 23 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm index f6dc54fbc1dd19..b743b9fb6fabad 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm @@ -31,6 +31,7 @@ #import "MTRDeviceControllerLocalTestStorage.h" #import "MTRDeviceControllerStartupParams.h" #import "MTRDeviceControllerStartupParams_Internal.h" +#import "MTRDeviceController_Concrete.h" #import "MTRDeviceController_XPC.h" #import "MTRDevice_Concrete.h" #import "MTRDevice_Internal.h" @@ -82,6 +83,8 @@ #import +// TODO: These strings and their consumers in this file should probably go away, +// since none of them really apply to all controllers. static NSString * const kErrorCommissionerInit = @"Init failure while initializing a commissioner"; static NSString * const kErrorIPKInit = @"Init failure while initializing IPK"; static NSString * const kErrorSigningKeypairInit = @"Init failure while creating signing keypair bridge"; @@ -176,7 +179,7 @@ - (nullable MTRDeviceController *)initWithParameters:(MTRDeviceControllerAbstrac auto * controllerParameters = static_cast(parameters); // MTRDeviceControllerFactory will auto-start in per-controller-storage mode if necessary - return [MTRDeviceControllerFactory.sharedInstance initializeController:self withParameters:controllerParameters error:error]; + return [MTRDeviceControllerFactory.sharedInstance initializeController:[MTRDeviceController_Concrete alloc] withParameters:controllerParameters error:error]; } - (instancetype)initWithFactory:(MTRDeviceControllerFactory *)factory @@ -1718,6 +1721,9 @@ + (void)forceLocalhostAdvertisingOnly @end +// TODO: This should not be in the superclass: either move to +// MTRDeviceController_Concrete.mm, or move into a separate .h/.mm pair of +// files. @implementation MTRDevicePairingDelegateShim - (instancetype)initWithDelegate:(id)delegate { @@ -1770,6 +1776,9 @@ - (void)onPairingDeleted:(NSError * _Nullable)error * Shim to allow us to treat an MTRNOCChainIssuer as an * MTROperationalCertificateIssuer. */ +// TODO: This should not be in the superclass: either move to +// MTRDeviceController_Concrete.mm, or move into a separate .h/.mm pair of +// files. @interface MTROperationalCertificateChainIssuerShim : NSObject @property (nonatomic, readonly) id nocChainIssuer; @property (nonatomic, readonly) BOOL shouldSkipAttestationCertificateValidation; diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm index e0488f974b13b8..6ef4064a19f2f1 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm @@ -28,6 +28,7 @@ #import "MTRDeviceController.h" #import "MTRDeviceControllerStartupParams.h" #import "MTRDeviceControllerStartupParams_Internal.h" +#import "MTRDeviceController_Concrete.h" #import "MTRDeviceController_Internal.h" #import "MTRDiagnosticLogsDownloader.h" #import "MTRError_Internal.h" @@ -669,7 +670,7 @@ - (MTRDeviceController * _Nullable)createControllerOnExistingFabric:(MTRDeviceCo return existingController; } - return [self _startDeviceController:[MTRDeviceController alloc] + return [self _startDeviceController:[MTRDeviceController_Concrete alloc] startupParams:startupParams fabricChecker:^MTRDeviceControllerStartupParamsInternal *( FabricTable * fabricTable, MTRDeviceController * controller, CHIP_ERROR & fabricError) { @@ -741,7 +742,7 @@ - (MTRDeviceController * _Nullable)createControllerOnNewFabric:(MTRDeviceControl return nil; } - return [self _startDeviceController:[MTRDeviceController alloc] + return [self _startDeviceController:[MTRDeviceController_Concrete alloc] startupParams:startupParams fabricChecker:^MTRDeviceControllerStartupParamsInternal *( FabricTable * fabricTable, MTRDeviceController * controller, CHIP_ERROR & fabricError) { diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm index 6e7d056270d1e0..fba26d9ba79e03 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm @@ -26,7 +26,6 @@ #import "MTRCommissionableBrowserResult_Internal.h" #import "MTRCommissioningParameters.h" #import "MTRConversion.h" -#import "MTRDeviceController.h" #import "MTRDeviceControllerDelegateBridge.h" #import "MTRDeviceControllerFactory_Internal.h" #import "MTRDeviceControllerLocalTestStorage.h" @@ -50,6 +49,7 @@ #import "MTRSetupPayload.h" #import "MTRTimeUtils.h" #import "MTRUnfairLock.h" +#import "MTRUtilities.h" #import "NSDataSpanConversion.h" #import "NSStringSpanConversion.h" #import @@ -80,8 +80,11 @@ #include #include +#include #include +#import + typedef void (^SyncWorkQueueBlock)(void); typedef id (^SyncWorkQueueBlockWithReturnValue)(void); typedef BOOL (^SyncWorkQueueBlockWithBoolReturnValue)(void); @@ -114,19 +117,29 @@ @interface MTRDeviceController_Concrete () @end @implementation MTRDeviceController_Concrete { - // queue used to serialize all work performed by the MTRDeviceController std::atomic _storedFabricIndex; std::atomic> _storedCompressedFabricID; MTRP256KeypairBridge _signingKeypairBridge; MTRP256KeypairBridge _operationalKeypairBridge; + + // Counters to track assertion status and access controlled by the _assertionLock + // TODO: Figure out whether they should live here or in the base class (or + // go away completely!), which depends on how the shutdown codepaths get set up. + NSUInteger _keepRunningAssertionCounter; + BOOL _shutdownPending; + os_unfair_lock _assertionLock; } -// MTRDeviceController ivar internal access +// TODO: Figure out whether uniqueIdentifier storage should live in the superclass. It +// probably should! @synthesize uniqueIdentifier = _uniqueIdentifier; +// TODO: Figure out whether the work queue storage lives here or in the superclass +// Right now we seem to have both? @synthesize chipWorkQueue = _chipWorkQueue; @synthesize controllerDataStore = _controllerDataStore; +// TODO: For these remaining ivars, figure out whether they should live here or +// on the superclass. Should not be both. @synthesize factory = _factory; -@synthesize deviceMapLock = _deviceMapLock; @synthesize otaProviderDelegate = _otaProviderDelegate; @synthesize otaProviderDelegateQueue = _otaProviderDelegateQueue; @synthesize commissionableBrowser = _commissionableBrowser; @@ -165,7 +178,7 @@ - (nullable instancetype)initWithParameters:(MTRDeviceControllerAbstractParamete MTR_LOG_DEBUG("%s: got standard parameters, getting standard device controller from factory", __PRETTY_FUNCTION__); auto * controllerParameters = static_cast(parameters); - // or, if necessary, MTRDeviceControllerFactory will auto-start in per-controller-storage mode if necessary + // Start us up normally. MTRDeviceControllerFactory will auto-start in per-controller-storage mode if necessary. MTRDeviceControllerFactory * factory = MTRDeviceControllerFactory.sharedInstance; id controller = [factory initializeController:self withParameters:controllerParameters @@ -196,6 +209,12 @@ - (instancetype)initWithFactory:(MTRDeviceControllerFactory *)factory // Make sure our storage is all set up to work as early as possible, // before we start doing anything else with the controller. _uniqueIdentifier = uniqueIdentifier; + + // Setup assertion variables + _keepRunningAssertionCounter = 0; + _shutdownPending = NO; + _assertionLock = OS_UNFAIR_LOCK_INIT; + if (storageDelegate != nil) { if (storageDelegateQueue == nil) { MTR_LOG_ERROR("storageDelegate provided without storageDelegateQueue"); @@ -269,6 +288,7 @@ - (instancetype)initWithFactory:(MTRDeviceControllerFactory *)factory _otaProviderDelegateQueue = otaProviderDelegateQueue; _chipWorkQueue = queue; _factory = factory; + // TODO: Shouldn't nodeIDToDeviceMap just be set up by initForSubclasses? self.nodeIDToDeviceMap = [NSMapTable strongToWeakObjectsMapTable]; _serverEndpoints = [[NSMutableArray alloc] init]; _commissionableBrowser = nil; @@ -310,6 +330,10 @@ - (instancetype)initWithFactory:(MTRDeviceControllerFactory *)factory _concurrentSubscriptionPool = [[MTRAsyncWorkQueue alloc] initWithContext:self width:concurrentSubscriptionPoolSize]; _storedFabricIndex = chip::kUndefinedFabricIndex; + _storedCompressedFabricID = std::nullopt; + self.nodeID = nil; + self.fabricID = nil; + self.rootPublicKey = nil; _storageBehaviorConfiguration = storageBehaviorConfiguration; } @@ -326,8 +350,68 @@ - (BOOL)isRunning return _cppCommissioner != nullptr; } +- (BOOL)matchesPendingShutdownControllerWithOperationalCertificate:(nullable MTRCertificateDERBytes)operationalCertificate andRootCertificate:(nullable MTRCertificateDERBytes)rootCertificate +{ + if (!operationalCertificate || !rootCertificate) { + return FALSE; + } + NSNumber * nodeID = [MTRDeviceControllerParameters nodeIDFromNOC:operationalCertificate]; + NSNumber * fabricID = [MTRDeviceControllerParameters fabricIDFromNOC:operationalCertificate]; + NSData * publicKey = [MTRDeviceControllerParameters publicKeyFromCertificate:rootCertificate]; + + std::lock_guard lock(_assertionLock); + + // If any of the local above are nil, the return will be false since MTREqualObjects handles them correctly + return _keepRunningAssertionCounter > 0 && _shutdownPending && MTREqualObjects(nodeID, self.nodeID) && MTREqualObjects(fabricID, self.fabricID) && MTREqualObjects(publicKey, self.rootPublicKey); +} + +- (void)addRunAssertion +{ + std::lock_guard lock(_assertionLock); + + // Only take an assertion if running + if ([self isRunning]) { + ++_keepRunningAssertionCounter; + MTR_LOG("%@ Adding keep running assertion, total %lu", self, static_cast(_keepRunningAssertionCounter)); + } +} + +- (void)removeRunAssertion; +{ + std::lock_guard lock(_assertionLock); + + if (_keepRunningAssertionCounter > 0) { + --_keepRunningAssertionCounter; + MTR_LOG("%@ Removing keep running assertion, total %lu", self, static_cast(_keepRunningAssertionCounter)); + + if ([self isRunning] && _keepRunningAssertionCounter == 0 && _shutdownPending) { + MTR_LOG("%@ All assertions removed and shutdown is pending, shutting down", self); + [self finalShutdown]; + } + } +} + +- (void)clearPendingShutdown +{ + std::lock_guard lock(_assertionLock); + _shutdownPending = NO; +} + - (void)shutdown { + std::lock_guard lock(_assertionLock); + + if (_keepRunningAssertionCounter > 0) { + MTR_LOG("%@ Pending shutdown since %lu assertions are present", self, static_cast(_keepRunningAssertionCounter)); + _shutdownPending = YES; + return; + } + [self finalShutdown]; +} + +- (void)finalShutdown +{ + os_unfair_lock_assert_owner(&_assertionLock); MTR_LOG("%@ shutdown called", self); if (_cppCommissioner == nullptr) { // Already shut down. @@ -383,11 +467,17 @@ - (void)shutDownCppController // shutdown completes, in case it wants to write to storage as it // shuts down. _storedFabricIndex = chip::kUndefinedFabricIndex; + _storedCompressedFabricID = std::nullopt; + self.nodeID = nil; + self.fabricID = nil; + self.rootPublicKey = nil; + delete commissionerToShutDown; if (_operationalCredentialsDelegate != nil) { _operationalCredentialsDelegate->SetDeviceCommissioner(nullptr); } } + _shutdownPending = NO; } - (void)deinitFromFactory @@ -622,6 +712,15 @@ - (BOOL)startup:(MTRDeviceControllerStartupParamsInternal *)startupParams } self->_storedFabricIndex = fabricIdx; + self->_storedCompressedFabricID = _cppCommissioner->GetCompressedFabricId(); + + chip::Crypto::P256PublicKey rootPublicKey; + if (_cppCommissioner->GetRootPublicKey(rootPublicKey) == CHIP_NO_ERROR) { + self.rootPublicKey = [NSData dataWithBytes:rootPublicKey.Bytes() length:rootPublicKey.Length()]; + self.nodeID = @(_cppCommissioner->GetNodeId()); + self.fabricID = @(_cppCommissioner->GetFabricId()); + } + commissionerInitialized = YES; MTR_LOG("%@ startup succeeded for nodeID 0x%016llX", self, self->_cppCommissioner->GetNodeId()); @@ -669,7 +768,7 @@ - (BOOL)startup:(MTRDeviceControllerStartupParamsInternal *)startupParams }); }]; } - MTR_LOG("%s: startup: %@", __PRETTY_FUNCTION__, self); + MTR_LOG("%@ startup: %@", NSStringFromClass(self.class), self); return YES; } @@ -1279,6 +1378,9 @@ - (BOOL)checkForStartError:(CHIP_ERROR)errorCode logMsg:(NSString *)logMsg return YES; } +// TODO: Figure out whether this should live here or in superclass; we shouldn't +// have two copies of this thing. Probably after removing code from the +// superclass that should not be there. + (BOOL)checkForError:(CHIP_ERROR)errorCode logMsg:(NSString *)logMsg error:(NSError * __autoreleasing *)error { if (CHIP_NO_ERROR == errorCode) { @@ -1472,20 +1574,8 @@ - (BOOL)syncRunOnWorkQueueWithBoolReturnValue:(SyncWorkQueueBlockWithBoolReturnV - (nullable NSNumber *)compressedFabricID { - assertChipStackLockedByCurrentThread(); - - if (!_cppCommissioner) { - return nil; - } - - return @(_cppCommissioner->GetCompressedFabricId()); -} - -- (NSNumber * _Nullable)syncGetCompressedFabricID -{ - return [self syncRunOnWorkQueueWithReturnValue:^NSNumber * { - return [self compressedFabricID]; - } error:nil]; + auto storedValue = _storedCompressedFabricID.load(); + return storedValue.has_value() ? @(storedValue.value()) : nil; } - (CHIP_ERROR)isRunningOnFabric:(chip::FabricTable *)fabricTable From b3d527e8913a7bcc50003437d377f223f144e49a Mon Sep 17 00:00:00 2001 From: Jeff Tung <100387939+jtung-apple@users.noreply.github.com> Date: Fri, 6 Sep 2024 17:27:40 -0700 Subject: [PATCH 28/42] [Darwin] Add internal method to get report of all attributes to MTRDevice (#35463) --- src/darwin/Framework/CHIP/MTRDevice.mm | 11 ++++ .../Framework/CHIP/MTRDevice_Concrete.mm | 27 +++++++++ .../Framework/CHIP/MTRDevice_Internal.h | 3 + .../Framework/CHIPTests/MTRDeviceTests.m | 56 +++++++++++++++++++ 4 files changed, 97 insertions(+) diff --git a/src/darwin/Framework/CHIP/MTRDevice.mm b/src/darwin/Framework/CHIP/MTRDevice.mm index 01b6b2ebbd24e8..ceca6d27830f8c 100644 --- a/src/darwin/Framework/CHIP/MTRDevice.mm +++ b/src/darwin/Framework/CHIP/MTRDevice.mm @@ -1459,6 +1459,17 @@ - (NSDictionary *)_dataValueWithoutDataVersion:(NSDictionary *)attributeValue } } +- (NSArray *> *)getAllAttributesReport +{ +#define MTRDeviceErrorStr "MTRDevice getAllAttributesReport must be handled by subclasses that support it" + MTR_LOG_ERROR(MTRDeviceErrorStr); +#ifdef DEBUG + NSAssert(NO, @MTRDeviceErrorStr); +#endif // DEBUG +#undef MTRDeviceErrorStr + return nil; +} + #ifdef DEBUG - (NSUInteger)unitTestAttributeCount { diff --git a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm index 70824dd9bcd7d1..52acb7c0b4c09e 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm +++ b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm @@ -3092,6 +3092,12 @@ - (void)_performScheduledExpirationCheck - (NSDictionary *)_attributeValueDictionaryForAttributePath:(MTRAttributePath *)attributePath { std::lock_guard lock(_lock); + return [self _lockedAttributeValueDictionaryForAttributePath:attributePath]; +} + +- (NSDictionary *)_lockedAttributeValueDictionaryForAttributePath:(MTRAttributePath *)attributePath +{ + os_unfair_lock_assert_owner(&self->_lock); // First check expected value cache NSArray * expectedValue = _expectedValueCache[attributePath]; @@ -3478,6 +3484,27 @@ - (NSArray *)_getAttributesToReportWithReportedValues:(NSArray *> *)getAllAttributesReport +{ + std::lock_guard lock(_lock); + + NSMutableArray * attributeReport = [NSMutableArray array]; + for (MTRClusterPath * clusterPath in [self _knownClusters]) { + MTRDeviceClusterData * clusterData = [self _clusterDataForPath:clusterPath]; + + for (NSNumber * attributeID in clusterData.attributes) { + auto * attributePath = [MTRAttributePath attributePathWithEndpointID:clusterPath.endpoint + clusterID:clusterPath.cluster + attributeID:attributeID]; + + // Using _lockedAttributeValueDictionaryForAttributePath because it takes into consideration expected values too + [attributeReport addObject:[self _lockedAttributeValueDictionaryForAttributePath:attributePath]]; + } + } + + return attributeReport; +} + #ifdef DEBUG - (NSUInteger)unitTestAttributeCount { diff --git a/src/darwin/Framework/CHIP/MTRDevice_Internal.h b/src/darwin/Framework/CHIP/MTRDevice_Internal.h index c3b6b60fa6314e..9627d4fccf56b8 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDevice_Internal.h @@ -202,6 +202,9 @@ MTR_DIRECT_MEMBERS - (void)_callFirstDelegateSynchronouslyWithBlock:(void (^)(id delegate))block; #endif +// Used to generate attribute report that contains all known attributes, taking into consideration expected values +- (NSArray *> *)getAllAttributesReport; + @end #pragma mark - MTRDevice internal state monitoring diff --git a/src/darwin/Framework/CHIPTests/MTRDeviceTests.m b/src/darwin/Framework/CHIPTests/MTRDeviceTests.m index da059fc505de8c..87b7371ffc5fd8 100644 --- a/src/darwin/Framework/CHIPTests/MTRDeviceTests.m +++ b/src/darwin/Framework/CHIPTests/MTRDeviceTests.m @@ -4022,6 +4022,7 @@ - (void)test037_MTRDeviceMultipleDelegatesGetReports // For unit test no real data is needed, but timestamp is required }; } + - (void)test038_MTRDeviceMultipleDelegatesInterestedPaths { dispatch_queue_t queue = dispatch_get_main_queue(); @@ -4274,6 +4275,61 @@ - (void)test038_MTRDeviceMultipleDelegatesInterestedPaths XCTAssertEqual(eventsReceived4, 36); } +- (void)test039_GetAllAttributesReport +{ + dispatch_queue_t queue = dispatch_get_main_queue(); + + // First start with clean slate by removing the MTRDevice and clearing the persisted cache + __auto_type * device = [MTRDevice deviceWithNodeID:@(kDeviceId) controller:sController]; + [sController removeDevice:device]; + [sController.controllerDataStore clearAllStoredClusterData]; + NSDictionary * storedClusterDataAfterClear = [sController.controllerDataStore getStoredClusterDataForNodeID:@(kDeviceId)]; + XCTAssertEqual(storedClusterDataAfterClear.count, 0); + + // Now recreate device and get subscription primed + device = [MTRDevice deviceWithNodeID:@(kDeviceId) controller:sController]; + XCTestExpectation * gotReportEnd = [self expectationWithDescription:@"Report end for delegate"]; + + __auto_type * delegate = [[MTRDeviceTestDelegateWithSubscriptionSetupOverride alloc] init]; + delegate.skipSetupSubscription = YES; + __weak __auto_type weakdelegate = delegate; + __block NSUInteger attributesReceived = 0; + delegate.onAttributeDataReceived = ^(NSArray *> * data) { + attributesReceived += data.count; + }; + delegate.onReportEnd = ^{ + [gotReportEnd fulfill]; + __strong __auto_type strongDelegate = weakdelegate; + strongDelegate.onReportEnd = nil; + }; + + [device addDelegate:delegate queue:queue]; + + // Now inject attributes and check that each delegate gets the right set of attributes + NSMutableArray * attributeReport = [NSMutableArray array]; + // Construct 36 attributes with endpoints 1~4, clusters 11 ~ 33, and attributes 111~333 + for (int i = 1; i <= 4; i++) { + for (int j = 1; j <= 3; j++) { + for (int k = 1; k <= 3; k++) { + int endpointID = i; + int clusterID = i * 10 + j; + int attributeID = i * 100 + j * 10 + k; + int value = attributeID + 10000; + [attributeReport addObject:[self _testAttributeResponseValueWithEndpointID:@(endpointID) clusterID:@(clusterID) attributeID:@(attributeID) value:value]]; + } + } + } + [device unitTestInjectAttributeReport:attributeReport fromSubscription:YES]; + + [self waitForExpectations:@[ gotReportEnd ] timeout:60]; + + XCTAssertEqual(attributesReceived, 36); + + NSArray * allAttributesReport = [device getAllAttributesReport]; + + XCTAssertEqual(allAttributesReport.count, 36); +} + @end @interface MTRDeviceEncoderTests : XCTestCase From ab9c9b3ab7a401fa547e3f5326c5490fc61b86a6 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Sat, 7 Sep 2024 12:42:01 -0400 Subject: [PATCH 29/42] Ensure we abort MTRDownload instances when a controller shuts down. (#35467) --- .../CHIP/MTRDeviceControllerFactory.mm | 4 +++ .../CHIP/MTRDiagnosticLogsDownloader.h | 5 ++++ .../CHIP/MTRDiagnosticLogsDownloader.mm | 25 +++++++++++++++++++ 3 files changed, 34 insertions(+) diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm index 6ef4064a19f2f1..9cd3b62340d20a 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm @@ -961,6 +961,10 @@ - (void)controllerShuttingDown:(MTRDeviceController *)controller _otaProviderDelegateBridge->ControllerShuttingDown(controller); } + if (_diagnosticLogsDownloader != nil) { + [_diagnosticLogsDownloader abortDownloadsForController:controller]; + } + [controller shutDownCppController]; self->_controllerBeingShutDown = nil; diff --git a/src/darwin/Framework/CHIP/MTRDiagnosticLogsDownloader.h b/src/darwin/Framework/CHIP/MTRDiagnosticLogsDownloader.h index f10fea520fb4fb..da7a780c1237f0 100644 --- a/src/darwin/Framework/CHIP/MTRDiagnosticLogsDownloader.h +++ b/src/darwin/Framework/CHIP/MTRDiagnosticLogsDownloader.h @@ -31,12 +31,17 @@ NS_ASSUME_NONNULL_BEGIN @interface MTRDiagnosticLogsDownloader : NSObject - (chip::bdx::BDXTransferServerDelegate *)getBridge; +// Must be called on Matter queue - (void)downloadLogFromNodeWithID:(NSNumber *)nodeID controller:(MTRDeviceController *)controller type:(MTRDiagnosticLogType)type timeout:(NSTimeInterval)timeout queue:(dispatch_queue_t)queue completion:(void (^)(NSURL * _Nullable url, NSError * _Nullable error))completion; + +// Must be called on Matter queue +- (void)abortDownloadsForController:(MTRDeviceController *)controller; + @end NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/MTRDiagnosticLogsDownloader.mm b/src/darwin/Framework/CHIP/MTRDiagnosticLogsDownloader.mm index ac388ebdb72074..69dfb86d1da40f 100644 --- a/src/darwin/Framework/CHIP/MTRDiagnosticLogsDownloader.mm +++ b/src/darwin/Framework/CHIP/MTRDiagnosticLogsDownloader.mm @@ -85,6 +85,9 @@ - (MTRDownload * _Nullable)add:(MTRDiagnosticLogType)type queue:(dispatch_queue_t)queue completion:(void (^)(NSURL * _Nullable url, NSError * _Nullable error))completion done:(void (^)(MTRDownload * finishedDownload))done; + +- (void)abortDownloadsForController:(MTRDeviceController *)controller; + @end @interface MTRDiagnosticLogsDownloader () @@ -351,6 +354,21 @@ - (MTRDownload * _Nullable)add:(MTRDiagnosticLogType)type return download; } +- (void)abortDownloadsForController:(MTRDeviceController *)controller +{ + assertChipStackLockedByCurrentThread(); + + auto fabricIndex = @(controller.fabricIndex); + for (MTRDownload * download in [_downloads copy]) { + if (![download.fabricIndex isEqual:fabricIndex]) { + continue; + } + + [download failure:[MTRError errorForCHIPErrorCode:CHIP_ERROR_CANCELLED]]; + [self remove:download]; + } +} + - (void)remove:(MTRDownload *)download { assertChipStackLockedByCurrentThread(); @@ -444,6 +462,13 @@ - (void)downloadLogFromNodeWithID:(NSNumber *)nodeID } } +- (void)abortDownloadsForController:(MTRDeviceController *)controller; +{ + assertChipStackLockedByCurrentThread(); + + [_downloads abortDownloadsForController:controller]; +} + - (void)handleBDXTransferSessionBeginForFileDesignator:(NSString *)fileDesignator fabricIndex:(NSNumber *)fabricIndex nodeID:(NSNumber *)nodeID From 3cb4b51772a889fbb8bb9dbae595f4e819ba23d9 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Sat, 7 Sep 2024 13:05:05 -0400 Subject: [PATCH 30/42] Implement MTRDevice handling in controller suspend/resume. (#35464) Also blocks acquisition of CASE sessions on a suspended controller, which should ensure that new requests for MTRDevices and MTRBaseDevices associated with the controller do not hit the network. --- src/darwin/Framework/CHIP/MTRDevice.mm | 15 +- .../Framework/CHIP/MTRDeviceController.mm | 48 ++++- .../CHIP/MTRDeviceControllerParameters.h | 5 + .../CHIP/MTRDeviceControllerStartupParams.mm | 3 + .../CHIP/MTRDeviceController_Concrete.mm | 20 +- .../CHIP/MTRDeviceController_Internal.h | 2 +- .../Framework/CHIP/MTRDeviceController_XPC.mm | 1 - .../Framework/CHIP/MTRDevice_Concrete.mm | 50 ++++- .../Framework/CHIP/MTRDevice_Internal.h | 7 + .../CHIPTests/MTRPerControllerStorageTests.m | 197 +++++++++++++++--- 10 files changed, 304 insertions(+), 44 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDevice.mm b/src/darwin/Framework/CHIP/MTRDevice.mm index ceca6d27830f8c..a668e02bbfa1ff 100644 --- a/src/darwin/Framework/CHIP/MTRDevice.mm +++ b/src/darwin/Framework/CHIP/MTRDevice.mm @@ -648,8 +648,9 @@ - (void)_addDelegate:(id)delegate queue:(dispatch_queue_t)que - (void)_delegateAdded { - // Nothing to do; this is a hook for subclasses. If that ever changes for - // some reason, subclasses need to start calling this hook on their super. + os_unfair_lock_assert_owner(&self->_lock); + + // Nothing to do for now. At the moment this is a hook for subclasses. } - (void)removeDelegate:(id)delegate @@ -1743,6 +1744,16 @@ - (NSNumber * _Nullable)_networkFeatures return result; } +- (void)controllerSuspended +{ + // Nothing to do for now. +} + +- (void)controllerResumed +{ + // Nothing to do for now. +} + @end /* BEGIN DRAGONS: Note methods here cannot be renamed, and are used by private callers, do not rename, remove or modify behavior here */ diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm index b743b9fb6fabad..a55946c237c364 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm @@ -120,7 +120,6 @@ @implementation MTRDeviceController { MTROperationalCredentialsDelegate * _operationalCredentialsDelegate; MTRDeviceAttestationDelegateBridge * _deviceAttestationDelegateBridge; MTRDeviceControllerFactory * _factory; - NSMapTable * _nodeIDToDeviceMap; os_unfair_lock _underlyingDeviceMapLock; MTRCommissionableBrowser * _commissionableBrowser; MTRAttestationTrustStoreBridge * _attestationTrustStoreBridge; @@ -135,6 +134,7 @@ @implementation MTRDeviceController { MTRP256KeypairBridge _operationalKeypairBridge; BOOL _suspended; + os_unfair_lock _suspensionLock; // Counters to track assertion status and access controlled by the _assertionLock NSUInteger _keepRunningAssertionCounter; @@ -160,6 +160,12 @@ - (instancetype)initForSubclasses:(BOOL)startSuspended _assertionLock = OS_UNFAIR_LOCK_INIT; _suspended = startSuspended; + // All synchronous suspend/resume activity has to be protected by + // _suspensionLock, so that parts of suspend/resume can't interleave with + // each other. + _suspensionLock = OS_UNFAIR_LOCK_INIT; + + _nodeIDToDeviceMap = [NSMapTable strongToWeakObjectsMapTable]; return self; } @@ -204,6 +210,7 @@ - (instancetype)initWithFactory:(MTRDeviceControllerFactory *)factory _assertionLock = OS_UNFAIR_LOCK_INIT; _suspended = startSuspended; + _suspensionLock = OS_UNFAIR_LOCK_INIT; if (storageDelegate != nil) { if (storageDelegateQueue == nil) { @@ -350,23 +357,46 @@ - (BOOL)isSuspended - (void)suspend { + MTR_LOG("%@ suspending", self); + + std::lock_guard lock(_suspensionLock); + _suspended = YES; - // TODO: In the concrete class (which is unused so far!), iterate our - // MTRDevices, tell them to tear down subscriptions. Possibly close all - // CASE sessions for our identity. Possibly try to see whether we can - // change our fabric entry to not advertise and restart advertising. + NSEnumerator * devices; + { + std::lock_guard lock(*self.deviceMapLock); + devices = [self.nodeIDToDeviceMap objectEnumerator]; + } + + for (MTRDevice * device in devices) { + [device controllerSuspended]; + } - // TODO: What should happen with active commissioning sessions? Presumably - // close them? + // TODO: In the concrete class, consider what should happen with: + // + // * Active commissioning sessions (presumably close them?) + // * CASE sessions in general. + // * Possibly try to see whether we can change our fabric entry to not advertise and restart advertising. } - (void)resume { + MTR_LOG("%@ resuming", self); + + std::lock_guard lock(_suspensionLock); + _suspended = NO; - // TODO: In the concrete class (which is unused so far!), iterate our - // MTRDevices, tell them to restart subscriptions. + NSEnumerator * devices; + { + std::lock_guard lock(*self.deviceMapLock); + devices = [self.nodeIDToDeviceMap objectEnumerator]; + } + + for (MTRDevice * device in devices) { + [device controllerResumed]; + } } - (BOOL)matchesPendingShutdownControllerWithOperationalCertificate:(nullable MTRCertificateDERBytes)operationalCertificate andRootCertificate:(nullable MTRCertificateDERBytes)rootCertificate diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerParameters.h b/src/darwin/Framework/CHIP/MTRDeviceControllerParameters.h index 68d725f796a0dd..171c91c889a493 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerParameters.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerParameters.h @@ -150,6 +150,11 @@ MTR_AVAILABLE(ios(17.6), macos(14.6), watchos(10.6), tvos(17.6)) intermediateCertificate:(MTRCertificateDERBytes _Nullable)intermediateCertificate rootCertificate:(MTRCertificateDERBytes)rootCertificate; +/** + * The root certificate we were initialized with. + */ +@property (nonatomic, copy, readonly) MTRCertificateDERBytes rootCertificate MTR_NEWLY_AVAILABLE; + @end MTR_NEWLY_AVAILABLE diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm index fa2791a908cda7..6a64b6ee84ac8d 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm @@ -338,6 +338,9 @@ + (nullable NSData *)publicKeyFromCertificate:(MTRCertificateDERBytes)certificat @end @implementation MTRDeviceControllerExternalCertificateParameters + +@dynamic rootCertificate; + - (instancetype)initWithStorageDelegate:(id)storageDelegate storageDelegateQueue:(dispatch_queue_t)storageDelegateQueue uniqueIdentifier:(NSUUID *)uniqueIdentifier diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm index fba26d9ba79e03..fbfc072826ad8a 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm @@ -288,8 +288,6 @@ - (instancetype)initWithFactory:(MTRDeviceControllerFactory *)factory _otaProviderDelegateQueue = otaProviderDelegateQueue; _chipWorkQueue = queue; _factory = factory; - // TODO: Shouldn't nodeIDToDeviceMap just be set up by initForSubclasses? - self.nodeIDToDeviceMap = [NSMapTable strongToWeakObjectsMapTable]; _serverEndpoints = [[NSMutableArray alloc] init]; _commissionableBrowser = nil; @@ -1416,6 +1414,15 @@ - (BOOL)checkIsRunning:(NSError * __autoreleasing *)error - (void)getSessionForNode:(chip::NodeId)nodeID completion:(MTRInternalDeviceConnectionCallback)completion { + // TODO: Figure out whether the synchronization here makes sense. What + // happens if this call happens mid-suspend or mid-resume? + if (self.suspended) { + MTR_LOG_ERROR("%@ suspended: can't get session for node %016llX-%016llx (%llu)", self, self.compressedFabricID.unsignedLongLongValue, nodeID, nodeID); + // TODO: Can we do a better error here? + completion(nullptr, chip::NullOptional, [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + // Get the corresponding MTRDevice object to determine if the case/subscription pool is to be used MTRDevice * device = [self deviceForNodeID:@(nodeID)]; @@ -1440,6 +1447,15 @@ - (void)getSessionForNode:(chip::NodeId)nodeID completion:(MTRInternalDeviceConn - (void)directlyGetSessionForNode:(chip::NodeId)nodeID completion:(MTRInternalDeviceConnectionCallback)completion { + // TODO: Figure out whether the synchronization here makes sense. What + // happens if this call happens mid-suspend or mid-resume? + if (self.suspended) { + MTR_LOG_ERROR("%@ suspended: can't get session for node %016llX-%016llx (%llu)", self, self.compressedFabricID.unsignedLongLongValue, nodeID, nodeID); + // TODO: Can we do a better error here? + completion(nullptr, chip::NullOptional, [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + [self asyncGetCommissionerOnMatterQueue:^(chip::Controller::DeviceCommissioner * commissioner) { auto connectionBridge = new MTRDeviceConnectionBridge(completion); diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h b/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h index 5d5acf8063d4c2..643a23225774fd 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h @@ -66,7 +66,7 @@ NS_ASSUME_NONNULL_BEGIN @interface MTRDeviceController () -@property (nonatomic, readwrite, nullable) NSMapTable * nodeIDToDeviceMap; +@property (nonatomic, readonly) NSMapTable * nodeIDToDeviceMap; @property (readonly, assign) os_unfair_lock_t deviceMapLock; // queue used to serialize all work performed by the MTRDeviceController diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm b/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm index 1bf0888ab3b2b4..cb09fbd7ff737b 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm @@ -113,7 +113,6 @@ - (nullable instancetype)initWithParameters:(MTRDeviceControllerAbstractParamete self.xpcConnection = connectionBlock(); self.uniqueIdentifier = UUID; self.chipWorkQueue = dispatch_queue_create("MTRDeviceController_XPC_queue", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - self.nodeIDToDeviceMap = [NSMapTable strongToWeakObjectsMapTable]; MTR_LOG("Set up XPC Connection: %@", self.xpcConnection); if (self.xpcConnection) { diff --git a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm index 52acb7c0b4c09e..b38f3815f731c3 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm +++ b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm @@ -724,14 +724,23 @@ - (BOOL)_subscriptionsAllowed { os_unfair_lock_assert_owner(&self->_lock); - // We should not allow a subscription for device controllers over XPC. - return ![_deviceController isKindOfClass:MTRDeviceControllerOverXPC.class]; + // We should not allow a subscription for suspended controllers or device controllers over XPC. + return _deviceController.suspended == NO && ![_deviceController isKindOfClass:MTRDeviceControllerOverXPC.class]; } - (void)_delegateAdded { os_unfair_lock_assert_owner(&self->_lock); + [super _delegateAdded]; + + [self _ensureSubscriptionForExistingDelegates:@"delegate is set"]; +} + +- (void)_ensureSubscriptionForExistingDelegates:(NSString *)reason +{ + os_unfair_lock_assert_owner(&self->_lock); + __block BOOL shouldSetUpSubscription = [self _subscriptionsAllowed]; // For unit testing only. If this ever changes to not being for unit testing purposes, @@ -754,10 +763,10 @@ - (void)_delegateAdded MTR_LOG(" => %@ - device is a thread device, scheduling in pool", self); [self _scheduleSubscriptionPoolWork:^{ std::lock_guard lock(self->_lock); - [self _setupSubscriptionWithReason:@"delegate is set and scheduled subscription is happening"]; + [self _setupSubscriptionWithReason:[NSString stringWithFormat:@"%@ and scheduled subscription is happening", reason]]; } inNanoseconds:0 description:@"MTRDevice setDelegate first subscription"]; } else { - [self _setupSubscriptionWithReason:@"delegate is set and subscription is needed"]; + [self _setupSubscriptionWithReason:[NSString stringWithFormat:@"%@ and subscription is needed", reason]]; } } } @@ -1243,6 +1252,11 @@ - (void)_doHandleSubscriptionReset:(NSNumber * _Nullable)retryDelay { os_unfair_lock_assert_owner(&_lock); + if (_deviceController.suspended) { + MTR_LOG("%@ ignoring expected subscription reset on controller suspend", self); + return; + } + // If we are here, then either we failed to establish initial CASE, or we // failed to send the initial SubscribeRequest message, or our ReadClient // has given up completely. Those all count as "we have tried and failed to @@ -4002,6 +4016,34 @@ - (NSNumber * _Nullable)_networkFeatures return result; } +- (void)controllerSuspended +{ + [super controllerSuspended]; + + std::lock_guard lock(self->_lock); + [self _resetSubscriptionWithReasonString:@"Controller suspended"]; + + // Ensure that any pre-existing resubscribe attempts we control don't try to + // do anything. + _reattemptingSubscription = NO; +} + +- (void)controllerResumed +{ + [super controllerResumed]; + + std::lock_guard lock(self->_lock); + + if (![self _delegateExists]) { + MTR_LOG("%@ ignoring controller resume: no delegates", self); + return; + } + + // Use _ensureSubscriptionForExistingDelegates so that the subscriptions + // will go through the pool as needed, not necessarily happen immediately. + [self _ensureSubscriptionForExistingDelegates:@"Controller resumed"]; +} + @end /* BEGIN DRAGONS: Note methods here cannot be renamed, and are used by private callers, do not rename, remove or modify behavior here */ diff --git a/src/darwin/Framework/CHIP/MTRDevice_Internal.h b/src/darwin/Framework/CHIP/MTRDevice_Internal.h index 9627d4fccf56b8..9905da7ff711a6 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDevice_Internal.h @@ -196,6 +196,9 @@ MTR_DIRECT_MEMBERS - (BOOL)_delegateExists; +// Must be called by subclasses or MTRDevice implementation only. +- (void)_delegateAdded; + #ifdef DEBUG // Only used for unit test purposes - normal delegate should not expect or handle being called back synchronously // Returns YES if a delegate is called @@ -205,6 +208,10 @@ MTR_DIRECT_MEMBERS // Used to generate attribute report that contains all known attributes, taking into consideration expected values - (NSArray *> *)getAllAttributesReport; +// Hooks for controller suspend/resume. +- (void)controllerSuspended; +- (void)controllerResumed; + @end #pragma mark - MTRDevice internal state monitoring diff --git a/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m b/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m index 35df3471e43338..ccce34792f9db8 100644 --- a/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m +++ b/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m @@ -262,11 +262,8 @@ - (nullable MTRDeviceController *)startControllerWithRootKeys:(MTRTestKeys *)roo nodeID:(NSNumber *)nodeID storage:(MTRTestPerControllerStorage *)storage caseAuthenticatedTags:(NSSet * _Nullable)caseAuthenticatedTags + paramsModifier:(void (^_Nullable)(MTRDeviceControllerExternalCertificateParameters *))paramsModifier error:(NSError * __autoreleasing *)error - certificateIssuer: - (MTRPerControllerStorageTestsCertificateIssuer * __autoreleasing *)certificateIssuer - concurrentSubscriptionPoolSize:(NSUInteger)concurrentSubscriptionPoolSize - storageBehaviorConfiguration:(MTRDeviceStorageBehaviorConfiguration * _Nullable)storageBehaviorConfiguration { XCTAssertTrue(error != NULL); @@ -295,33 +292,60 @@ - (nullable MTRDeviceController *)startControllerWithRootKeys:(MTRTestKeys *)roo intermediateCertificate:nil rootCertificate:root]; XCTAssertNotNil(params); - // TODO: This is only used by testControllerServer. If that moves - // elsewhere, take this back out again. - params.shouldAdvertiseOperational = YES; - - __auto_type * ourCertificateIssuer = [[MTRPerControllerStorageTestsCertificateIssuer alloc] initWithRootCertificate:root - intermediateCertificate:nil - signingKey:rootKeys - fabricID:fabricID]; - XCTAssertNotNil(ourCertificateIssuer); - - if (certificateIssuer) { - *certificateIssuer = ourCertificateIssuer; - } - - [params setOperationalCertificateIssuer:ourCertificateIssuer queue:dispatch_get_main_queue()]; - if (concurrentSubscriptionPoolSize > 0) { - params.concurrentSubscriptionEstablishmentsAllowedOnThread = concurrentSubscriptionPoolSize; - } - - if (storageBehaviorConfiguration) { - params.storageBehaviorConfiguration = storageBehaviorConfiguration; + if (paramsModifier) { + paramsModifier(params); } return [[MTRDeviceController alloc] initWithParameters:params error:error]; } +- (nullable MTRDeviceController *)startControllerWithRootKeys:(MTRTestKeys *)rootKeys + operationalKeys:(MTRTestKeys *)operationalKeys + fabricID:(NSNumber *)fabricID + nodeID:(NSNumber *)nodeID + storage:(MTRTestPerControllerStorage *)storage + caseAuthenticatedTags:(NSSet * _Nullable)caseAuthenticatedTags + error:(NSError * __autoreleasing *)error + certificateIssuer: + (MTRPerControllerStorageTestsCertificateIssuer * __autoreleasing *)certificateIssuer + concurrentSubscriptionPoolSize:(NSUInteger)concurrentSubscriptionPoolSize + storageBehaviorConfiguration:(MTRDeviceStorageBehaviorConfiguration * _Nullable)storageBehaviorConfiguration +{ + return [self startControllerWithRootKeys:rootKeys + operationalKeys:operationalKeys + fabricID:fabricID + nodeID:nodeID + storage:storage + caseAuthenticatedTags:caseAuthenticatedTags + paramsModifier:^(MTRDeviceControllerExternalCertificateParameters * params) { + // TODO: This is only used by testControllerServer. If that moves + // elsewhere, take this back out again. + params.shouldAdvertiseOperational = YES; + + __auto_type * ourCertificateIssuer = [[MTRPerControllerStorageTestsCertificateIssuer alloc] initWithRootCertificate:params.rootCertificate + intermediateCertificate:nil + signingKey:rootKeys + fabricID:fabricID]; + XCTAssertNotNil(ourCertificateIssuer); + + if (certificateIssuer) { + *certificateIssuer = ourCertificateIssuer; + } + + [params setOperationalCertificateIssuer:ourCertificateIssuer queue:dispatch_get_main_queue()]; + + if (concurrentSubscriptionPoolSize > 0) { + params.concurrentSubscriptionEstablishmentsAllowedOnThread = concurrentSubscriptionPoolSize; + } + + if (storageBehaviorConfiguration) { + params.storageBehaviorConfiguration = storageBehaviorConfiguration; + } + } + error:error]; +} + - (nullable MTRDeviceController *)startControllerWithRootKeys:(MTRTestKeys *)rootKeys operationalKeys:(MTRTestKeys *)operationalKeys fabricID:(NSNumber *)fabricID @@ -462,6 +486,7 @@ - (void)test001_BasicControllerStartup XCTAssertNil(error); XCTAssertNotNil(controller); XCTAssertTrue([controller isRunning]); + XCTAssertFalse(controller.suspended); XCTAssertEqualObjects(controller.controllerNodeID, nodeID); @@ -1611,6 +1636,128 @@ - (void)test011_TestDataStoreMTRDeviceWithStorageBehaviorOptimizationDisabled [self doDataStoreMTRDeviceTestWithStorageDelegate:[[MTRTestPerControllerStorage alloc] initWithControllerID:[NSUUID UUID]] disableStorageBehaviorOptimization:YES]; } +// TODO: Factor out startControllerWithRootKeys into a test helper, move these +// suspension tests to a different file. +- (void)test012_startSuspended +{ + NSError * error; + __auto_type * storageDelegate = [[MTRTestPerControllerStorage alloc] initWithControllerID:[NSUUID UUID]]; + __auto_type * controller = [self startControllerWithRootKeys:[[MTRTestKeys alloc] init] + operationalKeys:[[MTRTestKeys alloc] init] + fabricID:@555 + nodeID:@888 + storage:storageDelegate + caseAuthenticatedTags:nil + paramsModifier:^(MTRDeviceControllerExternalCertificateParameters * params) { + params.startSuspended = YES; + } + error:&error]; + + XCTAssertNil(error); + XCTAssertNotNil(controller); + XCTAssertTrue(controller.running); + XCTAssertTrue(controller.suspended); + [controller shutdown]; +} + +- (void)test013_suspendDevices +{ + NSNumber * deviceID = @(17); + __auto_type * device = [self getMTRDevice:deviceID]; + __auto_type * controller = device.deviceController; + + XCTAssertFalse(controller.suspended); + + __auto_type queue = dispatch_get_main_queue(); + __auto_type * delegate = [[MTRDeviceTestDelegate alloc] init]; + + XCTestExpectation * initialSubscriptionExpectation = [self expectationWithDescription:@"Subscription has been set up"]; + XCTestExpectation * initialReachableExpectation = [self expectationWithDescription:@"Device initially became reachable"]; + XCTestExpectation * initialUnreachableExpectation = [self expectationWithDescription:@"Device initially became unreachable"]; + initialUnreachableExpectation.inverted = YES; + + delegate.onReachable = ^{ + [initialReachableExpectation fulfill]; + }; + + delegate.onNotReachable = ^{ + // We do not expect to land here. + [initialUnreachableExpectation fulfill]; + }; + + delegate.onReportEnd = ^{ + [initialSubscriptionExpectation fulfill]; + }; + + [device setDelegate:delegate queue:queue]; + [self waitForExpectations:@[ initialReachableExpectation, initialSubscriptionExpectation ] timeout:60]; + // Separately wait for the unreachable bit, so we don't end up waiting 60 + // seconds for it. + [self waitForExpectations:@[ initialUnreachableExpectation ] timeout:0]; + + // Test that sending a command works. Clear the delegate's onReportEnd + // first, so reports from the command don't trigger it. + delegate.onReportEnd = nil; + XCTestExpectation * toggle1Expectation = [self expectationWithDescription:@"toggle 1"]; + __auto_type * cluster = [[MTRClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:queue]; + [cluster toggleWithExpectedValues:nil expectedValueInterval:nil completion:^(NSError * _Nullable error) { + XCTAssertNil(error); + [toggle1Expectation fulfill]; + }]; + + [self waitForExpectations:@[ toggle1Expectation ] timeout:kTimeoutInSeconds]; + + XCTestExpectation * becameUnreachableExpectation = [self expectationWithDescription:@"Device became unreachable"]; + delegate.onNotReachable = ^{ + [becameUnreachableExpectation fulfill]; + }; + + [controller suspend]; + XCTAssertTrue(controller.suspended); + + // Test that sending a command no longer works. + XCTestExpectation * toggle2Expectation = [self expectationWithDescription:@"toggle 2"]; + [cluster toggleWithExpectedValues:nil expectedValueInterval:nil completion:^(NSError * _Nullable error) { + XCTAssertNotNil(error); + [toggle2Expectation fulfill]; + }]; + + [self waitForExpectations:@[ becameUnreachableExpectation, toggle2Expectation ] timeout:kTimeoutInSeconds]; + + XCTestExpectation * newSubscriptionExpectation = [self expectationWithDescription:@"Subscription has been set up again"]; + XCTestExpectation * newReachableExpectation = [self expectationWithDescription:@"Device became reachable again"]; + delegate.onReachable = ^{ + [newReachableExpectation fulfill]; + }; + + delegate.onReportEnd = ^{ + [newSubscriptionExpectation fulfill]; + }; + + [controller resume]; + XCTAssertFalse(controller.suspended); + + [self waitForExpectations:@[ newSubscriptionExpectation, newReachableExpectation ] timeout:kTimeoutInSeconds]; + + // Test that sending a command works again. Clear the delegate's onReportEnd + // first, so reports from the command don't trigger it. + delegate.onReportEnd = nil; + XCTestExpectation * toggle3Expectation = [self expectationWithDescription:@"toggle 3"]; + [cluster toggleWithExpectedValues:nil expectedValueInterval:nil completion:^(NSError * _Nullable error) { + XCTAssertNil(error); + [toggle3Expectation fulfill]; + }]; + + [self waitForExpectations:@[ toggle3Expectation ] timeout:kTimeoutInSeconds]; + + [controller removeDevice:device]; + // Reset our commissionee. + __auto_type * baseDevice = [MTRBaseDevice deviceWithNodeID:deviceID controller:controller]; + ResetCommissionee(baseDevice, queue, self, kTimeoutInSeconds); + + [controller shutdown]; +} + // TODO: This might want to go in a separate test file, with some shared setup // across multiple tests, maybe. Would need to factor out // startControllerWithRootKeys into a test helper. From f633e4304b795ab2b7f60950bd2139bf63f26301 Mon Sep 17 00:00:00 2001 From: Jeff Tung <100387939+jtung-apple@users.noreply.github.com> Date: Sat, 7 Sep 2024 11:54:57 -0700 Subject: [PATCH 31/42] [Darwin] Fix MTRDevice getAllAttributesReport return value (#35471) * [Darwin] Fix MTRDevice getAllAttributesReport return value * Restyled by clang-format --------- Co-authored-by: Restyled.io --- .../Framework/CHIP/MTRDevice_Concrete.mm | 8 +++++-- .../Framework/CHIPTests/MTRDeviceTests.m | 23 ++++++++++++++++--- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm index b38f3815f731c3..706642accf65b6 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm +++ b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm @@ -3511,8 +3511,12 @@ - (NSArray *)_getAttributesToReportWithReportedValues:(NSArray * newResponseValueDict in allAttributesReport) { + MTRAttributePath * newPath = newResponseValueDict[MTRAttributePathKey]; + NSDictionary * newDataValueDict = newResponseValueDict[MTRDataKey]; + NSNumber * newValue = newDataValueDict[MTRValueKey]; + XCTAssertNotNil(newValue); + + for (NSDictionary * originalResponseValueDict in attributeReport) { + MTRAttributePath * originalPath = originalResponseValueDict[MTRAttributePathKey]; + // Find same attribute path and compare value + if ([newPath isEqual:originalPath]) { + NSDictionary * originalDataValueDict = originalResponseValueDict[MTRDataKey]; + NSNumber * originalValue = originalDataValueDict[MTRValueKey]; + XCTAssertNotNil(originalValue); + XCTAssertEqualObjects(newValue, originalValue); + continue; + } + } + } } @end From 45b8988cf7c92831cd471c045d039455b557fb4d Mon Sep 17 00:00:00 2001 From: Justin Wood Date: Sat, 7 Sep 2024 12:39:53 -0700 Subject: [PATCH 32/42] Updating XPC interfaces to pass along context, and fixing some other issues (#35458) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Revert "Revert "Updating XPC interfaces to pass along context, and fixing som…" This reverts commit 96e687bfe3e570330556af9c542e548863b7a7c3. * Update src/darwin/Framework/CHIP/MTRDevice_Concrete.mm * Update src/darwin/Framework/CHIP/MTRDefines_Internal.h * Update src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm * Restyle Updating XPC interfaces to pass along context, and fixing some other issues (#35459) Co-authored-by: Restyled.io * cleaning this up * Restyle Updating XPC interfaces to pass along context, and fixing some other issues (#35470) * Restyled by whitespace * Restyled by clang-format --------- Co-authored-by: Restyled.io * Removing these now they're moved to super --------- Co-authored-by: restyled-io[bot] <32688539+restyled-io[bot]@users.noreply.github.com> Co-authored-by: Restyled.io --- .../Framework/CHIP/MTRDefines_Internal.h | 39 ++++ .../Framework/CHIP/MTRDeviceController+XPC.mm | 8 +- .../Framework/CHIP/MTRDeviceController_XPC.h | 2 +- .../Framework/CHIP/MTRDeviceController_XPC.mm | 183 ++++++++++++++---- .../Framework/CHIP/MTRDevice_Concrete.mm | 61 +++--- .../Framework/CHIP/MTRDevice_Internal.h | 6 +- src/darwin/Framework/CHIP/MTRDevice_XPC.mm | 51 +++-- .../CHIP/XPC Protocol/MTRXPCClientProtocol.h | 3 - .../CHIP/XPC Protocol/MTRXPCServerProtocol.h | 3 - 9 files changed, 260 insertions(+), 96 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDefines_Internal.h b/src/darwin/Framework/CHIP/MTRDefines_Internal.h index 7894f31835a142..e22f00dd4e6a0b 100644 --- a/src/darwin/Framework/CHIP/MTRDefines_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDefines_Internal.h @@ -111,3 +111,42 @@ typedef struct {} variable_hidden_by_mtr_hide; \ return outValue; \ } + +#ifndef MTR_OPTIONAL_ATTRIBUTE +#if __has_feature(objc_arc) +#define MTR_OPTIONAL_ATTRIBUTE(ATTRIBUTE, VALUE, DICTIONARY) \ + { \ + id valueToAdd = VALUE; \ + if (valueToAdd != nil) { \ + CFDictionarySetValue((CFMutableDictionaryRef) DICTIONARY, (CFStringRef) (__bridge const void *) ATTRIBUTE, (const void *) valueToAdd); \ + } \ + } +#else +#define MTR_OPTIONAL_ATTRIBUTE(ATTRIBUTE, VALUE, DICTIONARY) \ + { \ + id valueToAdd = VALUE; \ + if (valueToAdd != nil) { \ + CFDictionarySetValue((CFMutableDictionaryRef) DICTIONARY, (CFStringRef) (const void *) ATTRIBUTE, (const void *) valueToAdd); \ + } \ + } +#endif +#endif + +#ifndef MTR_REMOVE_ATTRIBUTE +#define MTR_REMOVE_ATTRIBUTE(ATTRIBUTE, DICTIONARY) \ + if (ATTRIBUTE != nil && DICTIONARY) { \ + CFDictionaryRemoveValue((CFMutableDictionaryRef) DICTIONARY, (CFStringRef) ATTRIBUTE); \ + } +#endif + +#ifndef MTR_REQUIRED_ATTRIBUTE +#define MTR_REQUIRED_ATTRIBUTE(ATTRIBUTE, VALUE, DICTIONARY) \ + { \ + id valueToAdd = VALUE; \ + if (valueToAdd != nil) { \ + CFDictionarySetValue((CFMutableDictionaryRef) DICTIONARY, (CFStringRef) ATTRIBUTE, (const void *) valueToAdd); \ + } else { \ + MTR_LOG_ERROR("Warning, missing %@ to add to %s", ATTRIBUTE, #DICTIONARY); \ + } \ + } +#endif diff --git a/src/darwin/Framework/CHIP/MTRDeviceController+XPC.mm b/src/darwin/Framework/CHIP/MTRDeviceController+XPC.mm index 87ce5560381cca..1cd02e24648867 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController+XPC.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController+XPC.mm @@ -34,7 +34,13 @@ static NSSet * GetXPCAllowedClasses() { static NSSet * const sXPCAllowedClasses = [NSSet setWithArray:@[ - [NSString class], [NSNumber class], [NSData class], [NSArray class], [NSDictionary class], [NSError class] + [NSString class], + [NSNumber class], + [NSData class], + [NSArray class], + [NSDictionary class], + [NSError class], + [NSDate class], ]]; return sXPCAllowedClasses; } diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_XPC.h b/src/darwin/Framework/CHIP/MTRDeviceController_XPC.h index c891c10d726791..87218b1f391a66 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_XPC.h +++ b/src/darwin/Framework/CHIP/MTRDeviceController_XPC.h @@ -27,7 +27,7 @@ MTR_TESTABLE - (id)initWithUniqueIdentifier:(NSUUID *)UUID machServiceName:(NSString *)machServiceName options:(NSXPCConnectionOptions)options #endif - @property(atomic, retain, readwrite)NSXPCConnection * xpcConnection; + @property(nullable, atomic, retain, readwrite)NSXPCConnection * xpcConnection; @end diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm b/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm index cb09fbd7ff737b..eb21dadeb8462b 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm @@ -19,6 +19,7 @@ #import "MTRDefines_Internal.h" #import "MTRDeviceController_Internal.h" #import "MTRDevice_XPC.h" +#import "MTRDevice_XPC_Internal.h" #import "MTRLogging_Internal.h" #import "MTRXPCClientProtocol.h" #import "MTRXPCServerProtocol.h" @@ -33,7 +34,9 @@ @interface MTRDeviceController_XPC () -@property (nonatomic, retain, readwrite) NSUUID * uniqueIdentifier; +@property (nonnull, atomic, readwrite, retain) MTRXPCDeviceControllerParameters * xpcParameters; +@property (atomic, readwrite, assign) NSTimeInterval xpcRetryTimeInterval; +@property (atomic, readwrite, assign) BOOL xpcConnectedOrConnecting; @end @@ -41,40 +44,62 @@ @interface MTRDeviceController_XPC () @implementation MTRDeviceController_XPC -@synthesize uniqueIdentifier = _uniqueIdentifier; ++ (NSMutableSet *)_allowedClasses +{ + static NSArray * sBaseAllowedClasses = @[ + [NSString class], + [NSNumber class], + [NSData class], + [NSArray class], + [NSDictionary class], + [NSError class], + [NSDate class], + ]; + + return [NSMutableSet setWithArray:sBaseAllowedClasses]; +} - (NSXPCInterface *)_interfaceForServerProtocol { NSXPCInterface * interface = [NSXPCInterface interfaceWithProtocol:@protocol(MTRXPCServerProtocol)]; - NSSet * allowedClasses = [NSSet setWithArray:@[ - [NSString class], [NSNumber class], [NSData class], [NSArray class], [NSDictionary class], [NSError class], [MTRCommandPath class], [MTRAttributePath class] + NSMutableSet * allowedClasses = [MTRDeviceController_XPC _allowedClasses]; + [allowedClasses addObjectsFromArray:@[ + [MTRCommandPath class], + [MTRAttributePath class] ]]; [interface setClasses:allowedClasses forSelector:@selector(deviceController:nodeID:invokeCommandWithEndpointID:clusterID:commandID:commandFields:expectedValues:expectedValueInterval:timedInvokeTimeout:serverSideProcessingTimeout:completion:) argumentIndex:0 ofReply:YES]; + return interface; } - (NSXPCInterface *)_interfaceForClientProtocol { NSXPCInterface * interface = [NSXPCInterface interfaceWithProtocol:@protocol(MTRXPCClientProtocol)]; - NSSet * allowedClasses = [NSSet setWithArray:@[ - [NSString class], [NSNumber class], [NSData class], [NSArray class], [NSDictionary class], [NSError class], [MTRAttributePath class] + NSMutableSet * allowedClasses = [MTRDeviceController_XPC _allowedClasses]; + [allowedClasses addObjectsFromArray:@[ + [MTRAttributePath class] ]]; + [interface setClasses:allowedClasses forSelector:@selector(device:receivedAttributeReport:) argumentIndex:1 ofReply:NO]; - allowedClasses = [NSSet setWithArray:@[ - [NSString class], [NSNumber class], [NSData class], [NSArray class], [NSDictionary class], [NSError class], [MTREventPath class] + + allowedClasses = [MTRDeviceController_XPC _allowedClasses]; + [allowedClasses addObjectsFromArray:@[ + [MTREventPath class] ]]; + [interface setClasses:allowedClasses forSelector:@selector(device:receivedEventReport:) argumentIndex:1 ofReply:NO]; + return interface; } @@ -83,6 +108,107 @@ - (NSXPCInterface *)_interfaceForClientProtocol return [self.uniqueIdentifier UUIDString]; } +- (void)_startXPCConnectionRetry +{ + if (!self.xpcConnectedOrConnecting) { + MTR_LOG("%@: XPC Connection retry - Starting retry for XPC Connection", self); + self.xpcRetryTimeInterval = 0.5; + mtr_weakify(self); + + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t) (self.xpcRetryTimeInterval * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + mtr_strongify(self); + [self _xpcConnectionRetry]; + }); + } else { + MTR_LOG("%@: XPC Connection retry - Not starting retry for XPC Connection, already trying", self); + } +} + +- (void)_xpcConnectionRetry +{ + MTR_LOG("%@: XPC Connection retry - timer hit", self); + if (!self.xpcConnectedOrConnecting) { + if (![self _setupXPCConnection]) { +#if 0 // FIXME: Not sure why this retry is not working, but I will fix this later + MTR_LOG("%@: XPC Connection retry - Scheduling another retry", self); + self.xpcRetryTimeInterval = self.xpcRetryTimeInterval >= 1 ? self.xpcRetryTimeInterval * 2 : 1; + self.xpcRetryTimeInterval = MIN(60.0, self.xpcRetryTimeInterval); + mtr_weakify(self); + + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(self.xpcRetryTimeInterval * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + mtr_strongify(self); + [self _xpcConnectionRetry]; + }); +#else + MTR_LOG("%@: XPC Connection failed retry - bailing", self); +#endif + } else { + MTR_LOG("%@: XPC Connection retry - connection attempt successful", self); + } + } else { + MTR_LOG("%@: XPC Connection retry - Mid retry, or connected, stopping retry timer", self); + } +} + +- (BOOL)_setupXPCConnection +{ + self.xpcConnection = self.xpcParameters.xpcConnectionBlock(); + + MTR_LOG("%@ Set up XPC Connection: %@", self, self.xpcConnection); + if (self.xpcConnection) { + mtr_weakify(self); + self.xpcConnection.remoteObjectInterface = [self _interfaceForServerProtocol]; + + self.xpcConnection.exportedInterface = [self _interfaceForClientProtocol]; + self.xpcConnection.exportedObject = self; + + self.xpcConnection.interruptionHandler = ^{ + mtr_strongify(self); + MTR_LOG_ERROR("XPC Connection for device controller interrupted: %@", self.xpcParameters.uniqueIdentifier); + self.xpcConnectedOrConnecting = NO; + self.xpcConnection = nil; + [self _startXPCConnectionRetry]; + }; + + self.xpcConnection.invalidationHandler = ^{ + mtr_strongify(self); + MTR_LOG_ERROR("XPC Connection for device controller invalidated: %@", self.xpcParameters.uniqueIdentifier); + self.xpcConnectedOrConnecting = NO; + self.xpcConnection = nil; + [self _startXPCConnectionRetry]; + }; + + MTR_LOG("%@ Activating new XPC connection", self); + [self.xpcConnection activate]; + + [[self.xpcConnection synchronousRemoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) { + MTR_LOG_ERROR("Checkin error: %@", error); + }] deviceController:self.uniqueIdentifier checkInWithContext:[NSDictionary dictionary]]; + + // FIXME: Trying to kick all the MTRDevices attached to this controller to re-establish connections + // This state needs to be stored properly and re-established at connnection time + + MTR_LOG("%@ Starting existing NodeID Registration", self); + for (NSNumber * nodeID in [self.nodeIDToDeviceMap keyEnumerator]) { + MTR_LOG("%@ => Registering nodeID: %@", self, nodeID); + mtr_weakify(self); + + [[self.xpcConnection synchronousRemoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) { + mtr_strongify(self); + MTR_LOG_ERROR("%@ Registration error for device nodeID: %@ : %@", self, nodeID, error); + }] deviceController:self.uniqueIdentifier registerNodeID:nodeID]; + } + + MTR_LOG("%@ Done existing NodeID Registration", self); + self.xpcConnectedOrConnecting = YES; + } else { + MTR_LOG_ERROR("%@ Failed to set up XPC Connection", self); + self.xpcConnectedOrConnecting = NO; + } + + return (self.xpcConnectedOrConnecting); +} + - (nullable instancetype)initWithParameters:(MTRDeviceControllerAbstractParameters *)parameters error:(NSError * __autoreleasing *)error { @@ -110,29 +236,10 @@ - (nullable instancetype)initWithParameters:(MTRDeviceControllerAbstractParamete return nil; } - self.xpcConnection = connectionBlock(); - self.uniqueIdentifier = UUID; + self.xpcParameters = xpcParameters; self.chipWorkQueue = dispatch_queue_create("MTRDeviceController_XPC_queue", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - MTR_LOG("Set up XPC Connection: %@", self.xpcConnection); - if (self.xpcConnection) { - self.xpcConnection.remoteObjectInterface = [self _interfaceForServerProtocol]; - - self.xpcConnection.exportedInterface = [self _interfaceForClientProtocol]; - self.xpcConnection.exportedObject = self; - - self.xpcConnection.interruptionHandler = ^{ - MTR_LOG_ERROR("XPC Connection for device controller interrupted: %@", UUID); - }; - - self.xpcConnection.invalidationHandler = ^{ - MTR_LOG_ERROR("XPC Connection for device controller invalidated: %@", UUID); - }; - - MTR_LOG("Activating new XPC connection"); - [self.xpcConnection activate]; - } else { - MTR_LOG_ERROR("Failed to set up XPC Connection"); + if (![self _setupXPCConnection]) { return nil; } } @@ -158,7 +265,7 @@ - (id)initWithUniqueIdentifier:(NSUUID *)UUID machServiceName:(NSString *)machSe self.xpcConnection.exportedObject = self; MTR_LOG("%s: resuming new XPC connection"); - [self.xpcConnection resume]; + [self.xpcConnection activate]; } else { MTR_LOG_ERROR("Failed to set up XPC Connection"); return nil; @@ -176,13 +283,7 @@ - (MTRDevice *)_setupDeviceForNodeID:(NSNumber *)nodeID prefetchedClusterData:(N os_unfair_lock_assert_owner(self.deviceMapLock); MTRDevice * deviceToReturn = [[MTRDevice_XPC alloc] initWithNodeID:nodeID controller:self]; - // If we're not running, don't add the device to our map. That would - // create a cycle that nothing would break. Just return the device, - // which will be in exactly the state it would be in if it were created - // while we were running and then we got shut down. - if ([self isRunning]) { - [self.nodeIDToDeviceMap setObject:deviceToReturn forKey:nodeID]; - } + [self.nodeIDToDeviceMap setObject:deviceToReturn forKey:nodeID]; MTR_LOG("%s: returning XPC device for node id %@", __PRETTY_FUNCTION__, nodeID); return deviceToReturn; } @@ -254,6 +355,14 @@ - (oneway void)deviceConfigurationChanged:(NSNumber *)nodeID [device deviceConfigurationChanged:nodeID]; } +- (oneway void)device:(NSNumber *)nodeID internalStateUpdated:(NSDictionary *)dictionary +{ + MTRDevice_XPC * device = (MTRDevice_XPC *) [self deviceForNodeID:nodeID]; + MTR_LOG("Received internalStateUpdated: %@ found device: %@", nodeID, device); + + [device device:nodeID internalStateUpdated:dictionary]; +} + #pragma mark - MTRDeviceController Protocol Client // Not Supported via XPC diff --git a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm index 706642accf65b6..93c0f9c353b04a 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm +++ b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm @@ -254,8 +254,6 @@ @interface MTRDevice_Concrete () @property (nonatomic) ReadClient * currentReadClient; @property (nonatomic) SubscriptionCallback * currentSubscriptionCallback; // valid when and only when currentReadClient is valid -@property (nonatomic, weak) id privateInternalStateDelegate; - @end // Declaring selector so compiler won't complain about testing and calling it in _handleReportEnd @@ -468,31 +466,28 @@ - (NSString *)description - (NSDictionary *)_internalProperties { - id vidOrUnknown, pidOrUnknown; + NSMutableDictionary * properties = [NSMutableDictionary dictionary]; + std::lock_guard lock(_descriptionLock); - { - std::lock_guard lock(_descriptionLock); + MTR_OPTIONAL_ATTRIBUTE(kMTRDeviceInternalPropertyKeyVendorID, _vid, properties); + MTR_OPTIONAL_ATTRIBUTE(kMTRDeviceInternalPropertyKeyProductID, _pid, properties); + MTR_OPTIONAL_ATTRIBUTE(kMTRDeviceInternalPropertyNetworkFeatures, _allNetworkFeatures, properties); + MTR_OPTIONAL_ATTRIBUTE(kMTRDeviceInternalPropertyDeviceState, [NSNumber numberWithUnsignedInteger:_internalDeviceStateForDescription], properties); + MTR_OPTIONAL_ATTRIBUTE(kMTRDeviceInternalPropertyLastSubscriptionAttemptWait, [NSNumber numberWithUnsignedInt:_lastSubscriptionAttemptWaitForDescription], properties); + MTR_OPTIONAL_ATTRIBUTE(kMTRDeviceInternalPropertyMostRecentReportTime, _mostRecentReportTimeForDescription, properties); + MTR_OPTIONAL_ATTRIBUTE(kMTRDeviceInternalPropertyLastSubscriptionFailureTime, _lastSubscriptionFailureTimeForDescription, properties); - vidOrUnknown = _vid ?: @"Unknown"; - pidOrUnknown = _pid ?: @"Unknown"; - // id networkFeatures = _allNetworkFeatures; - // id internalDeviceState = _internalDeviceStateForDescription; - // id lastSubscriptionAttemptWait = _lastSubscriptionAttemptWaitForDescription; - // id mostRecentReportTime = _mostRecentReportTimeForDescription; - // id lastSubscriptionFailureTime = _lastSubscriptionFailureTimeForDescription; - } - - return @{ - kMTRDeviceInternalPropertyKeyVendorID : vidOrUnknown, - kMTRDeviceInternalPropertyKeyProductID : pidOrUnknown, - }; + return properties; } -- (void)_notifyPrivateInternalPropertiesDelegateOfChanges +- (void)_notifyDelegateOfPrivateInternalPropertiesChanges { - if ([self.privateInternalStateDelegate respondsToSelector:@selector(device:internalStateUpdated:)]) { - [self.privateInternalStateDelegate device:self.nodeID internalStateUpdated:[self _internalProperties]]; - } + os_unfair_lock_assert_owner(&self->_lock); + [self _callDelegatesWithBlock:^(id delegate) { + if ([delegate respondsToSelector:@selector(device:internalStateUpdated:)]) { + [delegate performSelector:@selector(device:internalStateUpdated:) withObject:self withObject:[self _internalProperties]]; + } + }]; } #pragma mark - Time Synchronization @@ -769,6 +764,8 @@ - (void)_ensureSubscriptionForExistingDelegates:(NSString *)reason [self _setupSubscriptionWithReason:[NSString stringWithFormat:@"%@ and subscription is needed", reason]]; } } + + [self _notifyDelegateOfPrivateInternalPropertiesChanges]; } - (void)invalidate @@ -992,7 +989,7 @@ - (void)_changeInternalState:(MTRInternalDeviceState)state }]; /* END DRAGONS */ - [self _notifyPrivateInternalPropertiesDelegateOfChanges]; + [self _notifyDelegateOfPrivateInternalPropertiesChanges]; } } @@ -1194,7 +1191,7 @@ - (void)_handleResubscriptionNeededWithDelay:(NSNumber *)resubscriptionDelayMs std::lock_guard lock(_descriptionLock); _lastSubscriptionFailureTimeForDescription = _lastSubscriptionFailureTime; } - [self _notifyPrivateInternalPropertiesDelegateOfChanges]; + [self _notifyDelegateOfPrivateInternalPropertiesChanges]; deviceUsesThread = [self _deviceUsesThread]; // If a previous resubscription failed, remove the item from the subscription pool. @@ -1245,7 +1242,7 @@ - (void)_setLastSubscriptionAttemptWait:(uint32_t)lastSubscriptionAttemptWait _lastSubscriptionAttemptWaitForDescription = lastSubscriptionAttemptWait; } - [self _notifyPrivateInternalPropertiesDelegateOfChanges]; + [self _notifyDelegateOfPrivateInternalPropertiesChanges]; } - (void)_doHandleSubscriptionReset:(NSNumber * _Nullable)retryDelay @@ -1266,7 +1263,7 @@ - (void)_doHandleSubscriptionReset:(NSNumber * _Nullable)retryDelay std::lock_guard lock(_descriptionLock); _lastSubscriptionFailureTimeForDescription = _lastSubscriptionFailureTime; } - [self _notifyPrivateInternalPropertiesDelegateOfChanges]; + [self _notifyDelegateOfPrivateInternalPropertiesChanges]; // if there is no delegate then also do not retry if (![self _delegateExists]) { @@ -1324,6 +1321,7 @@ - (void)_doHandleSubscriptionReset:(NSNumber * _Nullable)retryDelay // For non-Thread-enabled devices, just call the resubscription block after the specified time dispatch_after(dispatch_time(DISPATCH_TIME_NOW, resubscriptionDelayNs), self.queue, resubscriptionBlock); } + [self _notifyDelegateOfPrivateInternalPropertiesChanges]; } - (void)_reattemptSubscriptionNowIfNeededWithReason:(NSString *)reason @@ -1521,7 +1519,8 @@ - (void)unitTestSetMostRecentReportTimes:(NSMutableArray *)mostRecentR std::lock_guard lock(_descriptionLock); _mostRecentReportTimeForDescription = [mostRecentReportTimes lastObject]; } - [self _notifyPrivateInternalPropertiesDelegateOfChanges]; + std::lock_guard lock(_lock); + [self _notifyDelegateOfPrivateInternalPropertiesChanges]; } #endif @@ -1580,7 +1579,6 @@ - (void)_scheduleClusterDataPersistence std::lock_guard lock(_descriptionLock); _mostRecentReportTimeForDescription = [_mostRecentReportTimes lastObject]; } - [self _notifyPrivateInternalPropertiesDelegateOfChanges]; // Calculate running average and update multiplier - need at least 2 items to calculate intervals if (_mostRecentReportTimes.count > 2) { @@ -1627,6 +1625,8 @@ - (void)_scheduleClusterDataPersistence } } + [self _notifyDelegateOfPrivateInternalPropertiesChanges]; + // Do not schedule persistence if device is reporting excessively if ([self _deviceIsReportingExcessively]) { return; @@ -1651,7 +1651,6 @@ - (void)_resetStorageBehaviorState std::lock_guard lock(_descriptionLock); _mostRecentReportTimeForDescription = nil; } - [self _notifyPrivateInternalPropertiesDelegateOfChanges]; _deviceReportingExcessivelyStartTime = nil; _reportToPersistenceDelayCurrentMultiplier = 1; @@ -1660,6 +1659,8 @@ - (void)_resetStorageBehaviorState if ([self _dataStoreExists]) { [self _persistClusterData]; } + + [self _notifyDelegateOfPrivateInternalPropertiesChanges]; } - (void)setStorageBehaviorConfiguration:(MTRDeviceStorageBehaviorConfiguration *)storageBehaviorConfiguration @@ -1713,6 +1714,8 @@ - (void)_handleReportEnd } }]; #endif + + [self _notifyDelegateOfPrivateInternalPropertiesChanges]; } - (BOOL)_interestedPaths:(NSArray * _Nullable)interestedPaths includesAttributePath:(MTRAttributePath *)attributePath diff --git a/src/darwin/Framework/CHIP/MTRDevice_Internal.h b/src/darwin/Framework/CHIP/MTRDevice_Internal.h index 9905da7ff711a6..7a91b926560f30 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDevice_Internal.h @@ -235,6 +235,10 @@ static NSString * const sLastInitialSubscribeLatencyKey = @"lastInitialSubscribe // Concrete to XPC internal state property dictionary keys static NSString * const kMTRDeviceInternalPropertyKeyVendorID = @"MTRDeviceInternalStateKeyVendorID"; static NSString * const kMTRDeviceInternalPropertyKeyProductID = @"MTRDeviceInternalStateKeyProductID"; -// TODO: more internal properties +static NSString * const kMTRDeviceInternalPropertyNetworkFeatures = @"MTRDeviceInternalPropertyNetworkFeatures"; +static NSString * const kMTRDeviceInternalPropertyDeviceState = @"MTRDeviceInternalPropertyDeviceState"; +static NSString * const kMTRDeviceInternalPropertyLastSubscriptionAttemptWait = @"kMTRDeviceInternalPropertyLastSubscriptionAttemptWait"; +static NSString * const kMTRDeviceInternalPropertyMostRecentReportTime = @"MTRDeviceInternalPropertyMostRecentReportTime"; +static NSString * const kMTRDeviceInternalPropertyLastSubscriptionFailureTime = @"MTRDeviceInternalPropertyLastSubscriptionFailureTime"; NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/MTRDevice_XPC.mm b/src/darwin/Framework/CHIP/MTRDevice_XPC.mm index 7267eb3a2b4f7e..5279933104a11c 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_XPC.mm +++ b/src/darwin/Framework/CHIP/MTRDevice_XPC.mm @@ -103,32 +103,35 @@ - (void)dealloc - (NSString *)description { - // TODO: Figure out whether, and if so how, to log: VID, PID, WiFi, Thread, - // internalDeviceState (do we even have such a thing here?), last - // subscription attempt wait (does that apply to us?) queued work (do we - // have any?), last report, last subscription failure (does that apply to us?). - return [NSString - stringWithFormat:@"<%@: %p, node: %016llX-%016llX (%llu), VID: %@, PID: %@, controller: %@>", NSStringFromClass(self.class), self, _deviceController.compressedFabricID.unsignedLongLongValue, _nodeID.unsignedLongLongValue, _nodeID.unsignedLongLongValue, [self _vid], [self _pid], _deviceController.uniqueIdentifier]; -} + NSString * wifi; + NSString * thread; + NSNumber * networkFeatures = [self._internalState objectForKey:kMTRDeviceInternalPropertyNetworkFeatures]; -- (nullable NSNumber *)_internalStateNumberOrNilForKey:(NSString *)key -{ - if ([_internalState[key] isKindOfClass:NSNumber.class]) { - NSNumber * number = _internalState[key]; - return number; + if (networkFeatures == nil) { + wifi = @"NO"; + thread = @"NO"; } else { - return nil; + wifi = YES_NO(networkFeatures.unsignedLongLongValue & MTRNetworkCommissioningFeatureWiFiNetworkInterface); + thread = YES_NO(networkFeatures.unsignedLongLongValue & MTRNetworkCommissioningFeatureThreadNetworkInterface); } -} -- (nullable NSNumber *)_vid -{ - return [self _internalStateNumberOrNilForKey:kMTRDeviceInternalPropertyKeyVendorID]; -} + // TODO: Add these to the description + // MTR_OPTIONAL_ATTRIBUTE(kMTRDeviceInternalPropertyDeviceState, _internalDeviceStateForDescription, properties); + // MTR_OPTIONAL_ATTRIBUTE(kMTRDeviceInternalPropertyLastSubscriptionAttemptWait, _lastSubscriptionAttemptWaitForDescription, properties); + // MTR_OPTIONAL_ATTRIBUTE(kMTRDeviceInternalPropertyMostRecentReportTime, _mostRecentReportTimeForDescription, properties); + // MTR_OPTIONAL_ATTRIBUTE(kMTRDeviceInternalPropertyLastSubscriptionFailureTime, _lastSubscriptionFailureTimeForDescription, properties); -- (nullable NSNumber *)_pid -{ - return [self _internalStateNumberOrNilForKey:kMTRDeviceInternalPropertyKeyProductID]; + return [NSString + stringWithFormat:@"<%@: %p, node: %016llX-%016llX (%llu), VID: %@, PID: %@, WiFi: %@, Thread: %@, controller: %@>", + NSStringFromClass(self.class), self, + _deviceController.compressedFabricID.unsignedLongLongValue, + _nodeID.unsignedLongLongValue, + _nodeID.unsignedLongLongValue, + [self._internalState objectForKey:kMTRDeviceInternalPropertyKeyVendorID], + [self._internalState objectForKey:kMTRDeviceInternalPropertyKeyProductID], + wifi, + thread, + _deviceController.uniqueIdentifier]; } #pragma mark - Client Callbacks (MTRDeviceDelegate) @@ -187,6 +190,12 @@ - (oneway void)deviceConfigurationChanged:(NSNumber *)nodeID }]; } +- (oneway void)device:(NSNumber *)nodeID internalStateUpdated:(NSDictionary *)dictionary +{ + [self _setInternalState:dictionary]; + MTR_LOG("%@ internal state updated", self); +} + #pragma mark - Remote Commands MTR_DEVICE_SIMPLE_REMOTE_XPC_GETTER(state, MTRDeviceState, MTRDeviceStateUnknown, getStateWithReply) diff --git a/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCClientProtocol.h b/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCClientProtocol.h index b26b6d88849193..cfa59db8a73303 100644 --- a/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCClientProtocol.h +++ b/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCClientProtocol.h @@ -27,9 +27,6 @@ MTR_NEWLY_AVAILABLE - (oneway void)deviceBecameActive:(NSNumber *)nodeID; - (oneway void)deviceCachePrimed:(NSNumber *)nodeID; - (oneway void)deviceConfigurationChanged:(NSNumber *)nodeID; - -@optional -// temporarily optional to avoid lockstep needs - (oneway void)device:(NSNumber *)nodeID internalStateUpdated:(NSDictionary *)dictionary; @end diff --git a/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCServerProtocol.h b/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCServerProtocol.h index 1ebdea5d3757ec..52a5d2228fa524 100644 --- a/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCServerProtocol.h +++ b/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCServerProtocol.h @@ -70,9 +70,6 @@ MTR_NEWLY_AVAILABLE //- (oneway void)deviceController:(NSUUID *)controller removeServerEndpoint:(MTRServerEndpoint *)endpoint; - (oneway void)deviceController:(NSUUID *)controller shutdownDeviceController:(NSUUID *)controller; - -@optional -// register / unregister temporarily optional to avoid lockstep needs - (oneway void)deviceController:(NSUUID *)controller registerNodeID:(NSNumber *)nodeID; - (oneway void)deviceController:(NSUUID *)controller unregisterNodeID:(NSNumber *)nodeID; From 33fec506788a629f44da1834442ecaabbbbc2ac1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Sat, 7 Sep 2024 21:41:44 +0200 Subject: [PATCH 33/42] Update ValveControlDelegate.cpp (#35460) --- examples/all-clusters-app/linux/ValveControlDelegate.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/all-clusters-app/linux/ValveControlDelegate.cpp b/examples/all-clusters-app/linux/ValveControlDelegate.cpp index 29c744257fbabe..f161ee65eae504 100644 --- a/examples/all-clusters-app/linux/ValveControlDelegate.cpp +++ b/examples/all-clusters-app/linux/ValveControlDelegate.cpp @@ -35,7 +35,7 @@ DataModel::Nullable ValveControlDelegate::HandleOpenValve(DataMod sLastOpenDuration = 0; ChipLogProgress(NotSpecified, "Valve opening from level: %d to %d", currentLevel, sLevel); - // In this demo application, the trasition is considered instant, + // In this demo application, the transition is considered instant, // so current level is set to the requested level and current state is set to kOpen. currentLevel = sLevel; Attributes::CurrentState::Set(kValveEndpoint, ValveConfigurationAndControl::ValveStateEnum::kOpen); From 3e5b1497602b7391d453c0f2643bfbaf524c9a9b Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Sat, 7 Sep 2024 18:14:43 -0400 Subject: [PATCH 34/42] Abort BDX transfers as needed on controller shutdown. (#35466) If we're acting as a BDX transfer server, we should shut down transfers for a fabric index when the corresponding DeviceController shuts down. --- src/controller/CHIPDeviceController.cpp | 3 +++ .../bdx/BdxTransferDiagnosticLog.cpp | 20 +++++++++++++++++++ src/protocols/bdx/BdxTransferDiagnosticLog.h | 12 ++++++++++- .../bdx/BdxTransferDiagnosticLogPool.h | 15 ++++++++++++-- src/protocols/bdx/BdxTransferServer.h | 3 +++ 5 files changed, 50 insertions(+), 3 deletions(-) diff --git a/src/controller/CHIPDeviceController.cpp b/src/controller/CHIPDeviceController.cpp index 7c43d50c082389..346867226e4261 100644 --- a/src/controller/CHIPDeviceController.cpp +++ b/src/controller/CHIPDeviceController.cpp @@ -403,6 +403,9 @@ void DeviceController::Shutdown() // assume that all sessions for our fabric belong to us here. mSystemState->CASESessionMgr()->ReleaseSessionsForFabric(mFabricIndex); + // Shut down any bdx transfers we're acting as the server for. + mSystemState->BDXTransferServer()->AbortTransfersForFabric(mFabricIndex); + // TODO: The CASE session manager does not shut down existing CASE // sessions. It just shuts down any ongoing CASE session establishment // we're in the middle of as initiator. Maybe it should shut down diff --git a/src/protocols/bdx/BdxTransferDiagnosticLog.cpp b/src/protocols/bdx/BdxTransferDiagnosticLog.cpp index 51e56fba9ac254..4804a01c578c26 100644 --- a/src/protocols/bdx/BdxTransferDiagnosticLog.cpp +++ b/src/protocols/bdx/BdxTransferDiagnosticLog.cpp @@ -18,6 +18,8 @@ #include "BdxTransferDiagnosticLog.h" +#include + namespace chip { namespace bdx { @@ -201,5 +203,23 @@ void BdxTransferDiagnosticLog::OnExchangeClosing(Messaging::ExchangeContext * ec LogErrorOnFailure(OnTransferSessionEnd(CHIP_ERROR_INTERNAL)); } +bool BdxTransferDiagnosticLog::IsForFabric(FabricIndex fabricIndex) const +{ + if (mExchangeCtx == nullptr || !mExchangeCtx->HasSessionHandle()) + { + return false; + } + + auto session = mExchangeCtx->GetSessionHandle(); + return session->GetFabricIndex() == fabricIndex; +} + +void BdxTransferDiagnosticLog::AbortTransfer() +{ + // No need to mTransfer.AbortTransfer() here, since that just tries to async + // send a StatusReport to the other side, but we are going away here. + Reset(); +} + } // namespace bdx } // namespace chip diff --git a/src/protocols/bdx/BdxTransferDiagnosticLog.h b/src/protocols/bdx/BdxTransferDiagnosticLog.h index bc7a8773cd2dff..0f62aff7f837e5 100644 --- a/src/protocols/bdx/BdxTransferDiagnosticLog.h +++ b/src/protocols/bdx/BdxTransferDiagnosticLog.h @@ -18,14 +18,17 @@ #pragma once -#include +#include #include +#include #include #include namespace chip { namespace bdx { +class BdxTransferDiagnosticLogPoolDelegate; + class BdxTransferDiagnosticLog : public Responder { public: @@ -45,6 +48,13 @@ class BdxTransferDiagnosticLog : public Responder void OnExchangeClosing(Messaging::ExchangeContext * ec) override; + /** + * Lifetime management, to allow us to abort transfers when a fabric + * identity is being shut down. + */ + bool IsForFabric(FabricIndex fabricIndex) const; + void AbortTransfer(); + protected: /** * Called when a BDX message is received over the exchange context diff --git a/src/protocols/bdx/BdxTransferDiagnosticLogPool.h b/src/protocols/bdx/BdxTransferDiagnosticLogPool.h index a2d7d3f5d11105..70f8fdfaceb55a 100644 --- a/src/protocols/bdx/BdxTransferDiagnosticLogPool.h +++ b/src/protocols/bdx/BdxTransferDiagnosticLogPool.h @@ -18,15 +18,15 @@ #pragma once +#include #include +#include #include #include namespace chip { namespace bdx { -class BdxTransferDiagnosticLog; - class BdxTransferDiagnosticLogPoolDelegate { public: @@ -50,6 +50,17 @@ class BdxTransferDiagnosticLogPool : public BdxTransferDiagnosticLogPoolDelegate void Release(BdxTransferDiagnosticLog * transfer) override { mTransferPool.ReleaseObject(transfer); } + void AbortTransfersForFabric(FabricIndex fabricIndex) + { + mTransferPool.ForEachActiveObject([fabricIndex](BdxTransferDiagnosticLog * transfer) { + if (transfer->IsForFabric(fabricIndex)) + { + transfer->AbortTransfer(); + } + return Loop::Continue; + }); + } + private: ObjectPool mTransferPool; }; diff --git a/src/protocols/bdx/BdxTransferServer.h b/src/protocols/bdx/BdxTransferServer.h index 0fac0e88b672de..0bc3cf10e124e9 100644 --- a/src/protocols/bdx/BdxTransferServer.h +++ b/src/protocols/bdx/BdxTransferServer.h @@ -20,6 +20,7 @@ #include +#include #include #include #include @@ -42,6 +43,8 @@ class BDXTransferServer : public Messaging::UnsolicitedMessageHandler void SetDelegate(BDXTransferServerDelegate * delegate) { mDelegate = delegate; } + void AbortTransfersForFabric(FabricIndex fabricIndex) { mPoolDelegate.AbortTransfersForFabric(fabricIndex); } + protected: CHIP_ERROR OnUnsolicitedMessageReceived(const PayloadHeader & payloadHeader, Messaging::ExchangeDelegate *& newDelegate) override; From bc19fb05143c9958a7b3d9ec8c07b3c7ae2fe159 Mon Sep 17 00:00:00 2001 From: Justin Wood Date: Sat, 7 Sep 2024 19:52:10 -0700 Subject: [PATCH 35/42] Fixing shadow variables, and also fixing registration (#35473) --- src/darwin/Framework/CHIP/MTRDeviceController.mm | 4 +++- .../Framework/CHIP/MTRDeviceController_Concrete.h | 5 ----- .../CHIP/MTRDeviceController_Concrete.mm | 15 +++++---------- .../Framework/CHIP/MTRDeviceController_Internal.h | 2 ++ .../Framework/CHIP/MTRDeviceController_XPC.mm | 8 ++++++++ 5 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm index a55946c237c364..4f41330b54c3dd 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm @@ -142,6 +142,8 @@ @implementation MTRDeviceController { os_unfair_lock _assertionLock; } +@synthesize uniqueIdentifier = _uniqueIdentifier; + - (os_unfair_lock_t)deviceMapLock { return &_underlyingDeviceMapLock; @@ -340,7 +342,7 @@ - (instancetype)initWithFactory:(MTRDeviceControllerFactory *)factory - (NSString *)description { - return [NSString stringWithFormat:@"<%@: %p uuid %@>", NSStringFromClass(self.class), self, _uniqueIdentifier]; + return [NSString stringWithFormat:@"<%@: %p uuid %@>", NSStringFromClass(self.class), self, self.uniqueIdentifier]; } - (BOOL)isRunning diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.h b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.h index c9587e910d3b1a..34c5ca8efad1da 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.h +++ b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.h @@ -58,11 +58,6 @@ typedef void (^MTRDeviceConnectionCallback)(MTRBaseDevice * _Nullable device, NS */ @property (readonly, nonatomic, getter=isRunning) BOOL running; -/** - * The ID assigned to this controller at creation time. - */ -@property (readonly, nonatomic) NSUUID * uniqueIdentifier MTR_AVAILABLE(ios(17.6), macos(14.6), watchos(10.6), tvos(17.6)); - /** * Return the Node ID assigned to the controller. Will return nil if the * controller is not running (and hence does not know its node id). diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm index fbfc072826ad8a..4f19035f27da85 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm @@ -101,7 +101,6 @@ @interface MTRDeviceController_Concrete () @property (nonatomic, readonly) MTRDeviceControllerDelegateBridge * deviceControllerDelegateBridge; @property (nonatomic, readonly) MTROperationalCredentialsDelegate * operationalCredentialsDelegate; @property (nonatomic, readonly) MTRDeviceAttestationDelegateBridge * deviceAttestationDelegateBridge; -@property (nonatomic, readwrite) NSUUID * uniqueIdentifier; @property (nonatomic, readonly) dispatch_queue_t chipWorkQueue; @property (nonatomic, readonly, nullable) MTRDeviceControllerFactory * factory; @property (nonatomic, readonly, nullable) id otaProviderDelegate; @@ -130,9 +129,6 @@ @implementation MTRDeviceController_Concrete { os_unfair_lock _assertionLock; } -// TODO: Figure out whether uniqueIdentifier storage should live in the superclass. It -// probably should! -@synthesize uniqueIdentifier = _uniqueIdentifier; // TODO: Figure out whether the work queue storage lives here or in the superclass // Right now we seem to have both? @synthesize chipWorkQueue = _chipWorkQueue; @@ -208,7 +204,7 @@ - (instancetype)initWithFactory:(MTRDeviceControllerFactory *)factory if (self = [super initForSubclasses:startSuspended]) { // Make sure our storage is all set up to work as early as possible, // before we start doing anything else with the controller. - _uniqueIdentifier = uniqueIdentifier; + self.uniqueIdentifier = uniqueIdentifier; // Setup assertion variables _keepRunningAssertionCounter = 0; @@ -340,7 +336,7 @@ - (instancetype)initWithFactory:(MTRDeviceControllerFactory *)factory - (NSString *)description { - return [NSString stringWithFormat:@"<%@: %p uuid %@>", NSStringFromClass(self.class), self, _uniqueIdentifier]; + return [NSString stringWithFormat:@"<%@: %p uuid %@>", NSStringFromClass(self.class), self, self.uniqueIdentifier]; } - (BOOL)isRunning @@ -744,7 +740,7 @@ - (BOOL)startup:(MTRDeviceControllerStartupParamsInternal *)startupParams if (_controllerDataStore) { // If the storage delegate supports the bulk read API, then a dictionary of nodeID => cluster data dictionary would be passed to the handler. Otherwise this would be a no-op, and stored attributes for MTRDevice objects will be loaded lazily in -deviceForNodeID:. [_controllerDataStore fetchAttributeDataForAllDevices:^(NSDictionary *> * _Nonnull clusterDataByNode) { - MTR_LOG("%@ Loaded attribute values for %lu nodes from storage for controller uuid %@", self, static_cast(clusterDataByNode.count), self->_uniqueIdentifier); + MTR_LOG("%@ Loaded attribute values for %lu nodes from storage for controller uuid %@", self, static_cast(clusterDataByNode.count), self.uniqueIdentifier); std::lock_guard lock(*self.deviceMapLock); NSMutableArray * deviceList = [NSMutableArray array]; @@ -1290,7 +1286,7 @@ - (BOOL)addServerEndpoint:(MTRServerEndpoint *)endpoint [self->_serverEndpoints addObject:endpoint]; [endpoint registerMatterEndpoint]; MTR_LOG("%@ Added server endpoint %u to controller %@", self, static_cast(endpoint.endpointID.unsignedLongLongValue), - self->_uniqueIdentifier); + self.uniqueIdentifier); } errorHandler:^(NSError * error) { MTR_LOG_ERROR("%@ Unexpected failure dispatching to Matter queue on running controller in addServerEndpoint, adding endpoint %u", self, @@ -1317,8 +1313,7 @@ - (void)removeServerEndpointInternal:(MTRServerEndpoint *)endpoint queue:(dispat // tearing it down. [self asyncDispatchToMatterQueue:^() { [self removeServerEndpointOnMatterQueue:endpoint]; - MTR_LOG("%@ Removed server endpoint %u from controller %@", self, static_cast(endpoint.endpointID.unsignedLongLongValue), - self->_uniqueIdentifier); + MTR_LOG("%@ Removed server endpoint %u from controller %@", self, static_cast(endpoint.endpointID.unsignedLongLongValue), self.uniqueIdentifier); if (queue != nil && completion != nil) { dispatch_async(queue, completion); } diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h b/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h index 643a23225774fd..993298234f33ef 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h @@ -69,6 +69,8 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, readonly) NSMapTable * nodeIDToDeviceMap; @property (readonly, assign) os_unfair_lock_t deviceMapLock; +@property (readwrite, nonatomic) NSUUID * uniqueIdentifier; + // queue used to serialize all work performed by the MTRDeviceController // (moved here so subclasses can initialize differently) @property (readwrite, retain) dispatch_queue_t chipWorkQueue; diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm b/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm index eb21dadeb8462b..5b6dcf93f586f8 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm @@ -236,6 +236,7 @@ - (nullable instancetype)initWithParameters:(MTRDeviceControllerAbstractParamete return nil; } + self.uniqueIdentifier = UUID; self.xpcParameters = xpcParameters; self.chipWorkQueue = dispatch_queue_create("MTRDeviceController_XPC_queue", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); @@ -285,6 +286,13 @@ - (MTRDevice *)_setupDeviceForNodeID:(NSNumber *)nodeID prefetchedClusterData:(N MTRDevice * deviceToReturn = [[MTRDevice_XPC alloc] initWithNodeID:nodeID controller:self]; [self.nodeIDToDeviceMap setObject:deviceToReturn forKey:nodeID]; MTR_LOG("%s: returning XPC device for node id %@", __PRETTY_FUNCTION__, nodeID); + + mtr_weakify(self); + [[self.xpcConnection synchronousRemoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) { + mtr_strongify(self); + MTR_LOG_ERROR("%@ Registration error for device nodeID: %@ : %@", self, nodeID, error); + }] deviceController:self.uniqueIdentifier registerNodeID:nodeID]; + return deviceToReturn; } From 9edb3ad93e0506d6510d9d9752147e614f8ed7d4 Mon Sep 17 00:00:00 2001 From: Jeff Tung <100387939+jtung-apple@users.noreply.github.com> Date: Sat, 7 Sep 2024 21:23:52 -0700 Subject: [PATCH 36/42] [Darwin] Darwin CI TSAN test failure fix (#35472) * [Darwin] MTRDeviceController isSuspended needs to hold _suspensionLock * Changed lock to @synchronized because MTRDevice could call isSuspended while holding the suspension lock * Changed enumeration to be safer * Restyled by clang-format --------- Co-authored-by: Restyled.io --- .../Framework/CHIP/MTRDeviceController.mm | 70 ++++++++++--------- .../Framework/CHIP/MTRDevice_Concrete.mm | 4 +- 2 files changed, 40 insertions(+), 34 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm index 4f41330b54c3dd..7eb76c4e4e17c3 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm @@ -134,7 +134,6 @@ @implementation MTRDeviceController { MTRP256KeypairBridge _operationalKeypairBridge; BOOL _suspended; - os_unfair_lock _suspensionLock; // Counters to track assertion status and access controlled by the _assertionLock NSUInteger _keepRunningAssertionCounter; @@ -161,11 +160,11 @@ - (instancetype)initForSubclasses:(BOOL)startSuspended _shutdownPending = NO; _assertionLock = OS_UNFAIR_LOCK_INIT; - _suspended = startSuspended; // All synchronous suspend/resume activity has to be protected by - // _suspensionLock, so that parts of suspend/resume can't interleave with - // each other. - _suspensionLock = OS_UNFAIR_LOCK_INIT; + // @synchronized(self), so that parts of suspend/resume can't + // interleave with each other. Using @synchronized here because + // MTRDevice may call isSuspended. + _suspended = startSuspended; _nodeIDToDeviceMap = [NSMapTable strongToWeakObjectsMapTable]; @@ -212,7 +211,6 @@ - (instancetype)initWithFactory:(MTRDeviceControllerFactory *)factory _assertionLock = OS_UNFAIR_LOCK_INIT; _suspended = startSuspended; - _suspensionLock = OS_UNFAIR_LOCK_INIT; if (storageDelegate != nil) { if (storageDelegateQueue == nil) { @@ -354,50 +352,58 @@ - (BOOL)isRunning - (BOOL)isSuspended { - return _suspended; + @synchronized(self) { + return _suspended; + } } - (void)suspend { MTR_LOG("%@ suspending", self); - std::lock_guard lock(_suspensionLock); + @synchronized(self) { + _suspended = YES; - _suspended = YES; + NSMutableArray * devicesToSuspend = [NSMutableArray array]; + { + std::lock_guard lock(*self.deviceMapLock); + NSEnumerator * devices = [self.nodeIDToDeviceMap objectEnumerator]; + for (MTRDevice * device in devices) { + [devicesToSuspend addObject:device]; + } + } - NSEnumerator * devices; - { - std::lock_guard lock(*self.deviceMapLock); - devices = [self.nodeIDToDeviceMap objectEnumerator]; - } + for (MTRDevice * device in devicesToSuspend) { + [device controllerSuspended]; + } - for (MTRDevice * device in devices) { - [device controllerSuspended]; + // TODO: In the concrete class, consider what should happen with: + // + // * Active commissioning sessions (presumably close them?) + // * CASE sessions in general. + // * Possibly try to see whether we can change our fabric entry to not advertise and restart advertising. } - - // TODO: In the concrete class, consider what should happen with: - // - // * Active commissioning sessions (presumably close them?) - // * CASE sessions in general. - // * Possibly try to see whether we can change our fabric entry to not advertise and restart advertising. } - (void)resume { MTR_LOG("%@ resuming", self); - std::lock_guard lock(_suspensionLock); - - _suspended = NO; + @synchronized(self) { + _suspended = NO; - NSEnumerator * devices; - { - std::lock_guard lock(*self.deviceMapLock); - devices = [self.nodeIDToDeviceMap objectEnumerator]; - } + NSMutableArray * devicesToResume = [NSMutableArray array]; + { + std::lock_guard lock(*self.deviceMapLock); + NSEnumerator * devices = [self.nodeIDToDeviceMap objectEnumerator]; + for (MTRDevice * device in devices) { + [devicesToResume addObject:device]; + } + } - for (MTRDevice * device in devices) { - [device controllerResumed]; + for (MTRDevice * device in devicesToResume) { + [device controllerResumed]; + } } } diff --git a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm index 93c0f9c353b04a..6e3ca4bf32b299 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm +++ b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm @@ -720,7 +720,7 @@ - (BOOL)_subscriptionsAllowed os_unfair_lock_assert_owner(&self->_lock); // We should not allow a subscription for suspended controllers or device controllers over XPC. - return _deviceController.suspended == NO && ![_deviceController isKindOfClass:MTRDeviceControllerOverXPC.class]; + return _deviceController.isSuspended == NO && ![_deviceController isKindOfClass:MTRDeviceControllerOverXPC.class]; } - (void)_delegateAdded @@ -1249,7 +1249,7 @@ - (void)_doHandleSubscriptionReset:(NSNumber * _Nullable)retryDelay { os_unfair_lock_assert_owner(&_lock); - if (_deviceController.suspended) { + if (_deviceController.isSuspended) { MTR_LOG("%@ ignoring expected subscription reset on controller suspend", self); return; } From 7249c56296b93109f972faa4c0a817add9ea7e16 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Sun, 8 Sep 2024 11:48:33 -0700 Subject: [PATCH 37/42] [Raspi] Fix crash on RP4 when add-local-bridge (#35468) * [Raspi] Fix crash on RP4 when add-local-bridge * Restyled by clang-format --------- Co-authored-by: Restyled.io --- .../commands/pairing/PairingCommand.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/fabric-admin/commands/pairing/PairingCommand.h b/examples/fabric-admin/commands/pairing/PairingCommand.h index 293c369b25227e..73e717b93757c2 100644 --- a/examples/fabric-admin/commands/pairing/PairingCommand.h +++ b/examples/fabric-admin/commands/pairing/PairingCommand.h @@ -250,7 +250,7 @@ class PairingCommand : public CHIPCommand, const PairingNetworkType mNetworkType; const chip::Dnssd::DiscoveryFilterType mFilterType; Command::AddressWithInterface mRemoteAddr; - NodeId mNodeId; + NodeId mNodeId = chip::kUndefinedNodeId; chip::Optional mTimeout; chip::Optional mDiscoverOnce; chip::Optional mUseOnlyOnNetworkDiscovery; @@ -272,18 +272,18 @@ class PairingCommand : public CHIPCommand, TypedComplexArgument> mComplex_DSTOffsets; - uint16_t mRemotePort; - uint16_t mDiscriminator; - uint32_t mSetupPINCode; - uint16_t mIndex; + uint16_t mRemotePort = 0; + uint16_t mDiscriminator = 0; + uint32_t mSetupPINCode = 0; + uint16_t mIndex = 0; chip::ByteSpan mOperationalDataset; chip::ByteSpan mSSID; chip::ByteSpan mPassword; - char * mOnboardingPayload; - uint64_t mDiscoveryFilterCode; - char * mDiscoveryFilterInstanceName; + char * mOnboardingPayload = nullptr; + uint64_t mDiscoveryFilterCode = 0; + char * mDiscoveryFilterInstanceName = nullptr; - bool mDeviceIsICD; + bool mDeviceIsICD = false; uint8_t mRandomGeneratedICDSymmetricKey[chip::Crypto::kAES_CCM128_Key_Length]; // For unpair From 607a4a85128d5214ba5569db8a323cb1fdfaa869 Mon Sep 17 00:00:00 2001 From: Karsten Sperling <113487422+ksperling-apple@users.noreply.github.com> Date: Mon, 9 Sep 2024 17:42:41 +1200 Subject: [PATCH 38/42] Darwin: Snapshot nodeIDToDeviceMap correctly (#35476) --- src/darwin/Framework/CHIP/MTRDeviceController.mm | 16 +++++----------- .../CHIP/MTRDeviceController_Concrete.mm | 2 +- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm index 7eb76c4e4e17c3..021ada1852cf9c 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm @@ -364,13 +364,10 @@ - (void)suspend @synchronized(self) { _suspended = YES; - NSMutableArray * devicesToSuspend = [NSMutableArray array]; + NSArray * devicesToSuspend; { std::lock_guard lock(*self.deviceMapLock); - NSEnumerator * devices = [self.nodeIDToDeviceMap objectEnumerator]; - for (MTRDevice * device in devices) { - [devicesToSuspend addObject:device]; - } + devicesToSuspend = [self.nodeIDToDeviceMap objectEnumerator].allObjects; } for (MTRDevice * device in devicesToSuspend) { @@ -392,13 +389,10 @@ - (void)resume @synchronized(self) { _suspended = NO; - NSMutableArray * devicesToResume = [NSMutableArray array]; + NSArray * devicesToResume; { std::lock_guard lock(*self.deviceMapLock); - NSEnumerator * devices = [self.nodeIDToDeviceMap objectEnumerator]; - for (MTRDevice * device in devices) { - [devicesToResume addObject:device]; - } + devicesToResume = [self.nodeIDToDeviceMap objectEnumerator].allObjects; } for (MTRDevice * device in devicesToResume) { @@ -490,7 +484,7 @@ - (void)cleanupAfterStartup // devices before we start invalidating. MTR_LOG("%s: %@", __PRETTY_FUNCTION__, self); os_unfair_lock_lock(self.deviceMapLock); - NSEnumerator * devices = [_nodeIDToDeviceMap objectEnumerator]; + auto * devices = [self.nodeIDToDeviceMap objectEnumerator].allObjects; [_nodeIDToDeviceMap removeAllObjects]; os_unfair_lock_unlock(self.deviceMapLock); diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm index 4f19035f27da85..1edcb4928943a1 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm @@ -426,7 +426,7 @@ - (void)cleanupAfterStartup // devices before we start invalidating. MTR_LOG("%s: %@", __PRETTY_FUNCTION__, self); os_unfair_lock_lock(self.deviceMapLock); - NSEnumerator * devices = [self.nodeIDToDeviceMap objectEnumerator]; + auto * devices = [self.nodeIDToDeviceMap objectEnumerator].allObjects; [self.nodeIDToDeviceMap removeAllObjects]; os_unfair_lock_unlock(self.deviceMapLock); From bbc524865c1815e417a1df1fc7bc025f972d0db8 Mon Sep 17 00:00:00 2001 From: Nivi Sarkar <55898241+nivi-apple@users.noreply.github.com> Date: Mon, 9 Sep 2024 05:45:46 -0700 Subject: [PATCH 39/42] =?UTF-8?q?Add=20GetNextAction=20API=20so=20that=20a?= =?UTF-8?q?=20caller=20that=20might=20want=20to=20implement=20a=E2=80=A6?= =?UTF-8?q?=20(#35462)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add GetNextAction API so that a caller that might want to implement an event driven mechanism to drive the BDX transfer can get the next output event from the TransferSession on demand Currently we have the PollOutput API where the expectation is the caller needs to poll frequently for the next output event from the TransferSession which introduces a delay based on the poll interval in handling every single BDX message or transfer session event handled by the caller. * Update src/protocols/bdx/BdxTransferSession.h Co-authored-by: Boris Zbarsky * Address review comments * Apply suggestions from code review Co-authored-by: Boris Zbarsky * Restyled by clang-format --------- Co-authored-by: Boris Zbarsky Co-authored-by: Restyled.io --- src/protocols/bdx/BdxTransferSession.cpp | 5 +++++ src/protocols/bdx/BdxTransferSession.h | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/protocols/bdx/BdxTransferSession.cpp b/src/protocols/bdx/BdxTransferSession.cpp index 99588f0770a72e..0a513d7ea77460 100644 --- a/src/protocols/bdx/BdxTransferSession.cpp +++ b/src/protocols/bdx/BdxTransferSession.cpp @@ -134,6 +134,11 @@ void TransferSession::PollOutput(OutputEvent & event, System::Clock::Timestamp c mPendingOutput = OutputEventType::kNone; } +void TransferSession::GetNextAction(OutputEvent & event) +{ + PollOutput(event, System::SystemClock().GetMonotonicTimestamp()); +} + CHIP_ERROR TransferSession::StartTransfer(TransferRole role, const TransferInitData & initData, System::Clock::Timeout timeout) { VerifyOrReturnError(mState == TransferState::kUnitialized, CHIP_ERROR_INCORRECT_STATE); diff --git a/src/protocols/bdx/BdxTransferSession.h b/src/protocols/bdx/BdxTransferSession.h index ccd241e7fe508c..4a50e70fbb6c84 100644 --- a/src/protocols/bdx/BdxTransferSession.h +++ b/src/protocols/bdx/BdxTransferSession.h @@ -165,6 +165,25 @@ class DLL_EXPORT TransferSession */ void PollOutput(OutputEvent & event, System::Clock::Timestamp curTime); + /** + * @brief + * Gets the pending output event from the transfer session in the event param passed in by the caller. + * The output event may contain some data for the caller to act upon. If there is no pending output event, + * the caller will get an event of type OutputEventType::kNone. + * + * It is possible that consecutive calls to this method may emit different outputs depending on the state of the + * TransferSession object. The caller is generally expected to keep calling this method until it gets an event of type + * OutputEventType::kNone. + * + * If the output event type is kMsgToSend, the caller is expected to send the message immediately on the + * relevant exchange. In this case the BDX session timeout timer will start when GetNextAction is called. + * + * See OutputEventType for all possible output event types. + * + * @param event Reference to an OutputEvent struct that will be filled out with any pending output event data + */ + void GetNextAction(OutputEvent & event); + /** * @brief * Initializes the TransferSession object and prepares a TransferInit message (emitted via PollOutput()). From bbce050a50d7451821fa3fedec3e7f09ed44d987 Mon Sep 17 00:00:00 2001 From: Arkadiusz Bokowy Date: Mon, 9 Sep 2024 16:38:17 +0200 Subject: [PATCH 40/42] [Fabric-Sync] Do not use stdout with non-blocking asyncio (#35446) Wrapping stdout with StreamWriter leads to setting stdout stream to non-blocking. In consequence that parent process and all child processes have stdio in non-blocking mode, which is not a standard setup. This leads to random failures (e.g. Python's print might trow BlockinIOError exception). --- .../fabric-admin/scripts/fabric-sync-app.py | 63 +++++++------------ 1 file changed, 23 insertions(+), 40 deletions(-) diff --git a/examples/fabric-admin/scripts/fabric-sync-app.py b/examples/fabric-admin/scripts/fabric-sync-app.py index 2a8508231f8fa0..78e8f84f0e1523 100755 --- a/examples/fabric-admin/scripts/fabric-sync-app.py +++ b/examples/fabric-admin/scripts/fabric-sync-app.py @@ -20,30 +20,13 @@ import shutil import signal import sys +import typing from argparse import ArgumentParser from tempfile import TemporaryDirectory -async def asyncio_stdin() -> asyncio.StreamReader: - """Wrap sys.stdin in an asyncio StreamReader.""" - loop = asyncio.get_event_loop() - reader = asyncio.StreamReader() - protocol = asyncio.StreamReaderProtocol(reader) - await loop.connect_read_pipe(lambda: protocol, sys.stdin) - return reader - - -async def asyncio_stdout(file=sys.stdout) -> asyncio.StreamWriter: - """Wrap an IO stream in an asyncio StreamWriter.""" - loop = asyncio.get_event_loop() - transport, protocol = await loop.connect_write_pipe( - lambda: asyncio.streams.FlowControlMixin(loop=loop), - os.fdopen(file.fileno(), 'wb')) - return asyncio.streams.StreamWriter(transport, protocol, None, loop) - - async def forward_f(prefix: bytes, f_in: asyncio.StreamReader, - f_out: asyncio.StreamWriter, cb=None): + f_out: typing.BinaryIO, cb=None): """Forward f_in to f_out with a prefix attached. This function can optionally feed received lines to a callback function. @@ -54,9 +37,9 @@ async def forward_f(prefix: bytes, f_in: asyncio.StreamReader, break if cb is not None: cb(line) - f_out.write(prefix) - f_out.write(line) - await f_out.drain() + f_out.buffer.write(prefix) + f_out.buffer.write(line) + f_out.flush() async def forward_pipe(pipe_path: str, f_out: asyncio.StreamWriter): @@ -72,6 +55,7 @@ async def forward_pipe(pipe_path: str, f_out: asyncio.StreamWriter): data = os.read(fd, 1024) if data: f_out.write(data) + await f_out.drain() if not data: await asyncio.sleep(0.1) except BlockingIOError: @@ -80,13 +64,17 @@ async def forward_pipe(pipe_path: str, f_out: asyncio.StreamWriter): async def forward_stdin(f_out: asyncio.StreamWriter): """Forward stdin to f_out.""" - reader = await asyncio_stdin() + loop = asyncio.get_event_loop() + reader = asyncio.StreamReader() + protocol = asyncio.StreamReaderProtocol(reader) + await loop.connect_read_pipe(lambda: protocol, sys.stdin) while True: line = await reader.readline() if not line: # Exit on Ctrl-D (EOF). sys.exit(0) f_out.write(line) + await f_out.drain() class Subprocess: @@ -109,15 +97,9 @@ async def run(self): stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE) # Add the stdout and stderr processing to the event loop. - asyncio.create_task(forward_f( - self.tag, - self.p.stderr, - await asyncio_stdout(sys.stderr))) - asyncio.create_task(forward_f( - self.tag, - self.p.stdout, - await asyncio_stdout(sys.stdout), - cb=self._check_output)) + asyncio.create_task(forward_f(self.tag, self.p.stderr, sys.stderr)) + asyncio.create_task(forward_f(self.tag, self.p.stdout, sys.stdout, + cb=self._check_output)) async def send(self, message: str, expected_output: str = None, timeout: float = None): """Send a message to a process and optionally wait for a response.""" @@ -206,14 +188,6 @@ async def main(args): if pipe and not os.path.exists(pipe): os.mkfifo(pipe) - def terminate(signum, frame): - admin.terminate() - bridge.terminate() - sys.exit(0) - - signal.signal(signal.SIGINT, terminate) - signal.signal(signal.SIGTERM, terminate) - admin, bridge = await asyncio.gather( run_admin( args.app_admin, @@ -235,6 +209,15 @@ def terminate(signum, frame): passcode=args.passcode, )) + def terminate(): + admin.terminate() + bridge.terminate() + sys.exit(0) + + loop = asyncio.get_event_loop() + loop.add_signal_handler(signal.SIGINT, terminate) + loop.add_signal_handler(signal.SIGTERM, terminate) + # Wait a bit for apps to start. await asyncio.sleep(1) From 0c15ce93380fd2aaa92a3911c80b73420105c3eb Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Mon, 9 Sep 2024 11:26:23 -0400 Subject: [PATCH 41/42] Create a script and instructions to create an aarch64 sysroot via qemu (#35420) * Prepare making a sysroot via qemu, so we do not need a raspberry pi ready (even though this is MUCH slower) * Update gitignore * Rename file for clearer naming * Start adding some documentation on sysroot generation * Restyle and update the image to 22.04 since this is what we use today * Restyle * vm is a common word * Add helper info for mkpasswd existence * More help messages * More help and have auto-install because it is convenient * Restyle * More convenient text and help * More updates for friendlyness * Fix cloudinit schema * Allocate more virtual CPUs as some things run slightly faster (a bit over 10% faster boot for me) * Created a script to upload the cipd package * Script cleanup and readme update * User friendly progress and output * Updated gitignore and script for nicer content * Script cleanup for symlinks (goes from 7GB to 1.1GB) * More updates to the rsync execution options * Single rsync invokation, so that safe symlinks works better * Restyle * Update tag to be unique, since I was missing a symlink before and that seemed more broken * Update integrations/docker/images/stage-1/chip-build-crosscompile/start-sysroot-vm.sh Co-authored-by: Kiel Oleson * Restyle * Update start-sysroot-vm.sh Update text about very weak password. --------- Co-authored-by: Andrei Litvin Co-authored-by: Kiel Oleson --- .github/.wordlist.txt | 1 + .../chip-build-crosscompile/.gitignore | 7 + .../stage-1/chip-build-crosscompile/README.md | 66 +++++- .../start-sysroot-vm.sh | 217 ++++++++++++++++++ .../upload-cidp-package.sh | 61 +++++ 5 files changed, 341 insertions(+), 11 deletions(-) create mode 100755 integrations/docker/images/stage-1/chip-build-crosscompile/start-sysroot-vm.sh create mode 100755 integrations/docker/images/stage-1/chip-build-crosscompile/upload-cidp-package.sh diff --git a/.github/.wordlist.txt b/.github/.wordlist.txt index 9cb24bcf4d8b0b..c84d4038352101 100644 --- a/.github/.wordlist.txt +++ b/.github/.wordlist.txt @@ -1532,6 +1532,7 @@ virtualenv visualstudio vlatest VLEDs +vm vn vnc vous diff --git a/integrations/docker/images/stage-1/chip-build-crosscompile/.gitignore b/integrations/docker/images/stage-1/chip-build-crosscompile/.gitignore index 37e0c7aa5d67ba..e4e6d2a90dfcbe 100644 --- a/integrations/docker/images/stage-1/chip-build-crosscompile/.gitignore +++ b/integrations/docker/images/stage-1/chip-build-crosscompile/.gitignore @@ -1,3 +1,10 @@ .cipd +cidata.iso +cipd.yaml ensure_file.txt +meta-data +sysrootsrv.img ubuntu-21.04-aarch64-sysroot.tar.xz +ubuntu-24.04-aarch64-sysroot +ubuntu-24.04-server-cloudimg-arm64.img +user-data diff --git a/integrations/docker/images/stage-1/chip-build-crosscompile/README.md b/integrations/docker/images/stage-1/chip-build-crosscompile/README.md index d27fc2fe601233..4d97a7c81a6210 100644 --- a/integrations/docker/images/stage-1/chip-build-crosscompile/README.md +++ b/integrations/docker/images/stage-1/chip-build-crosscompile/README.md @@ -3,11 +3,55 @@ This image adds cross-compilation support files (a suitable sysroot) on top of the regular linux chip-build image. -The build assumes a file named `ubuntu-21.04-aarch64-sysroot.tar.xz` exists in +The build assumes a file named `ubuntu-22.04-aarch64-sysroot.tar.xz` exists in the current directory. This can generally be manually built using an existing Raspberry Pi device (or equivalent qemu) and a convenience copy was created in CIPD +#### Creating a Sysroot (qemu virtual emulator) + +NOTE: this approach is slower due to emulation usage, however has the advantage +of not requiring separate hardware. + +Ensure `qemu` and `virt-install` prerequisites are met: + +``` +apt-get install qemu-system-arm virtinst libvirt-daemon +``` + +Start up the sysroot virtual machine. This will be named `sysrootsrv`: + +``` +./start-sysroot-vm.sh +``` + +Connect to a console to monitor progress. The VM is configured to pre-install +packages based on CHIP BUILDING.md documentation plus any additional packages. + +``` +virsh console sysrootsrv +``` + +Once installation completed, you can also login as `ubuntu/1234` or use +`ssh ubuntu@localhost -p 5555` + +The current image is based on Ubuntu 24.04, so you can create an image via: + +``` +rsync -avL -e 'ssh -p 5555' ubuntu@localhost:/lib ubuntu-24.04-aarch64-sysroot +rsync -avL -e 'ssh -p 5555' ubuntu@localhost:/usr/lib ubuntu-24.04-aarch64-sysroot/usr +rsync -avL -e 'ssh -p 5555' ubuntu@localhost:/usr/include ubuntu-24.04-aarch64-sysroot/usr +``` + +At this point you have a sysroot in `ubuntu-24.04-aarch64-sysroot` + +To create/upload a CIPD package tagged with the current date, a script is +provided: + +``` +upload-cipd-package.sh +``` + #### Creating a Sysroot Start with a fresh Raspberry PI image: @@ -15,16 +59,16 @@ Start with a fresh Raspberry PI image: - Use the Raspberry pi imager from https://www.raspberrypi.org/software/ - Follow installation instructions from the CHIP BUILDING.md document. Generally this includes: - - Use Ubuntu 21.04 server 64 bit server image + - Use Ubuntu 22.04 server 64 bit server image - Install required compile dependencies via `apt-get`. You may skip installing git and python3 dependencies to save some image size Generate a sysroot. You can do this locally (slow due to SD performance): ``` -rsync -avL /lib ubuntu-21.04-aarch64-sysroot/ -rsync -avL /usr/lib ubuntu-21.04-aarch64-sysroot/usr -rsync -avL /usr/include ubuntu-21.04-aarch64-sysroot/usr +rsync -avL /lib ubuntu-22.04-aarch64-sysroot/ +rsync -avL /usr/lib ubuntu-22.04-aarch64-sysroot/usr +rsync -avL /usr/include ubuntu-22.04-aarch64-sysroot/usr ``` or you can copy directly to your host machine via @@ -33,9 +77,9 @@ or you can copy directly to your host machine via export PI="ip-of-raspberry-pi" ssh-copy-id ubuntu@$PI -rsync -avL ubuntu@$PI:/lib ubuntu-21.04-aarch64-sysroot -rsync -avL ubuntu@$PI:/usr/lib ubuntu-21.04-aarch64-sysroot/usr -rsync -avL ubuntu@$PI:/include/lib ubuntu-21.04-aarch64-sysroot/usr +rsync -avL ubuntu@$PI:/lib ubuntu-22.04-aarch64-sysroot +rsync -avL ubuntu@$PI:/usr/lib ubuntu-22.04-aarch64-sysroot/usr +rsync -avL ubuntu@$PI:/usr/include ubuntu-22.04-aarch64-sysroot/usr ``` NOTE: in the future, if creating a 32-bit image (not covered by this docker @@ -47,7 +91,7 @@ image yet), the following symlinks are required: Once the sysroot is on the host machine, create the corresponding `tar.xz` file: ``` -tar cvfJ ubuntu-21.04-aarch64-sysroot.tar.xz ubuntu-21.04-aarch64-sysroot +tar cvfJ ubuntu-22.04-aarch64-sysroot.tar.xz ubuntu-22.04-aarch64-sysroot ``` #### CIPD image @@ -55,12 +99,12 @@ tar cvfJ ubuntu-21.04-aarch64-sysroot.tar.xz ubuntu-21.04-aarch64-sysroot CIPD image is provided as a convenience to avoid the need to spend time rebuilding a sysroot. It is located at: -https://chrome-infra-packages.appspot.com/p/experimental/matter/sysroot/ubuntu-21.04-aarch64/+/ +https://chrome-infra-packages.appspot.com/p/experimental/matter/sysroot/ubuntu-22.04-aarch64/+/ and can be downloaded using the `cipd` script from [depot_tools](https://dev.chromium.org/developers/how-tos/depottools): ``` -echo 'experimental/matter/sysroot/ubuntu-21.04-aarch64 latest' > ensure_file.txt +echo 'experimental/matter/sysroot/ubuntu-22.04-aarch64 latest' > ensure_file.txt cipd ensure -ensure-file ensure_file.txt -root ./ ``` diff --git a/integrations/docker/images/stage-1/chip-build-crosscompile/start-sysroot-vm.sh b/integrations/docker/images/stage-1/chip-build-crosscompile/start-sysroot-vm.sh new file mode 100755 index 00000000000000..fb56c433c20666 --- /dev/null +++ b/integrations/docker/images/stage-1/chip-build-crosscompile/start-sysroot-vm.sh @@ -0,0 +1,217 @@ +#!/usr/bin/env bash + +# This script is intended to build a SYSROOT that can be used as a base to cross-compile +# CHIP for aarch64 (i.e. that runs on a RaspberryPi) from a amd64 linux machine + +set -e + +start_console=1 + +while getopts "hin" opt; do + case $opt in + h) + echo "Usage: $0 [-h] [-i]" + echo " -h Displays this help message" + echo " -i Attempt to 'sudo apt-get install' required packages" + echo " -n Do not start a console after vm is created" + exit 0 + ;; + i) + echo "Installing required packages ..." + sudo apt-get install \ + genisoimage \ + libvirt-daemon \ + qemu-system-arm \ + qemu-utils \ + virtinst \ + whois \ + ; + ;; + n) + echo "Console will not be started after virtual machine startup." + start_console=0 + ;; + esac +done + +if ! which qemu-system-aarch64 >/dev/null; then + echo "Cannot find 'qemu-system-aarch64'. Did you 'sudo apt-get install qemu-system-arm' ?" + exit 1 +fi + +if ! which virt-install >/dev/null; then + echo "Cannot find 'virt-install'. Did you 'sudo apt-get install virtinst' ?" + exit 1 +fi + +if ! [ -f /usr/sbin/libvirtd ]; then + echo "Cannot find 'virt-install'. Did you 'sudo apt-get install libvirt-daemon' ?" + exit 1 +fi + +if ! which mkpasswd >/dev/null; then + echo "Cannot find 'mkpasswd'. Did you 'sudo apt-get install whois' ?" + exit 1 +fi + +if ! which qemu-img >/dev/null; then + echo "Cannot find 'qemu-img'. Did you 'sudo apt-get install qemu-utis' ?" + exit 1 +fi + +if ! which genisoimage >/dev/null; then + echo "Cannot find 'genisoimage'. Did you 'sudo apt-get install genisoimage' ?" + exit 1 +fi + +CLOUD_IMAGE_URL="https://cloud-images.ubuntu.com/releases/24.04/release-20240821/ubuntu-24.04-server-cloudimg-arm64.img" +CLOUD_IMAGE_FILE=$(basename "$CLOUD_IMAGE_URL") + +if ! [ -f "$CLOUD_IMAGE_FILE" ]; then + echo "Image $CLOUD_IMAGE_FILE does not exist. Downloading ..." + wget "$CLOUD_IMAGE_URL" +else + echo "Using existing $CLOUD_IMAGE_FILE ..." +fi + +rm -f sysrootsrv.img +qemu-img create -b "$CLOUD_IMAGE_FILE" -f qcow2 -F qcow2 sysrootsrv.img 10G + +# local user allowed to SSH in to the host directly without a password +SSH_KEY=$(cat ~/.ssh/id_rsa.pub) + +# set a login password. +# NOTE: this is a VERY WEAK password, however this should be ok because +# this is a local and temporary virtual machine that is NOT accessible +# anywhere except through the redirected port 5555 on localhost or +# via "virsh console" (which is the primary purpose for it: debugging) +# +# This is NOT meant as a persistent vm and should be deleted after use. +PASSWORD_HASH=$(mkpasswd 1234) + +# Create cloud init files +cat >user-data <>meta-data +echo 'local-hostname: sysrootsrv' >>meta-data + +genisoimage -output cidata.iso -V cidata -r -J user-data meta-data + +# NOTE: direct qemu-system-aarch64 can also be used, however that requires +# having QEMU_EFI.fd available (and location for that varies). Using +# virt-install uses extra packages/complexity however also allows +# the use of virsh for some operations. +# +# truncate -s 64m varstore.img +# truncate -s 64m efi.img +# dd if=/usr/share/qemu-efi-aarch64/QEMU_EFI.fd of=efi.img conv=notrunc +# +# # QEMU console exit is `CTRL + a, x` +# qemu-system-aarch64 \ +# -m 8192 \ +# -M virt \ +# -cpu max \ +# -nographic \ +# -drive if=pflash,format=raw,file=efi.img,readonly=on \ +# -drive if=pflash,format=raw,file=varstore.img \ +# -drive if=none,file=sysrootsrv.img,id=hd0 \ +# -device virtio-blk-device,drive=hd0 \ +# -cdrom cidata.iso \ +# -netdev user,id=netdev0,hostfwd=tcp::5555-:22 \ +# -device virtio-net-pci,netdev=netdev0 \ +# ; # last line + +# EXAMPLE COMMANDS: +# +# View generated image: +# virsh dumpxml sysrootsrv +# +# Get a console and login (exit with `CTRL + ]`) +# virsh console sysrootsrv +# +# Delete: +# virsh destroy sysrootsrv && virsh undefine --nvram sysrootsrv +virt-install \ + --name sysrootsrv \ + --memory 8192 \ + --arch aarch64 \ + --vcpus 8 \ + --import \ + --disk path=sysrootsrv.img,format=qcow2 \ + --disk path=cidata.iso,device=cdrom \ + --os-variant=ubuntu24.04 \ + --network=user \ + --xml "xpath.delete=./devices/input[@bus = 'usb']" \ + --noautoconsole \ + ;# last-line + +# Allow ssh via: +# ssh ubuntu@localhost -p 5555 +virsh qemu-monitor-command --hmp sysrootsrv 'hostfwd_add ::5555-:22' + +echo -e "\e[32mDONE\e[0m" +echo "" +echo "To delete the VM use:" +echo "" +echo " virsh destroy sysrootsrv && virsh undefine --nvram sysrootsrv" +echo "" +echo "VM will auto-install packages via cloud-init. " +echo "Look out for a message of 'Initial installation DONE' in the console. " +echo "" + +if [ "$start_console" -eq 1 ]; then + echo "Delaying console start to have final message visible." + echo "Don't worry, vm startup takes a while anyway..." + sleep 10 + echo "Starting console ..." + virsh console sysrootsrv +else + echo "Console is not auto-started." + echo "To monitor VM startup/status you can open a console using: " + echo "" + echo " virsh console sysrootsrv" + echo "" + echo "And you can exit that console using 'CTRL + ]'" +fi diff --git a/integrations/docker/images/stage-1/chip-build-crosscompile/upload-cidp-package.sh b/integrations/docker/images/stage-1/chip-build-crosscompile/upload-cidp-package.sh new file mode 100755 index 00000000000000..eb668bb97e025d --- /dev/null +++ b/integrations/docker/images/stage-1/chip-build-crosscompile/upload-cidp-package.sh @@ -0,0 +1,61 @@ +#!/usr/bin/env bash + +# This script is intended to be run post-install (NOTE: install takes a LONG time) +# of start-sysroot-vm. + +set -e + +OUTPUT_DIR=ubuntu-24.04-aarch64-sysroot +PACKAGE=experimental/matter/sysroot/ubuntu-24.04-aarch64 + +echo "Copying a sysroot in $OUTPUT_DIR" +mkdir -p "$OUTPUT_DIR" + +RSYNC_RSH="ssh -p 5555" + +echo "COPYING from VM (ubuntu@localhost on port 5555) ..." +rsync \ + --archive \ + --human-readable \ + --links \ + --delete-during \ + --delete-excluded \ + --safe-links \ + --info=progress2 \ + --info=name0 \ + --exclude='lib/aarch64-linux-gnu/dri' \ + --exclude='lib/firmware' \ + --exclude='lib/git-core' \ + --exclude='lib/modules' \ + --exclude='lib/ssl/private' \ + --exclude='lib/systemd' \ + ubuntu@localhost:/usr/include \ + ubuntu@localhost:/usr/lib \ + "$OUTPUT_DIR/usr" + +# Ubuntu 24.04 lib is just a symlink +rm -f "$OUTPUT_DIR/lib" +ln -s usr/lib "$OUTPUT_DIR/lib" + +echo "Creating cipd definition" +cat >cipd.yaml < Date: Mon, 9 Sep 2024 11:35:42 -0400 Subject: [PATCH 42/42] Remove LocalizationConfiguration and TimeFormatLocalization from most samples (#35450) * Remove unnecessary clusters from most samples * Regen ZAP * Remove on/off server from chef light switch * Fix test_zap_file_parser.py --- ...p_rootnode_dimmablelight_bCwGYSDpoe.matter | 76 ----- ...noip_rootnode_dimmablelight_bCwGYSDpoe.zap | 164 ---------- ...ootnode_airqualitysensor_e63187f6c9.matter | 74 ----- .../rootnode_airqualitysensor_e63187f6c9.zap | 132 -------- ...ootnode_basicvideoplayer_0ff86e943b.matter | 24 -- .../rootnode_basicvideoplayer_0ff86e943b.zap | 74 ----- .../rootnode_contactsensor_lFAGG1bfRO.matter | 76 ----- .../rootnode_contactsensor_lFAGG1bfRO.zap | 164 ---------- .../rootnode_dimmablelight_bCwGYSDpoe.matter | 76 ----- .../rootnode_dimmablelight_bCwGYSDpoe.zap | 164 ---------- ...tnode_dimmablepluginunit_f8a9a0b9d4.matter | 74 ----- ...rootnode_dimmablepluginunit_f8a9a0b9d4.zap | 132 -------- .../rootnode_dishwasher_cc105034fe.matter | 80 ----- .../rootnode_dishwasher_cc105034fe.zap | 228 -------------- .../rootnode_doorlock_aNKYAreMXE.matter | 76 ----- .../devices/rootnode_doorlock_aNKYAreMXE.zap | 164 ---------- ...tnode_extendedcolorlight_8lcaaYJVAa.matter | 76 ----- ...rootnode_extendedcolorlight_8lcaaYJVAa.zap | 164 ---------- .../devices/rootnode_fan_7N2TobIlOX.matter | 77 ----- .../chef/devices/rootnode_fan_7N2TobIlOX.zap | 180 ----------- .../rootnode_flowsensor_1zVxHedlaV.matter | 76 ----- .../rootnode_flowsensor_1zVxHedlaV.zap | 164 ---------- ...tnode_heatingcoolingunit_ncdGai1E5a.matter | 76 ----- ...rootnode_heatingcoolingunit_ncdGai1E5a.zap | 164 ---------- .../rootnode_humiditysensor_Xyj4gda6Hb.matter | 76 ----- .../rootnode_humiditysensor_Xyj4gda6Hb.zap | 164 ---------- .../rootnode_laundrywasher_fb10d238c8.matter | 80 ----- .../rootnode_laundrywasher_fb10d238c8.zap | 228 -------------- .../rootnode_lightsensor_lZQycTFcJK.matter | 76 ----- .../rootnode_lightsensor_lZQycTFcJK.zap | 164 ---------- ...rootnode_occupancysensor_iHyVgifZuo.matter | 76 ----- .../rootnode_occupancysensor_iHyVgifZuo.zap | 164 ---------- .../rootnode_onofflight_bbs1b7IaOV.matter | 76 ----- .../rootnode_onofflight_bbs1b7IaOV.zap | 166 +--------- .../rootnode_onofflight_samplemei.matter | 76 ----- .../devices/rootnode_onofflight_samplemei.zap | 164 ---------- ...ootnode_onofflightswitch_FsPlMr090Q.matter | 161 ---------- .../rootnode_onofflightswitch_FsPlMr090Q.zap | 298 +----------------- ...rootnode_onoffpluginunit_Wtf8ss5EBY.matter | 76 ----- .../rootnode_onoffpluginunit_Wtf8ss5EBY.zap | 164 ---------- .../rootnode_pressuresensor_s0qC9wLH4k.matter | 76 ----- .../rootnode_pressuresensor_s0qC9wLH4k.zap | 164 ---------- .../devices/rootnode_pump_5f904818cc.matter | 80 ----- .../chef/devices/rootnode_pump_5f904818cc.zap | 228 -------------- .../devices/rootnode_pump_a811bb33a0.matter | 80 ----- .../chef/devices/rootnode_pump_a811bb33a0.zap | 228 -------------- ...eraturecontrolledcabinet_ffdb696680.matter | 80 ----- ...emperaturecontrolledcabinet_ffdb696680.zap | 228 -------------- .../rootnode_speaker_RpzeXdimqA.matter | 76 ----- .../devices/rootnode_speaker_RpzeXdimqA.zap | 164 ---------- ...otnode_temperaturesensor_Qy1zkNW7c3.matter | 76 ----- .../rootnode_temperaturesensor_Qy1zkNW7c3.zap | 164 ---------- ...otnode_waterleakdetector_0b067acfa3.matter | 28 -- .../rootnode_waterleakdetector_0b067acfa3.zap | 138 -------- .../rootnode_windowcovering_RLCxaGi9Yx.matter | 76 ----- .../rootnode_windowcovering_RLCxaGi9Yx.zap | 164 ---------- examples/chef/devices/template.zap | 138 -------- examples/chef/kvs1 | 7 + .../test_files/sample_zap_file.zap | 164 ---------- .../test_files/sample_zap_file_meta.yaml | 6 - .../contact-sensor-app.matter | 76 ----- .../contact-sensor-app.zap | 164 ---------- .../dishwasher-common/dishwasher-app.matter | 80 ----- .../dishwasher-common/dishwasher-app.zap | 228 -------------- .../nxp/zap/laundry-washer-app.matter | 82 ----- .../nxp/zap/laundry-washer-app.zap | 260 --------------- .../light-switch-app.matter | 76 ----- .../light-switch-common/light-switch-app.zap | 164 ---------- .../lighting-common/lighting-app.matter | 76 ----- .../lighting-common/lighting-app.zap | 166 +--------- .../data_model/lighting-app-ethernet.matter | 76 ----- .../data_model/lighting-app-ethernet.zap | 164 ---------- .../data_model/lighting-app-thread.matter | 76 ----- .../data_model/lighting-app-thread.zap | 164 ---------- .../data_model/lighting-app-wifi.matter | 76 ----- .../data_model/lighting-app-wifi.zap | 164 ---------- .../lighting-common/lighting-app.matter | 76 ----- .../lighting-common/lighting-app.zap | 164 ---------- .../data_model/lighting-thread-app.matter | 76 ----- .../silabs/data_model/lighting-thread-app.zap | 164 ---------- .../data_model/lighting-wifi-app.matter | 76 ----- .../silabs/data_model/lighting-wifi-app.zap | 164 ---------- examples/lock-app/lock-common/lock-app.matter | 28 -- examples/lock-app/lock-common/lock-app.zap | 138 -------- .../network-manager-app.zap | 2 +- .../ota-provider-app.matter | 76 ----- .../ota-provider-common/ota-provider-app.zap | 164 ---------- .../ota-requestor-app.matter | 80 ----- .../ota-requestor-app.zap | 228 -------------- .../refrigerator-app.matter | 80 ----- .../refrigerator-common/refrigerator-app.zap | 228 -------------- .../smoke-co-alarm-app.matter | 76 ----- .../smoke-co-alarm-app.zap | 164 ---------- .../temperature-measurement.matter | 76 ----- .../temperature-measurement.zap | 164 ---------- .../thread-br-common/thread-br-app.matter | 76 ----- .../thread-br-common/thread-br-app.zap | 164 ---------- examples/window-app/common/window-app.matter | 84 ----- examples/window-app/common/window-app.zap | 292 ----------------- 99 files changed, 11 insertions(+), 12250 deletions(-) create mode 100644 examples/chef/kvs1 diff --git a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter index b837d4bbb6423a..1d27e85467bc08 100644 --- a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter @@ -988,67 +988,6 @@ cluster OtaSoftwareUpdateRequestor = 42 { 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; -} - /** This cluster is used to manage global aspects of the Commissioning flow. */ cluster GeneralCommissioning = 48 { revision 1; // NOTE: Default/not specifically set @@ -2047,21 +1986,6 @@ endpoint 0 { handle command AnnounceOTAProvider; } - server cluster LocalizationConfiguration { - callback attribute activeLocale; - 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 GeneralCommissioning { ram attribute breadcrumb default = 0x0000000000000000; callback attribute basicCommissioningInfo; diff --git a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.zap b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.zap index ec8d9f537cc5ed..1636d8aab6b119 100644 --- a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.zap +++ b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.zap @@ -929,170 +929,6 @@ } ] }, - { - "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": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "SupportedLocales", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "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": "General Commissioning", "code": 48, diff --git a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter index ef127a4ba46cde..ee845c7c6cffda 100644 --- a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter +++ b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter @@ -693,67 +693,6 @@ cluster OtaSoftwareUpdateRequestor = 42 { 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; -} - /** This cluster is used to describe the configuration and capabilities of a physical power source that provides power to the Node. */ cluster PowerSource = 47 { revision 1; // NOTE: Default/not specifically set @@ -2474,19 +2413,6 @@ endpoint 0 { handle command AnnounceOTAProvider; } - server cluster LocalizationConfiguration { - ram attribute activeLocale; - callback attribute supportedLocales; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - - server cluster TimeFormatLocalization { - persist attribute hourFormat default = 0; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - server cluster GeneralCommissioning { ram attribute breadcrumb default = 0x0000000000000000; callback attribute basicCommissioningInfo; diff --git a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.zap b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.zap index 535aa424e1d2a7..7154d9edf4c91f 100644 --- a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.zap +++ b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.zap @@ -929,138 +929,6 @@ } ] }, - { - "name": "Localization Configuration", - "code": 43, - "mfgCode": null, - "define": "LOCALIZATION_CONFIGURATION_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "ActiveLocale", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "SupportedLocales", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "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": "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, diff --git a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter index 60e29aeeb5f96b..bded4104eae359 100644 --- a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter +++ b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter @@ -890,23 +890,6 @@ cluster OtaSoftwareUpdateRequestor = 42 { 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; -} - /** This cluster is used to manage global aspects of the Commissioning flow. */ cluster GeneralCommissioning = 48 { revision 1; // NOTE: Default/not specifically set @@ -2371,13 +2354,6 @@ endpoint 0 { handle command AnnounceOTAProvider; } - server cluster LocalizationConfiguration { - ram attribute activeLocale; - callback attribute supportedLocales; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - server cluster GeneralCommissioning { ram attribute breadcrumb default = 0x0000000000000000; callback attribute basicCommissioningInfo; diff --git a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.zap b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.zap index 8a6e75210fa6b5..43d2e0e15b5146 100644 --- a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.zap +++ b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.zap @@ -929,80 +929,6 @@ } ] }, - { - "name": "Localization Configuration", - "code": 43, - "mfgCode": null, - "define": "LOCALIZATION_CONFIGURATION_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "ActiveLocale", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "SupportedLocales", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "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, diff --git a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter index 3e3a4eaa84963f..fd8ddbe72bc1ca 100644 --- a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter +++ b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter @@ -791,67 +791,6 @@ cluster OtaSoftwareUpdateRequestor = 42 { 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; -} - /** This cluster is used to describe the configuration and capabilities of a physical power source that provides power to the Node. */ cluster PowerSource = 47 { revision 1; // NOTE: Default/not specifically set @@ -1957,21 +1896,6 @@ endpoint 0 { handle command AnnounceOTAProvider; } - server cluster LocalizationConfiguration { - ram attribute activeLocale; - 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 GeneralCommissioning { ram attribute breadcrumb default = 0x0000000000000000; callback attribute basicCommissioningInfo; diff --git a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.zap b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.zap index d050409f3625c6..78408b145c9317 100644 --- a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.zap +++ b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.zap @@ -929,170 +929,6 @@ } ] }, - { - "name": "Localization Configuration", - "code": 43, - "mfgCode": null, - "define": "LOCALIZATION_CONFIGURATION_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "ActiveLocale", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "SupportedLocales", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "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": "General Commissioning", "code": 48, diff --git a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter index 4c659dcce73dee..b6ca20a4a986e9 100644 --- a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter @@ -988,67 +988,6 @@ cluster OtaSoftwareUpdateRequestor = 42 { 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; -} - /** This cluster is used to manage global aspects of the Commissioning flow. */ cluster GeneralCommissioning = 48 { revision 1; // NOTE: Default/not specifically set @@ -1944,21 +1883,6 @@ endpoint 0 { handle command AnnounceOTAProvider; } - server cluster LocalizationConfiguration { - ram attribute activeLocale; - 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 GeneralCommissioning { ram attribute breadcrumb default = 0x0000000000000000; callback attribute basicCommissioningInfo; diff --git a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.zap b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.zap index 9b755037ba1aa6..fc6b2773a67e86 100644 --- a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.zap +++ b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.zap @@ -961,170 +961,6 @@ } ] }, - { - "name": "Localization Configuration", - "code": 43, - "mfgCode": null, - "define": "LOCALIZATION_CONFIGURATION_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "ActiveLocale", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "SupportedLocales", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "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": "General Commissioning", "code": 48, diff --git a/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.matter b/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.matter index 92b02371029b94..564154ce2112c6 100644 --- a/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.matter +++ b/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.matter @@ -988,67 +988,6 @@ cluster OtaSoftwareUpdateRequestor = 42 { 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; -} - /** This cluster is used to manage global aspects of the Commissioning flow. */ cluster GeneralCommissioning = 48 { revision 1; // NOTE: Default/not specifically set @@ -2098,19 +2037,6 @@ endpoint 0 { handle command AnnounceOTAProvider; } - server cluster LocalizationConfiguration { - ram attribute activeLocale; - callback attribute supportedLocales; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - - server cluster TimeFormatLocalization { - persist attribute hourFormat default = 0; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - server cluster GeneralCommissioning { ram attribute breadcrumb default = 0x0000000000000000; callback attribute basicCommissioningInfo; diff --git a/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.zap b/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.zap index 94d7fb252c2d68..09dfe991518468 100644 --- a/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.zap +++ b/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.zap @@ -929,138 +929,6 @@ } ] }, - { - "name": "Localization Configuration", - "code": 43, - "mfgCode": null, - "define": "LOCALIZATION_CONFIGURATION_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "ActiveLocale", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "SupportedLocales", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "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": "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, diff --git a/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter b/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter index 07232aa02be8e1..9a567896dfdd24 100644 --- a/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter +++ b/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter @@ -539,67 +539,6 @@ cluster BasicInformation = 40 { command MfgSpecificPing(): DefaultSuccess = 0; } -/** Nodes should be expected to be deployed to any and all regions of the world. These global regions - may have differing common languages, units of measurements, and numerical formatting - standards. As such, Nodes that visually or audibly convey information need a mechanism by which - they can be configured to use a user’s preferred language, units, etc */ -cluster LocalizationConfiguration = 43 { - revision 1; // NOTE: Default/not specifically set - - attribute access(write: manage) char_string<35> activeLocale = 0; - readonly attribute char_string supportedLocales[] = 1; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; -} - -/** 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 @@ -1499,25 +1438,6 @@ endpoint 0 { ram attribute clusterRevision default = 3; } - server cluster LocalizationConfiguration { - persist attribute activeLocale default = "en-US"; - callback attribute supportedLocales; - callback attribute generatedCommandList; - callback attribute acceptedCommandList; - callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - - server cluster TimeFormatLocalization { - persist attribute hourFormat default = 0; - callback attribute generatedCommandList; - callback attribute acceptedCommandList; - callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - server cluster UnitLocalization { persist attribute temperatureUnit default = 0; callback attribute generatedCommandList; diff --git a/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap b/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap index 770fe6edaf16d3..e0ee90ac36fc3b 100644 --- a/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap +++ b/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap @@ -958,234 +958,6 @@ } ] }, - { - "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": "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": "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": "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": "Unit Localization", "code": 45, diff --git a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter index 2b27a22610f7b4..fc6ef7614fc562 100644 --- a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter +++ b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter @@ -693,67 +693,6 @@ cluster OtaSoftwareUpdateRequestor = 42 { 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; -} - /** This cluster is used to describe the configuration and capabilities of a physical power source that provides power to the Node. */ cluster PowerSource = 47 { revision 1; // NOTE: Default/not specifically set @@ -2493,21 +2432,6 @@ endpoint 0 { handle command AnnounceOTAProvider; } - server cluster LocalizationConfiguration { - ram attribute activeLocale; - 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 GeneralCommissioning { ram attribute breadcrumb default = 0x0000000000000000; callback attribute basicCommissioningInfo; diff --git a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.zap b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.zap index 50e1a4bf1da25c..a08fcd9f2f02b7 100644 --- a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.zap +++ b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.zap @@ -929,170 +929,6 @@ } ] }, - { - "name": "Localization Configuration", - "code": 43, - "mfgCode": null, - "define": "LOCALIZATION_CONFIGURATION_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "ActiveLocale", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "SupportedLocales", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "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": "General Commissioning", "code": 48, diff --git a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter index 265dc262215921..70713aa72d3a44 100644 --- a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter +++ b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter @@ -988,67 +988,6 @@ cluster OtaSoftwareUpdateRequestor = 42 { 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; -} - /** This cluster is used to manage global aspects of the Commissioning flow. */ cluster GeneralCommissioning = 48 { revision 1; // NOTE: Default/not specifically set @@ -2206,21 +2145,6 @@ endpoint 0 { handle command AnnounceOTAProvider; } - server cluster LocalizationConfiguration { - ram attribute activeLocale; - 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 GeneralCommissioning { ram attribute breadcrumb default = 0x0000000000000000; callback attribute basicCommissioningInfo; diff --git a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.zap b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.zap index 308b192c368ba9..5cfcfdfa3a27a8 100644 --- a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.zap +++ b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.zap @@ -929,170 +929,6 @@ } ] }, - { - "name": "Localization Configuration", - "code": 43, - "mfgCode": null, - "define": "LOCALIZATION_CONFIGURATION_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "ActiveLocale", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "SupportedLocales", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "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": "General Commissioning", "code": 48, diff --git a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter index 19e0d8a149ea9b..1d3ab9d65ac6ad 100644 --- a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter +++ b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter @@ -770,67 +770,6 @@ cluster OtaSoftwareUpdateRequestor = 42 { 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; -} - /** This cluster is used to manage global aspects of the Commissioning flow. */ cluster GeneralCommissioning = 48 { revision 1; // NOTE: Default/not specifically set @@ -1742,22 +1681,6 @@ endpoint 0 { handle command AnnounceOTAProvider; } - server cluster LocalizationConfiguration { - ram attribute activeLocale; - callback attribute supportedLocales; - callback attribute attributeList; - 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 GeneralCommissioning { ram attribute breadcrumb default = 0x0000000000000000; callback attribute basicCommissioningInfo; diff --git a/examples/chef/devices/rootnode_fan_7N2TobIlOX.zap b/examples/chef/devices/rootnode_fan_7N2TobIlOX.zap index 29c2139fd0a09f..2ee1ba966b139a 100644 --- a/examples/chef/devices/rootnode_fan_7N2TobIlOX.zap +++ b/examples/chef/devices/rootnode_fan_7N2TobIlOX.zap @@ -929,186 +929,6 @@ } ] }, - { - "name": "Localization Configuration", - "code": 43, - "mfgCode": null, - "define": "LOCALIZATION_CONFIGURATION_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "ActiveLocale", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "SupportedLocales", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "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": "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": "General Commissioning", "code": 48, diff --git a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter index eb578e77f624d1..522000c18f2b44 100644 --- a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter +++ b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter @@ -791,67 +791,6 @@ cluster OtaSoftwareUpdateRequestor = 42 { 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; -} - /** This cluster is used to manage global aspects of the Commissioning flow. */ cluster GeneralCommissioning = 48 { revision 1; // NOTE: Default/not specifically set @@ -1697,21 +1636,6 @@ endpoint 0 { handle command AnnounceOTAProvider; } - server cluster LocalizationConfiguration { - ram attribute activeLocale; - 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 GeneralCommissioning { ram attribute breadcrumb default = 0x0000000000000000; callback attribute basicCommissioningInfo; diff --git a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.zap b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.zap index 09593e5b109f30..3974dabbc27d78 100644 --- a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.zap +++ b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.zap @@ -929,170 +929,6 @@ } ] }, - { - "name": "Localization Configuration", - "code": 43, - "mfgCode": null, - "define": "LOCALIZATION_CONFIGURATION_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "ActiveLocale", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "SupportedLocales", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "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": "General Commissioning", "code": 48, diff --git a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter index 84675efc397ef9..6313ced446ae52 100644 --- a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter +++ b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter @@ -988,67 +988,6 @@ cluster OtaSoftwareUpdateRequestor = 42 { 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; -} - /** This cluster is used to manage global aspects of the Commissioning flow. */ cluster GeneralCommissioning = 48 { revision 1; // NOTE: Default/not specifically set @@ -2315,21 +2254,6 @@ endpoint 0 { handle command AnnounceOTAProvider; } - server cluster LocalizationConfiguration { - ram attribute activeLocale; - 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 GeneralCommissioning { ram attribute breadcrumb default = 0x0000000000000000; callback attribute basicCommissioningInfo; diff --git a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.zap b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.zap index b3f7ab84762651..483f04f74af7e0 100644 --- a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.zap +++ b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.zap @@ -929,170 +929,6 @@ } ] }, - { - "name": "Localization Configuration", - "code": 43, - "mfgCode": null, - "define": "LOCALIZATION_CONFIGURATION_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "ActiveLocale", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "SupportedLocales", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "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": "General Commissioning", "code": 48, diff --git a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter index 00f7af07eed1b9..900b2933d0c4fc 100644 --- a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter +++ b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter @@ -791,67 +791,6 @@ cluster OtaSoftwareUpdateRequestor = 42 { 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; -} - /** This cluster is used to manage global aspects of the Commissioning flow. */ cluster GeneralCommissioning = 48 { revision 1; // NOTE: Default/not specifically set @@ -1697,21 +1636,6 @@ endpoint 0 { handle command AnnounceOTAProvider; } - server cluster LocalizationConfiguration { - ram attribute activeLocale; - 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 GeneralCommissioning { ram attribute breadcrumb default = 0x0000000000000000; callback attribute basicCommissioningInfo; diff --git a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.zap b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.zap index 9af0c6f4e97924..11d5fb7f1dee99 100644 --- a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.zap +++ b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.zap @@ -929,170 +929,6 @@ } ] }, - { - "name": "Localization Configuration", - "code": 43, - "mfgCode": null, - "define": "LOCALIZATION_CONFIGURATION_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "ActiveLocale", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "SupportedLocales", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "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": "General Commissioning", "code": 48, diff --git a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter index 42e7362bde656d..47ed02f1523ca3 100644 --- a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter +++ b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter @@ -539,67 +539,6 @@ cluster BasicInformation = 40 { command MfgSpecificPing(): DefaultSuccess = 0; } -/** Nodes should be expected to be deployed to any and all regions of the world. These global regions - may have differing common languages, units of measurements, and numerical formatting - standards. As such, Nodes that visually or audibly convey information need a mechanism by which - they can be configured to use a user’s preferred language, units, etc */ -cluster LocalizationConfiguration = 43 { - revision 1; // NOTE: Default/not specifically set - - attribute access(write: manage) char_string<35> activeLocale = 0; - readonly attribute char_string supportedLocales[] = 1; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; -} - -/** 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 @@ -1578,25 +1517,6 @@ endpoint 0 { ram attribute clusterRevision default = 3; } - server cluster LocalizationConfiguration { - persist attribute activeLocale default = "en-US"; - callback attribute supportedLocales; - callback attribute generatedCommandList; - callback attribute acceptedCommandList; - callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - - server cluster TimeFormatLocalization { - persist attribute hourFormat default = 0; - callback attribute generatedCommandList; - callback attribute acceptedCommandList; - callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - server cluster UnitLocalization { persist attribute temperatureUnit default = 0; callback attribute generatedCommandList; diff --git a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap index f023dad7d8e8a4..7b3d2d49a9a95d 100644 --- a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap +++ b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap @@ -958,234 +958,6 @@ } ] }, - { - "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": "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": "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": "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": "Unit Localization", "code": 45, diff --git a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter index 902658e2ffd476..724f3b69af8a2c 100644 --- a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter +++ b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter @@ -791,67 +791,6 @@ cluster OtaSoftwareUpdateRequestor = 42 { 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; -} - /** This cluster is used to manage global aspects of the Commissioning flow. */ cluster GeneralCommissioning = 48 { revision 1; // NOTE: Default/not specifically set @@ -1703,21 +1642,6 @@ endpoint 0 { handle command AnnounceOTAProvider; } - server cluster LocalizationConfiguration { - ram attribute activeLocale; - 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 GeneralCommissioning { ram attribute breadcrumb default = 0x0000000000000000; callback attribute basicCommissioningInfo; diff --git a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.zap b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.zap index e6c9ce20572a5e..459c52fe5a2570 100644 --- a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.zap +++ b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.zap @@ -929,170 +929,6 @@ } ] }, - { - "name": "Localization Configuration", - "code": 43, - "mfgCode": null, - "define": "LOCALIZATION_CONFIGURATION_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "ActiveLocale", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "SupportedLocales", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "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": "General Commissioning", "code": 48, diff --git a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter index 65a0c9cce398a4..de46def1ea4999 100644 --- a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter +++ b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter @@ -791,67 +791,6 @@ cluster OtaSoftwareUpdateRequestor = 42 { 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; -} - /** This cluster is used to manage global aspects of the Commissioning flow. */ cluster GeneralCommissioning = 48 { revision 1; // NOTE: Default/not specifically set @@ -1745,21 +1684,6 @@ endpoint 0 { handle command AnnounceOTAProvider; } - server cluster LocalizationConfiguration { - ram attribute activeLocale; - 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 GeneralCommissioning { ram attribute breadcrumb default = 0x0000000000000000; callback attribute basicCommissioningInfo; diff --git a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.zap b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.zap index 3f61a61d3c5b58..e6b4dcef3ed3ae 100644 --- a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.zap +++ b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.zap @@ -929,170 +929,6 @@ } ] }, - { - "name": "Localization Configuration", - "code": 43, - "mfgCode": null, - "define": "LOCALIZATION_CONFIGURATION_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "ActiveLocale", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "SupportedLocales", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "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": "General Commissioning", "code": 48, diff --git a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter index 6cbdac26fa5923..dc0c1077468544 100644 --- a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter +++ b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter @@ -988,67 +988,6 @@ cluster OtaSoftwareUpdateRequestor = 42 { 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; -} - /** This cluster is used to manage global aspects of the Commissioning flow. */ cluster GeneralCommissioning = 48 { revision 1; // NOTE: Default/not specifically set @@ -1878,21 +1817,6 @@ endpoint 0 { handle command AnnounceOTAProvider; } - server cluster LocalizationConfiguration { - ram attribute activeLocale; - 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 GeneralCommissioning { ram attribute breadcrumb default = 0x0000000000000000; callback attribute basicCommissioningInfo; diff --git a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.zap b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.zap index aa402e3f0b0df2..53e30c1ed298cd 100644 --- a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.zap +++ b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.zap @@ -929,170 +929,6 @@ } ] }, - { - "name": "Localization Configuration", - "code": 43, - "mfgCode": null, - "define": "LOCALIZATION_CONFIGURATION_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "ActiveLocale", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "SupportedLocales", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "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": "General Commissioning", "code": 48, @@ -3478,4 +3314,4 @@ "parentEndpointIdentifier": null } ] -} +} \ No newline at end of file diff --git a/examples/chef/devices/rootnode_onofflight_samplemei.matter b/examples/chef/devices/rootnode_onofflight_samplemei.matter index 35addbe1b2cac6..75c0b20fb975a7 100644 --- a/examples/chef/devices/rootnode_onofflight_samplemei.matter +++ b/examples/chef/devices/rootnode_onofflight_samplemei.matter @@ -988,67 +988,6 @@ cluster OtaSoftwareUpdateRequestor = 42 { 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; -} - /** This cluster is used to manage global aspects of the Commissioning flow. */ cluster GeneralCommissioning = 48 { revision 1; // NOTE: Default/not specifically set @@ -1910,21 +1849,6 @@ endpoint 0 { handle command AnnounceOTAProvider; } - server cluster LocalizationConfiguration { - ram attribute activeLocale; - 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 GeneralCommissioning { ram attribute breadcrumb default = 0x0000000000000000; callback attribute basicCommissioningInfo; diff --git a/examples/chef/devices/rootnode_onofflight_samplemei.zap b/examples/chef/devices/rootnode_onofflight_samplemei.zap index 6670453d47603e..30dca3d1e54ebf 100644 --- a/examples/chef/devices/rootnode_onofflight_samplemei.zap +++ b/examples/chef/devices/rootnode_onofflight_samplemei.zap @@ -929,170 +929,6 @@ } ] }, - { - "name": "Localization Configuration", - "code": 43, - "mfgCode": null, - "define": "LOCALIZATION_CONFIGURATION_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "ActiveLocale", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "SupportedLocales", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "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": "General Commissioning", "code": 48, diff --git a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter index 7c82c5b9b53516..18c776de2ab970 100644 --- a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter +++ b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter @@ -433,78 +433,6 @@ cluster OnOff = 6 { command OnWithTimedOff(OnWithTimedOffRequest): DefaultSuccess = 66; } -/** Attributes and commands for switching devices between 'On' and 'Off' states. */ -cluster OnOff = 6 { - revision 6; - - enum DelayedAllOffEffectVariantEnum : enum8 { - kDelayedOffFastFade = 0; - kNoFade = 1; - kDelayedOffSlowFade = 2; - } - - enum DyingLightEffectVariantEnum : enum8 { - kDyingLightFadeOff = 0; - } - - enum EffectIdentifierEnum : enum8 { - kDelayedAllOff = 0; - kDyingLight = 1; - } - - enum StartUpOnOffEnum : enum8 { - kOff = 0; - kOn = 1; - kToggle = 2; - } - - bitmap Feature : bitmap32 { - kLighting = 0x1; - kDeadFrontBehavior = 0x2; - kOffOnly = 0x4; - } - - bitmap OnOffControlBitmap : bitmap8 { - kAcceptOnlyWhenOn = 0x1; - } - - readonly attribute boolean onOff = 0; - readonly attribute optional boolean globalSceneControl = 16384; - attribute optional int16u onTime = 16385; - attribute optional int16u offWaitTime = 16386; - attribute access(write: manage) optional nullable StartUpOnOffEnum startUpOnOff = 16387; - 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 OffWithEffectRequest { - EffectIdentifierEnum effectIdentifier = 0; - enum8 effectVariant = 1; - } - - request struct OnWithTimedOffRequest { - OnOffControlBitmap onOffControl = 0; - int16u onTime = 1; - int16u offWaitTime = 2; - } - - /** On receipt of this command, a device SHALL enter its ‘Off’ state. This state is device dependent, but it is recommended that it is used for power off or similar functions. On receipt of the Off command, the OnTime attribute SHALL be set to 0. */ - command Off(): DefaultSuccess = 0; - /** On receipt of this command, a device SHALL enter its ‘On’ state. This state is device dependent, but it is recommended that it is used for power on or similar functions. On receipt of the On command, if the value of the OnTime attribute is equal to 0, the device SHALL set the OffWaitTime attribute to 0. */ - command On(): DefaultSuccess = 1; - /** On receipt of this command, if a device is in its ‘Off’ state it SHALL enter its ‘On’ state. Otherwise, if it is in its ‘On’ state it SHALL enter its ‘Off’ state. On receipt of the Toggle command, if the value of the OnOff attribute is equal to FALSE and if the value of the OnTime attribute is equal to 0, the device SHALL set the OffWaitTime attribute to 0. If the value of the OnOff attribute is equal to TRUE, the OnTime attribute SHALL be set to 0. */ - command Toggle(): DefaultSuccess = 2; - /** The OffWithEffect command allows devices to be turned off using enhanced ways of fading. */ - command OffWithEffect(OffWithEffectRequest): DefaultSuccess = 64; - /** The OnWithRecallGlobalScene command allows the recall of the settings when the device was turned off. */ - command OnWithRecallGlobalScene(): DefaultSuccess = 65; - /** The OnWithTimedOff command allows devices to be turned on for a specific duration with a guarded off duration so that SHOULD the device be subsequently switched off, further OnWithTimedOff commands, received during this time, are prevented from turning the devices back on. */ - command OnWithTimedOff(OnWithTimedOffRequest): DefaultSuccess = 66; -} - /** 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; @@ -935,67 +863,6 @@ cluster OtaSoftwareUpdateRequestor = 42 { 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; -} - /** This cluster is used to manage global aspects of the Commissioning flow. */ cluster GeneralCommissioning = 48 { revision 1; // NOTE: Default/not specifically set @@ -1825,21 +1692,6 @@ endpoint 0 { handle command AnnounceOTAProvider; } - server cluster LocalizationConfiguration { - ram attribute activeLocale; - 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 GeneralCommissioning { ram attribute breadcrumb default = 0x0000000000000000; callback attribute basicCommissioningInfo; @@ -2013,19 +1865,6 @@ endpoint 1 { handle command AddGroupIfIdentifying; } - server cluster OnOff { - ram attribute onOff default = 0; - callback attribute generatedCommandList; - callback attribute acceptedCommandList; - callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 5; - - handle command Off; - handle command On; - handle command Toggle; - } - server cluster Descriptor { callback attribute deviceTypeList; callback attribute serverList; diff --git a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.zap b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.zap index be0a44c92a9b74..ff4a49b7778298 100644 --- a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.zap +++ b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.zap @@ -929,170 +929,6 @@ } ] }, - { - "name": "Localization Configuration", - "code": 43, - "mfgCode": null, - "define": "LOCALIZATION_CONFIGURATION_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "ActiveLocale", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "SupportedLocales", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "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": "General Commissioning", "code": 48, @@ -2865,138 +2701,6 @@ } ] }, - { - "name": "On/Off", - "code": 6, - "mfgCode": null, - "define": "ON_OFF_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [ - { - "name": "Off", - "code": 0, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "On", - "code": 1, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "Toggle", - "code": 2, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - } - ], - "attributes": [ - { - "name": "OnOff", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "boolean", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "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": "5", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, { "name": "Descriptor", "code": 29, @@ -3198,4 +2902,4 @@ "parentEndpointIdentifier": null } ] -} \ No newline at end of file +} diff --git a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter index 5fe0482fb1e137..d8c6175497d76e 100644 --- a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter +++ b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter @@ -863,67 +863,6 @@ cluster OtaSoftwareUpdateRequestor = 42 { 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; -} - /** This cluster is used to manage global aspects of the Commissioning flow. */ cluster GeneralCommissioning = 48 { revision 1; // NOTE: Default/not specifically set @@ -1753,21 +1692,6 @@ endpoint 0 { handle command AnnounceOTAProvider; } - server cluster LocalizationConfiguration { - ram attribute activeLocale; - 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 GeneralCommissioning { ram attribute breadcrumb default = 0x0000000000000000; callback attribute basicCommissioningInfo; diff --git a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.zap b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.zap index 356230f6e6cd89..99f826d194b05a 100644 --- a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.zap +++ b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.zap @@ -929,170 +929,6 @@ } ] }, - { - "name": "Localization Configuration", - "code": 43, - "mfgCode": null, - "define": "LOCALIZATION_CONFIGURATION_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "ActiveLocale", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "SupportedLocales", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "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": "General Commissioning", "code": 48, diff --git a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter index 44ad0bfb504d30..db33ccdc120233 100644 --- a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter +++ b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter @@ -791,67 +791,6 @@ cluster OtaSoftwareUpdateRequestor = 42 { 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; -} - /** This cluster is used to manage global aspects of the Commissioning flow. */ cluster GeneralCommissioning = 48 { revision 1; // NOTE: Default/not specifically set @@ -1724,21 +1663,6 @@ endpoint 0 { handle command AnnounceOTAProvider; } - server cluster LocalizationConfiguration { - ram attribute activeLocale; - 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 GeneralCommissioning { ram attribute breadcrumb default = 0x0000000000000000; callback attribute basicCommissioningInfo; diff --git a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.zap b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.zap index 00a5272aa76766..21c60d8cef2350 100644 --- a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.zap +++ b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.zap @@ -929,170 +929,6 @@ } ] }, - { - "name": "Localization Configuration", - "code": 43, - "mfgCode": null, - "define": "LOCALIZATION_CONFIGURATION_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "ActiveLocale", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "SupportedLocales", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "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": "General Commissioning", "code": 48, diff --git a/examples/chef/devices/rootnode_pump_5f904818cc.matter b/examples/chef/devices/rootnode_pump_5f904818cc.matter index e8141a4d66db35..a28cc3fe719da3 100644 --- a/examples/chef/devices/rootnode_pump_5f904818cc.matter +++ b/examples/chef/devices/rootnode_pump_5f904818cc.matter @@ -611,67 +611,6 @@ cluster BasicInformation = 40 { command MfgSpecificPing(): DefaultSuccess = 0; } -/** Nodes should be expected to be deployed to any and all regions of the world. These global regions - may have differing common languages, units of measurements, and numerical formatting - standards. As such, Nodes that visually or audibly convey information need a mechanism by which - they can be configured to use a user’s preferred language, units, etc */ -cluster LocalizationConfiguration = 43 { - revision 1; // NOTE: Default/not specifically set - - attribute access(write: manage) char_string<35> activeLocale = 0; - readonly attribute char_string supportedLocales[] = 1; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; -} - -/** 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 @@ -1587,25 +1526,6 @@ endpoint 0 { ram attribute clusterRevision default = 3; } - server cluster LocalizationConfiguration { - ram attribute activeLocale; - callback attribute supportedLocales; - callback attribute generatedCommandList; - callback attribute acceptedCommandList; - callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - - server cluster TimeFormatLocalization { - persist attribute hourFormat default = 0; - callback attribute generatedCommandList; - callback attribute acceptedCommandList; - callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - server cluster UnitLocalization { callback attribute generatedCommandList; callback attribute acceptedCommandList; diff --git a/examples/chef/devices/rootnode_pump_5f904818cc.zap b/examples/chef/devices/rootnode_pump_5f904818cc.zap index f28d7cfbab317e..77f757a6681e46 100644 --- a/examples/chef/devices/rootnode_pump_5f904818cc.zap +++ b/examples/chef/devices/rootnode_pump_5f904818cc.zap @@ -715,234 +715,6 @@ } ] }, - { - "name": "Localization Configuration", - "code": 43, - "mfgCode": null, - "define": "LOCALIZATION_CONFIGURATION_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "ActiveLocale", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "SupportedLocales", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "GeneratedCommandList", - "code": 65528, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AcceptedCommandList", - "code": 65529, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "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": "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": "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": "Unit Localization", "code": 45, diff --git a/examples/chef/devices/rootnode_pump_a811bb33a0.matter b/examples/chef/devices/rootnode_pump_a811bb33a0.matter index bb889d64c319e1..5faf56143e53b2 100644 --- a/examples/chef/devices/rootnode_pump_a811bb33a0.matter +++ b/examples/chef/devices/rootnode_pump_a811bb33a0.matter @@ -611,67 +611,6 @@ cluster BasicInformation = 40 { command MfgSpecificPing(): DefaultSuccess = 0; } -/** Nodes should be expected to be deployed to any and all regions of the world. These global regions - may have differing common languages, units of measurements, and numerical formatting - standards. As such, Nodes that visually or audibly convey information need a mechanism by which - they can be configured to use a user’s preferred language, units, etc */ -cluster LocalizationConfiguration = 43 { - revision 1; // NOTE: Default/not specifically set - - attribute access(write: manage) char_string<35> activeLocale = 0; - readonly attribute char_string supportedLocales[] = 1; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; -} - -/** 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 @@ -1530,25 +1469,6 @@ endpoint 0 { ram attribute clusterRevision default = 3; } - server cluster LocalizationConfiguration { - ram attribute activeLocale; - callback attribute supportedLocales; - callback attribute generatedCommandList; - callback attribute acceptedCommandList; - callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - - server cluster TimeFormatLocalization { - persist attribute hourFormat default = 0; - callback attribute generatedCommandList; - callback attribute acceptedCommandList; - callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - server cluster UnitLocalization { callback attribute generatedCommandList; callback attribute acceptedCommandList; diff --git a/examples/chef/devices/rootnode_pump_a811bb33a0.zap b/examples/chef/devices/rootnode_pump_a811bb33a0.zap index 6314e3fb0c2e3a..1d7c10b1eb33e5 100644 --- a/examples/chef/devices/rootnode_pump_a811bb33a0.zap +++ b/examples/chef/devices/rootnode_pump_a811bb33a0.zap @@ -715,234 +715,6 @@ } ] }, - { - "name": "Localization Configuration", - "code": 43, - "mfgCode": null, - "define": "LOCALIZATION_CONFIGURATION_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "ActiveLocale", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "SupportedLocales", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "GeneratedCommandList", - "code": 65528, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AcceptedCommandList", - "code": 65529, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "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": "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": "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": "Unit Localization", "code": 45, diff --git a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter index 13d8b98e93f7f0..cf0c9c20e47438 100644 --- a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter +++ b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter @@ -539,67 +539,6 @@ cluster BasicInformation = 40 { command MfgSpecificPing(): DefaultSuccess = 0; } -/** Nodes should be expected to be deployed to any and all regions of the world. These global regions - may have differing common languages, units of measurements, and numerical formatting - standards. As such, Nodes that visually or audibly convey information need a mechanism by which - they can be configured to use a user’s preferred language, units, etc */ -cluster LocalizationConfiguration = 43 { - revision 1; // NOTE: Default/not specifically set - - attribute access(write: manage) char_string<35> activeLocale = 0; - readonly attribute char_string supportedLocales[] = 1; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; -} - -/** 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 @@ -1465,25 +1404,6 @@ endpoint 0 { ram attribute clusterRevision default = 3; } - server cluster LocalizationConfiguration { - persist attribute activeLocale default = "en-US"; - callback attribute supportedLocales; - callback attribute generatedCommandList; - callback attribute acceptedCommandList; - callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - - server cluster TimeFormatLocalization { - persist attribute hourFormat default = 0; - callback attribute generatedCommandList; - callback attribute acceptedCommandList; - callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - server cluster UnitLocalization { persist attribute temperatureUnit default = 0; callback attribute generatedCommandList; diff --git a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap index bf7540df089035..b93bcb05fec24a 100644 --- a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap +++ b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap @@ -958,234 +958,6 @@ } ] }, - { - "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": "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": "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": "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": "Unit Localization", "code": 45, diff --git a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter index a4fe9d839c4a48..223f47a4dfa346 100644 --- a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter +++ b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter @@ -911,67 +911,6 @@ cluster OtaSoftwareUpdateRequestor = 42 { 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; -} - /** This cluster is used to manage global aspects of the Commissioning flow. */ cluster GeneralCommissioning = 48 { revision 1; // NOTE: Default/not specifically set @@ -1801,21 +1740,6 @@ endpoint 0 { handle command AnnounceOTAProvider; } - server cluster LocalizationConfiguration { - ram attribute activeLocale; - 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 GeneralCommissioning { ram attribute breadcrumb default = 0x0000000000000000; callback attribute basicCommissioningInfo; diff --git a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.zap b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.zap index b766b72f319f87..61325839e9d157 100644 --- a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.zap +++ b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.zap @@ -929,170 +929,6 @@ } ] }, - { - "name": "Localization Configuration", - "code": 43, - "mfgCode": null, - "define": "LOCALIZATION_CONFIGURATION_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "ActiveLocale", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "SupportedLocales", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "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": "General Commissioning", "code": 48, diff --git a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter index 60aacfe955c687..5e23267e1b9b6c 100644 --- a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter +++ b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter @@ -791,67 +791,6 @@ cluster OtaSoftwareUpdateRequestor = 42 { 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; -} - /** This cluster is used to manage global aspects of the Commissioning flow. */ cluster GeneralCommissioning = 48 { revision 1; // NOTE: Default/not specifically set @@ -1697,21 +1636,6 @@ endpoint 0 { handle command AnnounceOTAProvider; } - server cluster LocalizationConfiguration { - ram attribute activeLocale; - 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 GeneralCommissioning { ram attribute breadcrumb default = 0x0000000000000000; callback attribute basicCommissioningInfo; diff --git a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.zap b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.zap index 4d3f63260f57e4..2c20622caa4824 100644 --- a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.zap +++ b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.zap @@ -929,170 +929,6 @@ } ] }, - { - "name": "Localization Configuration", - "code": 43, - "mfgCode": null, - "define": "LOCALIZATION_CONFIGURATION_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "ActiveLocale", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "SupportedLocales", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "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": "General Commissioning", "code": 48, diff --git a/examples/chef/devices/rootnode_waterleakdetector_0b067acfa3.matter b/examples/chef/devices/rootnode_waterleakdetector_0b067acfa3.matter index dec13bdf452e45..360771d4b05336 100644 --- a/examples/chef/devices/rootnode_waterleakdetector_0b067acfa3.matter +++ b/examples/chef/devices/rootnode_waterleakdetector_0b067acfa3.matter @@ -616,23 +616,6 @@ cluster BasicInformation = 40 { command MfgSpecificPing(): DefaultSuccess = 0; } -/** Nodes should be expected to be deployed to any and all regions of the world. These global regions - may have differing common languages, units of measurements, and numerical formatting - standards. As such, Nodes that visually or audibly convey information need a mechanism by which - they can be configured to use a user’s preferred language, units, etc */ -cluster LocalizationConfiguration = 43 { - revision 1; // NOTE: Default/not specifically set - - attribute access(write: manage) char_string<35> activeLocale = 0; - readonly attribute char_string supportedLocales[] = 1; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; -} - /** This cluster is used to manage global aspects of the Commissioning flow. */ cluster GeneralCommissioning = 48 { revision 1; // NOTE: Default/not specifically set @@ -1466,17 +1449,6 @@ endpoint 0 { ram attribute clusterRevision default = 2; } - server cluster LocalizationConfiguration { - ram attribute activeLocale; - callback attribute supportedLocales; - callback attribute generatedCommandList; - callback attribute acceptedCommandList; - callback attribute eventList; - callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - server cluster GeneralCommissioning { ram attribute breadcrumb default = 0x0000000000000000; callback attribute basicCommissioningInfo; diff --git a/examples/chef/devices/rootnode_waterleakdetector_0b067acfa3.zap b/examples/chef/devices/rootnode_waterleakdetector_0b067acfa3.zap index d2f3e341907a7d..a07441c6c7dbbd 100644 --- a/examples/chef/devices/rootnode_waterleakdetector_0b067acfa3.zap +++ b/examples/chef/devices/rootnode_waterleakdetector_0b067acfa3.zap @@ -722,144 +722,6 @@ } ] }, - { - "name": "Localization Configuration", - "code": 43, - "mfgCode": null, - "define": "LOCALIZATION_CONFIGURATION_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "ActiveLocale", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "SupportedLocales", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "GeneratedCommandList", - "code": 65528, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AcceptedCommandList", - "code": 65529, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "EventList", - "code": 65530, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AttributeList", - "code": 65531, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, { "name": "General Commissioning", "code": 48, diff --git a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter index a57c946cfa0f93..6056460bea24ff 100644 --- a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter +++ b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter @@ -791,67 +791,6 @@ cluster OtaSoftwareUpdateRequestor = 42 { 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; -} - /** This cluster is used to manage global aspects of the Commissioning flow. */ cluster GeneralCommissioning = 48 { revision 1; // NOTE: Default/not specifically set @@ -1834,21 +1773,6 @@ endpoint 0 { handle command AnnounceOTAProvider; } - server cluster LocalizationConfiguration { - ram attribute activeLocale; - 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 GeneralCommissioning { ram attribute breadcrumb default = 0x0000000000000000; callback attribute basicCommissioningInfo; diff --git a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.zap b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.zap index cc78cf315cacc2..043e0a30a7c335 100644 --- a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.zap +++ b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.zap @@ -929,170 +929,6 @@ } ] }, - { - "name": "Localization Configuration", - "code": 43, - "mfgCode": null, - "define": "LOCALIZATION_CONFIGURATION_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "ActiveLocale", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "SupportedLocales", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "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": "General Commissioning", "code": 48, diff --git a/examples/chef/devices/template.zap b/examples/chef/devices/template.zap index 82c175c74fc289..2eec4460e870b9 100644 --- a/examples/chef/devices/template.zap +++ b/examples/chef/devices/template.zap @@ -722,144 +722,6 @@ } ] }, - { - "name": "Localization Configuration", - "code": 43, - "mfgCode": null, - "define": "LOCALIZATION_CONFIGURATION_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "ActiveLocale", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "SupportedLocales", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "GeneratedCommandList", - "code": 65528, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AcceptedCommandList", - "code": 65529, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "EventList", - "code": 65530, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AttributeList", - "code": 65531, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, { "name": "General Commissioning", "code": 48, diff --git a/examples/chef/kvs1 b/examples/chef/kvs1 new file mode 100644 index 00000000000000..1a49d937bc6aea --- /dev/null +++ b/examples/chef/kvs1 @@ -0,0 +1,7 @@ +[DEFAULT] +g/gcc=FN5mAQ== +g/gdc=53gMAA== +g/im/ec=AAABAAAAAAA= +g/lkgt=FSYAgKi8LBg= +g/sum=MAA= + diff --git a/examples/chef/sample_app_util/test_files/sample_zap_file.zap b/examples/chef/sample_app_util/test_files/sample_zap_file.zap index 7794e2b510e669..7ad3cf51484541 100644 --- a/examples/chef/sample_app_util/test_files/sample_zap_file.zap +++ b/examples/chef/sample_app_util/test_files/sample_zap_file.zap @@ -1053,170 +1053,6 @@ } ] }, - { - "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": "General Commissioning", "code": 48, diff --git a/examples/chef/sample_app_util/test_files/sample_zap_file_meta.yaml b/examples/chef/sample_app_util/test_files/sample_zap_file_meta.yaml index 798f5355b1a99a..de8678ed4f1214 100644 --- a/examples/chef/sample_app_util/test_files/sample_zap_file_meta.yaml +++ b/examples/chef/sample_app_util/test_files/sample_zap_file_meta.yaml @@ -37,9 +37,6 @@ Groups/4: attributes: FeatureMap/65532: '0' - LocalizationConfiguration/43: - attributes: - FeatureMap/65532: '0' OperationalCredentials/62: attributes: FeatureMap/65532: '0' @@ -55,9 +52,6 @@ ThreadNetworkDiagnostics/53: attributes: FeatureMap/65532: '15' - TimeFormatLocalization/44: - attributes: - FeatureMap/65532: '0' UserLabel/65: attributes: FeatureMap/65532: '0' diff --git a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter index 60e67e4c4a7c46..05fe9c8efe4a6f 100644 --- a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter +++ b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter @@ -770,67 +770,6 @@ cluster OtaSoftwareUpdateRequestor = 42 { 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; -} - /** This cluster is used to manage global aspects of the Commissioning flow. */ cluster GeneralCommissioning = 48 { revision 1; // NOTE: Default/not specifically set @@ -2061,21 +2000,6 @@ endpoint 0 { 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 GeneralCommissioning { ram attribute breadcrumb default = 0x0000000000000000; callback attribute basicCommissioningInfo; diff --git a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.zap b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.zap index 90b0a3cb5de3fe..2006f483e969f6 100644 --- a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.zap +++ b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.zap @@ -1069,170 +1069,6 @@ } ] }, - { - "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": "General Commissioning", "code": 48, diff --git a/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter b/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter index 0df498ea2952f4..578a806c9d7253 100644 --- a/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter +++ b/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter @@ -637,67 +637,6 @@ cluster BasicInformation = 40 { command MfgSpecificPing(): DefaultSuccess = 0; } -/** Nodes should be expected to be deployed to any and all regions of the world. These global regions - may have differing common languages, units of measurements, and numerical formatting - standards. As such, Nodes that visually or audibly convey information need a mechanism by which - they can be configured to use a user’s preferred language, units, etc */ -cluster LocalizationConfiguration = 43 { - revision 1; // NOTE: Default/not specifically set - - attribute access(write: manage) char_string<35> activeLocale = 0; - readonly attribute char_string supportedLocales[] = 1; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; -} - -/** 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 @@ -1614,25 +1553,6 @@ endpoint 0 { ram attribute clusterRevision default = 3; } - server cluster LocalizationConfiguration { - persist attribute activeLocale default = "en-US"; - callback attribute supportedLocales; - callback attribute generatedCommandList; - callback attribute acceptedCommandList; - callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - - server cluster TimeFormatLocalization { - persist attribute hourFormat default = 0; - callback attribute generatedCommandList; - callback attribute acceptedCommandList; - callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - server cluster UnitLocalization { persist attribute temperatureUnit default = 0; callback attribute generatedCommandList; diff --git a/examples/dishwasher-app/dishwasher-common/dishwasher-app.zap b/examples/dishwasher-app/dishwasher-common/dishwasher-app.zap index 12cad848810d09..d8804e9526b4af 100644 --- a/examples/dishwasher-app/dishwasher-common/dishwasher-app.zap +++ b/examples/dishwasher-app/dishwasher-common/dishwasher-app.zap @@ -1098,234 +1098,6 @@ } ] }, - { - "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": "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": "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": "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": "Unit Localization", "code": 45, diff --git a/examples/laundry-washer-app/nxp/zap/laundry-washer-app.matter b/examples/laundry-washer-app/nxp/zap/laundry-washer-app.matter index adc4fe3de8065e..e597b02c74e841 100644 --- a/examples/laundry-washer-app/nxp/zap/laundry-washer-app.matter +++ b/examples/laundry-washer-app/nxp/zap/laundry-washer-app.matter @@ -863,67 +863,6 @@ cluster OtaSoftwareUpdateRequestor = 42 { 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 @@ -2284,27 +2223,6 @@ endpoint 0 { handle command AnnounceOTAProvider; } - server cluster LocalizationConfiguration { - persist attribute activeLocale default = "en-US"; - callback attribute supportedLocales; - callback attribute generatedCommandList; - callback attribute acceptedCommandList; - callback attribute eventList; - callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - - server cluster TimeFormatLocalization { - ram attribute hourFormat; - callback attribute generatedCommandList; - callback attribute acceptedCommandList; - callback attribute eventList; - callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - server cluster UnitLocalization { callback attribute generatedCommandList; callback attribute acceptedCommandList; diff --git a/examples/laundry-washer-app/nxp/zap/laundry-washer-app.zap b/examples/laundry-washer-app/nxp/zap/laundry-washer-app.zap index b58e1cdea5b257..001bfbc945f132 100644 --- a/examples/laundry-washer-app/nxp/zap/laundry-washer-app.zap +++ b/examples/laundry-washer-app/nxp/zap/laundry-washer-app.zap @@ -1157,266 +1157,6 @@ } ] }, - { - "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": "GeneratedCommandList", - "code": 65528, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AcceptedCommandList", - "code": 65529, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "EventList", - "code": 65530, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AttributeList", - "code": 65531, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, - { - "name": "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": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "GeneratedCommandList", - "code": 65528, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AcceptedCommandList", - "code": 65529, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "EventList", - "code": 65530, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AttributeList", - "code": 65531, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, { "name": "Unit Localization", "code": 45, diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.matter b/examples/light-switch-app/light-switch-common/light-switch-app.matter index 46dd0d70bf43da..5da173fe9dc113 100644 --- a/examples/light-switch-app/light-switch-common/light-switch-app.matter +++ b/examples/light-switch-app/light-switch-common/light-switch-app.matter @@ -913,67 +913,6 @@ cluster OtaSoftwareUpdateRequestor = 42 { 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; -} - /** This cluster is used to manage global aspects of the Commissioning flow. */ cluster GeneralCommissioning = 48 { revision 1; // NOTE: Default/not specifically set @@ -2898,21 +2837,6 @@ endpoint 0 { handle command AnnounceOTAProvider; } - server cluster LocalizationConfiguration { - ram attribute activeLocale; - callback attribute supportedLocales; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - - server cluster TimeFormatLocalization { - persist attribute hourFormat; - persist attribute activeCalendarType; - callback attribute supportedCalendarTypes; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - server cluster GeneralCommissioning { ram attribute breadcrumb default = 0x0000000000000000; callback attribute basicCommissioningInfo; diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.zap b/examples/light-switch-app/light-switch-common/light-switch-app.zap index 806d45be48fb3c..e426e68bbc9063 100644 --- a/examples/light-switch-app/light-switch-common/light-switch-app.zap +++ b/examples/light-switch-app/light-switch-common/light-switch-app.zap @@ -987,170 +987,6 @@ } ] }, - { - "name": "Localization Configuration", - "code": 43, - "mfgCode": null, - "define": "LOCALIZATION_CONFIGURATION_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "ActiveLocale", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "SupportedLocales", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "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": "", - "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": "", - "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": "General Commissioning", "code": 48, diff --git a/examples/lighting-app-data-mode-no-unique-id/lighting-common/lighting-app.matter b/examples/lighting-app-data-mode-no-unique-id/lighting-common/lighting-app.matter index 8b88e7d961fe5f..66acdd254d6214 100644 --- a/examples/lighting-app-data-mode-no-unique-id/lighting-common/lighting-app.matter +++ b/examples/lighting-app-data-mode-no-unique-id/lighting-common/lighting-app.matter @@ -967,67 +967,6 @@ cluster OtaSoftwareUpdateRequestor = 42 { 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; -} - /** This cluster is used to manage global aspects of the Commissioning flow. */ cluster GeneralCommissioning = 48 { revision 1; // NOTE: Default/not specifically set @@ -2763,21 +2702,6 @@ endpoint 0 { 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 GeneralCommissioning { ram attribute breadcrumb default = 0x0000000000000000; callback attribute basicCommissioningInfo; diff --git a/examples/lighting-app-data-mode-no-unique-id/lighting-common/lighting-app.zap b/examples/lighting-app-data-mode-no-unique-id/lighting-common/lighting-app.zap index 3a071c356b8655..67cbfdedad076f 100644 --- a/examples/lighting-app-data-mode-no-unique-id/lighting-common/lighting-app.zap +++ b/examples/lighting-app-data-mode-no-unique-id/lighting-common/lighting-app.zap @@ -913,170 +913,6 @@ } ] }, - { - "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": "General Commissioning", "code": 48, @@ -5916,4 +5752,4 @@ "parentEndpointIdentifier": null } ] -} +} \ No newline at end of file diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter index c51e6ee8ca0d7f..99280db5e6b764 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter @@ -967,67 +967,6 @@ cluster OtaSoftwareUpdateRequestor = 42 { 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; -} - /** This cluster is used to manage global aspects of the Commissioning flow. */ cluster GeneralCommissioning = 48 { revision 1; // NOTE: Default/not specifically set @@ -2236,21 +2175,6 @@ endpoint 0 { 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 GeneralCommissioning { ram attribute breadcrumb default = 0x0000000000000000; callback attribute basicCommissioningInfo; diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap index 1f7f1aa176483b..db1960f57718af 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap @@ -823,170 +823,6 @@ } ] }, - { - "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": "General Commissioning", "code": 48, diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter index 33d68c727dba51..2d6c439a3ea70d 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter @@ -967,67 +967,6 @@ cluster OtaSoftwareUpdateRequestor = 42 { 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; -} - /** This cluster is used to manage global aspects of the Commissioning flow. */ cluster GeneralCommissioning = 48 { revision 1; // NOTE: Default/not specifically set @@ -2369,21 +2308,6 @@ endpoint 0 { 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 GeneralCommissioning { ram attribute breadcrumb default = 0x0000000000000000; callback attribute basicCommissioningInfo; diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap index b525204ed52d3b..31f009e23fdb3a 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap @@ -929,170 +929,6 @@ } ] }, - { - "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": "General Commissioning", "code": 48, diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter index 78eed27958bc67..bc46399ed8d0ce 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter @@ -967,67 +967,6 @@ cluster OtaSoftwareUpdateRequestor = 42 { 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; -} - /** This cluster is used to manage global aspects of the Commissioning flow. */ cluster GeneralCommissioning = 48 { revision 1; // NOTE: Default/not specifically set @@ -2280,21 +2219,6 @@ endpoint 0 { 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 GeneralCommissioning { ram attribute breadcrumb default = 0x0000000000000000; callback attribute basicCommissioningInfo; diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap index eb23b365d01428..b5d0569687e8f6 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap @@ -929,170 +929,6 @@ } ] }, - { - "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": "General Commissioning", "code": 48, diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index 1fe4d7929d37fa..e65b407b9caa6c 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -967,67 +967,6 @@ cluster OtaSoftwareUpdateRequestor = 42 { 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; -} - /** This cluster is used to manage global aspects of the Commissioning flow. */ cluster GeneralCommissioning = 48 { revision 1; // NOTE: Default/not specifically set @@ -2764,21 +2703,6 @@ endpoint 0 { 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 GeneralCommissioning { ram attribute breadcrumb default = 0x0000000000000000; callback attribute basicCommissioningInfo; diff --git a/examples/lighting-app/lighting-common/lighting-app.zap b/examples/lighting-app/lighting-common/lighting-app.zap index 68929e98da0c20..a11ef874882a93 100644 --- a/examples/lighting-app/lighting-common/lighting-app.zap +++ b/examples/lighting-app/lighting-common/lighting-app.zap @@ -929,170 +929,6 @@ } ] }, - { - "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": "General Commissioning", "code": 48, diff --git a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter index 03373bfdda8668..b81d7d1ee68e71 100644 --- a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter @@ -967,67 +967,6 @@ cluster OtaSoftwareUpdateRequestor = 42 { 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; -} - /** This cluster is used to manage global aspects of the Commissioning flow. */ cluster GeneralCommissioning = 48 { revision 1; // NOTE: Default/not specifically set @@ -2398,21 +2337,6 @@ endpoint 0 { 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 GeneralCommissioning { ram attribute breadcrumb default = 0x0000000000000000; callback attribute basicCommissioningInfo; diff --git a/examples/lighting-app/silabs/data_model/lighting-thread-app.zap b/examples/lighting-app/silabs/data_model/lighting-thread-app.zap index 89211683435c23..8ce49423a2afb1 100644 --- a/examples/lighting-app/silabs/data_model/lighting-thread-app.zap +++ b/examples/lighting-app/silabs/data_model/lighting-thread-app.zap @@ -883,170 +883,6 @@ } ] }, - { - "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": "General Commissioning", "code": 48, diff --git a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter index ae68bac12e3e61..b4aa594acd6f02 100644 --- a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter @@ -967,67 +967,6 @@ cluster OtaSoftwareUpdateRequestor = 42 { 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; -} - /** This cluster is used to describe the configuration and capabilities of a physical power source that provides power to the Node. */ cluster PowerSource = 47 { revision 1; // NOTE: Default/not specifically set @@ -2689,21 +2628,6 @@ endpoint 0 { 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 GeneralCommissioning { ram attribute breadcrumb default = 0x0000000000000000; callback attribute basicCommissioningInfo; diff --git a/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap b/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap index db1f5a39429942..fe5189980b619e 100644 --- a/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap +++ b/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap @@ -883,170 +883,6 @@ } ] }, - { - "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": "General Commissioning", "code": 48, diff --git a/examples/lock-app/lock-common/lock-app.matter b/examples/lock-app/lock-common/lock-app.matter index 2f2b9dd40850d8..0b316c77592d7e 100644 --- a/examples/lock-app/lock-common/lock-app.matter +++ b/examples/lock-app/lock-common/lock-app.matter @@ -693,23 +693,6 @@ cluster OtaSoftwareUpdateRequestor = 42 { 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 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 @@ -2888,17 +2871,6 @@ endpoint 0 { handle command AnnounceOTAProvider; } - server cluster LocalizationConfiguration { - persist attribute activeLocale default = "en-US"; - callback attribute supportedLocales; - callback attribute generatedCommandList; - callback attribute acceptedCommandList; - callback attribute eventList; - callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - server cluster UnitLocalization { callback attribute generatedCommandList; callback attribute acceptedCommandList; diff --git a/examples/lock-app/lock-common/lock-app.zap b/examples/lock-app/lock-common/lock-app.zap index 4403019057a295..de7a4801225d75 100644 --- a/examples/lock-app/lock-common/lock-app.zap +++ b/examples/lock-app/lock-common/lock-app.zap @@ -1113,144 +1113,6 @@ } ] }, - { - "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": "GeneratedCommandList", - "code": 65528, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AcceptedCommandList", - "code": 65529, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "EventList", - "code": 65530, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AttributeList", - "code": 65531, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, { "name": "Unit Localization", "code": 45, diff --git a/examples/network-manager-app/network-manager-common/network-manager-app.zap b/examples/network-manager-app/network-manager-common/network-manager-app.zap index f471bb2d3b135b..da1c431a49157f 100644 --- a/examples/network-manager-app/network-manager-common/network-manager-app.zap +++ b/examples/network-manager-app/network-manager-common/network-manager-app.zap @@ -3886,4 +3886,4 @@ "parentEndpointIdentifier": null } ] -} +} \ No newline at end of file diff --git a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter index 5958192ce981e1..c3678e0f93cdd4 100644 --- a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter +++ b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter @@ -690,67 +690,6 @@ cluster OtaSoftwareUpdateProvider = 41 { command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; } -/** 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; -} - /** This cluster is used to manage global aspects of the Commissioning flow. */ cluster GeneralCommissioning = 48 { revision 1; // NOTE: Default/not specifically set @@ -1514,21 +1453,6 @@ endpoint 0 { handle command NotifyUpdateApplied; } - 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 GeneralCommissioning { ram attribute breadcrumb default = 0x0000000000000000; callback attribute basicCommissioningInfo; diff --git a/examples/ota-provider-app/ota-provider-common/ota-provider-app.zap b/examples/ota-provider-app/ota-provider-common/ota-provider-app.zap index c98b9e661328e5..e1cb30834e29ad 100644 --- a/examples/ota-provider-app/ota-provider-common/ota-provider-app.zap +++ b/examples/ota-provider-app/ota-provider-common/ota-provider-app.zap @@ -880,170 +880,6 @@ } ] }, - { - "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": "General Commissioning", "code": 48, diff --git a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter index c61a4908d01f1f..8206447e3683d0 100644 --- a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter +++ b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter @@ -842,67 +842,6 @@ cluster OtaSoftwareUpdateRequestor = 42 { 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; -} - /** This cluster is used to manage global aspects of the Commissioning flow. */ cluster GeneralCommissioning = 48 { revision 1; // NOTE: Default/not specifically set @@ -1682,25 +1621,6 @@ endpoint 0 { handle command AnnounceOTAProvider; } - server cluster LocalizationConfiguration { - persist attribute activeLocale default = "en-US"; - callback attribute supportedLocales; - callback attribute generatedCommandList; - callback attribute acceptedCommandList; - callback attribute eventList; - callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - - server cluster 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 GeneralCommissioning { ram attribute breadcrumb default = 0x0000000000000000; callback attribute basicCommissioningInfo; diff --git a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.zap b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.zap index 2ae993e399dd18..c14a51d1a3d5e9 100644 --- a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.zap +++ b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.zap @@ -1193,234 +1193,6 @@ } ] }, - { - "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": "GeneratedCommandList", - "code": 65528, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AcceptedCommandList", - "code": 65529, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "EventList", - "code": 65530, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AttributeList", - "code": 65531, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, - { - "name": "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": "General Commissioning", "code": 48, diff --git a/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter b/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter index 892012082c0d71..4840ef68f2e6fe 100644 --- a/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter +++ b/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter @@ -489,67 +489,6 @@ cluster BasicInformation = 40 { command MfgSpecificPing(): DefaultSuccess = 0; } -/** Nodes should be expected to be deployed to any and all regions of the world. These global regions - may have differing common languages, units of measurements, and numerical formatting - standards. As such, Nodes that visually or audibly convey information need a mechanism by which - they can be configured to use a user’s preferred language, units, etc */ -cluster LocalizationConfiguration = 43 { - revision 1; // NOTE: Default/not specifically set - - attribute access(write: manage) char_string<35> activeLocale = 0; - readonly attribute char_string supportedLocales[] = 1; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; -} - -/** 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 @@ -1405,25 +1344,6 @@ endpoint 0 { ram attribute clusterRevision default = 3; } - server cluster LocalizationConfiguration { - persist attribute activeLocale default = "en-US"; - callback attribute supportedLocales; - callback attribute generatedCommandList; - callback attribute acceptedCommandList; - callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - - server cluster TimeFormatLocalization { - persist attribute hourFormat default = 0; - callback attribute generatedCommandList; - callback attribute acceptedCommandList; - callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - server cluster UnitLocalization { persist attribute temperatureUnit default = 0; callback attribute generatedCommandList; diff --git a/examples/refrigerator-app/refrigerator-common/refrigerator-app.zap b/examples/refrigerator-app/refrigerator-common/refrigerator-app.zap index 64bf5b3bca8577..3040a2f479a904 100644 --- a/examples/refrigerator-app/refrigerator-common/refrigerator-app.zap +++ b/examples/refrigerator-app/refrigerator-common/refrigerator-app.zap @@ -866,234 +866,6 @@ } ] }, - { - "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": "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": "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": "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": "Unit Localization", "code": 45, diff --git a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter index 1af9ccc34b0422..9f62c2ead82d95 100644 --- a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter +++ b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter @@ -770,67 +770,6 @@ cluster OtaSoftwareUpdateRequestor = 42 { 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; -} - /** This cluster is used to describe the configuration and capabilities of a physical power source that provides power to the Node. */ cluster PowerSource = 47 { revision 1; // NOTE: Default/not specifically set @@ -2305,21 +2244,6 @@ endpoint 0 { 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 GeneralCommissioning { ram attribute breadcrumb default = 0x0000000000000000; callback attribute basicCommissioningInfo; diff --git a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.zap b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.zap index f63c63c5d33bce..36f42d7a37f794 100644 --- a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.zap +++ b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.zap @@ -867,170 +867,6 @@ } ] }, - { - "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": "General Commissioning", "code": 48, diff --git a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter index cf4d7159fdbf52..0ed458712aabf7 100644 --- a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter +++ b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter @@ -643,67 +643,6 @@ cluster OtaSoftwareUpdateRequestor = 42 { 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 @@ -1712,21 +1651,6 @@ endpoint 0 { 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 = 0; ram attribute featureMap default = 0x1; diff --git a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.zap b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.zap index 5a1f1389e3fc87..b2a1e2c7bbb3ed 100644 --- a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.zap +++ b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.zap @@ -929,170 +929,6 @@ } ] }, - { - "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, diff --git a/examples/thread-br-app/thread-br-common/thread-br-app.matter b/examples/thread-br-app/thread-br-common/thread-br-app.matter index 9498dee8be25d3..a86d28ec5dac8e 100644 --- a/examples/thread-br-app/thread-br-common/thread-br-app.matter +++ b/examples/thread-br-app/thread-br-common/thread-br-app.matter @@ -489,67 +489,6 @@ cluster BasicInformation = 40 { command MfgSpecificPing(): DefaultSuccess = 0; } -/** Nodes should be expected to be deployed to any and all regions of the world. These global regions - may have differing common languages, units of measurements, and numerical formatting - standards. As such, Nodes that visually or audibly convey information need a mechanism by which - they can be configured to use a user’s preferred language, units, etc */ -cluster LocalizationConfiguration = 43 { - revision 1; // NOTE: Default/not specifically set - - attribute access(write: manage) char_string<35> activeLocale = 0; - readonly attribute char_string supportedLocales[] = 1; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; -} - -/** 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; -} - /** This cluster is used to manage global aspects of the Commissioning flow. */ cluster GeneralCommissioning = 48 { revision 1; // NOTE: Default/not specifically set @@ -1511,21 +1450,6 @@ endpoint 0 { ram attribute clusterRevision default = 3; } - 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 GeneralCommissioning { ram attribute breadcrumb default = 0x0000000000000000; callback attribute basicCommissioningInfo; diff --git a/examples/thread-br-app/thread-br-common/thread-br-app.zap b/examples/thread-br-app/thread-br-common/thread-br-app.zap index cad9d37b2d6286..09f5a2e3a90442 100644 --- a/examples/thread-br-app/thread-br-common/thread-br-app.zap +++ b/examples/thread-br-app/thread-br-common/thread-br-app.zap @@ -770,170 +770,6 @@ } ] }, - { - "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": "General Commissioning", "code": 48, diff --git a/examples/window-app/common/window-app.matter b/examples/window-app/common/window-app.matter index 61a8208e0cb4bf..fa7b8e536fdfe2 100644 --- a/examples/window-app/common/window-app.matter +++ b/examples/window-app/common/window-app.matter @@ -770,67 +770,6 @@ cluster OtaSoftwareUpdateRequestor = 42 { 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 @@ -2464,29 +2403,6 @@ endpoint 0 { handle command AnnounceOTAProvider; } - server cluster LocalizationConfiguration { - persist attribute activeLocale default = "en-US"; - callback attribute supportedLocales; - callback attribute generatedCommandList; - callback attribute acceptedCommandList; - callback attribute eventList; - callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - - server cluster TimeFormatLocalization { - persist attribute hourFormat default = 0; - persist attribute activeCalendarType default = 0; - callback attribute supportedCalendarTypes; - callback attribute generatedCommandList; - callback attribute acceptedCommandList; - callback attribute eventList; - callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - server cluster UnitLocalization { callback attribute generatedCommandList; callback attribute acceptedCommandList; diff --git a/examples/window-app/common/window-app.zap b/examples/window-app/common/window-app.zap index 7610434e4517e6..85c01e1e6b52ff 100644 --- a/examples/window-app/common/window-app.zap +++ b/examples/window-app/common/window-app.zap @@ -1113,298 +1113,6 @@ } ] }, - { - "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": "GeneratedCommandList", - "code": 65528, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AcceptedCommandList", - "code": 65529, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "EventList", - "code": 65530, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AttributeList", - "code": 65531, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, - { - "name": "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": "GeneratedCommandList", - "code": 65528, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AcceptedCommandList", - "code": 65529, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "EventList", - "code": 65530, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AttributeList", - "code": 65531, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, { "name": "Unit Localization", "code": 45,