From b56bb6b32d4efaec0b2a36b81b7854d642a6cc47 Mon Sep 17 00:00:00 2001 From: lpbeliveau-silabs <112982107+lpbeliveau-silabs@users.noreply.github.com> Date: Tue, 31 Oct 2023 21:41:34 -0400 Subject: [PATCH] [Scenes] Cleanup zap for name support (#29712) * Added missing checks on feature map for name support attribute in init * Changed type of NameSupportAttribute to new type * Fix darwin availability annotations. * Regenerated zap files --------- Co-authored-by: Boris Zbarsky --- .../all-clusters-common/all-clusters-app.matter | 12 ++++++++---- .../all-clusters-minimal-app.matter | 10 +++++++--- .../light-switch-common/light-switch-app.matter | 12 ++++++++---- .../lighting-common/lighting-app.matter | 12 ++++++++---- .../data_model/lighting-thread-app.matter | 12 ++++++++---- .../silabs/data_model/lighting-wifi-app.matter | 12 ++++++++---- .../placeholder/linux/apps/app1/config.matter | 10 +++++++--- .../placeholder/linux/apps/app2/config.matter | 10 +++++++--- .../nxp/zap/thermostat_matter_thread.matter | 10 +++++++--- .../nxp/zap/thermostat_matter_wifi.matter | 10 +++++++--- .../virtual-device-app.matter | 10 +++++++--- .../clusters/scenes-server/scenes-server.cpp | 14 ++++++-------- .../zap-templates/zcl/data-model/chip/scene.xml | 11 ++++++++--- .../data_model/controller-clusters.matter | 12 ++++++++---- .../CHIPAttributeTLVValueDecoder.cpp | 2 +- src/controller/python/chip/clusters/Objects.py | 7 +++++-- .../Framework/CHIP/templates/availability.yaml | 14 ++++++++++++++ .../MTRAttributeTLVValueDecoder.mm | 2 +- .../CHIP/zap-generated/MTRBaseClusters.h | 17 ++++++++++++++--- .../zap-generated/attributes/Accessors.cpp | 8 ++++---- .../zap-generated/attributes/Accessors.h | 5 +++-- .../app-common/zap-generated/cluster-enums.h | 12 +++++++++--- .../app-common/zap-generated/cluster-objects.h | 13 +++++++------ .../chip-tool/zap-generated/cluster/Commands.h | 4 ++-- .../cluster/logging/DataModelLogger.cpp | 2 +- 25 files changed, 165 insertions(+), 78 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 96bf1a611debb3..48fdd6adb10f6f 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 @@ -118,6 +118,10 @@ server cluster Groups = 4 { /** Attributes and commands for scene configuration and manipulation. */ provisional server cluster Scenes = 5 { + bitmap CopyModeBitmap : bitmap8 { + kCopyAllScenes = 0x1; + } + bitmap Feature : bitmap32 { kSceneNames = 0x1; kExplicit = 0x2; @@ -125,8 +129,8 @@ provisional server cluster Scenes = 5 { kFabricScenes = 0x8; } - bitmap ScenesCopyMode : bitmap8 { - kCopyAllScenes = 0x1; + bitmap NameSupportBitmap : bitmap8 { + kSceneNames = 0x80; } struct AttributeValuePair { @@ -143,7 +147,7 @@ provisional server cluster Scenes = 5 { readonly attribute int8u currentScene = 1; readonly attribute group_id currentGroup = 2; readonly attribute boolean sceneValid = 3; - readonly attribute bitmap8 nameSupport = 4; + readonly attribute NameSupportBitmap nameSupport = 4; readonly attribute nullable node_id lastConfiguredBy = 5; readonly attribute int16u sceneTableSize = 6; readonly attribute int8u remainingCapacity = 7; @@ -205,7 +209,7 @@ provisional server cluster Scenes = 5 { } request struct CopySceneRequest { - ScenesCopyMode mode = 0; + CopyModeBitmap mode = 0; group_id groupIdentifierFrom = 1; int8u sceneIdentifierFrom = 2; group_id groupIdentifierTo = 3; 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 d80602ebfc5633..8a69d89ed9222d 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 @@ -118,6 +118,10 @@ server cluster Groups = 4 { /** Attributes and commands for scene configuration and manipulation. */ provisional server cluster Scenes = 5 { + bitmap CopyModeBitmap : bitmap8 { + kCopyAllScenes = 0x1; + } + bitmap Feature : bitmap32 { kSceneNames = 0x1; kExplicit = 0x2; @@ -125,8 +129,8 @@ provisional server cluster Scenes = 5 { kFabricScenes = 0x8; } - bitmap ScenesCopyMode : bitmap8 { - kCopyAllScenes = 0x1; + bitmap NameSupportBitmap : bitmap8 { + kSceneNames = 0x80; } struct AttributeValuePair { @@ -143,7 +147,7 @@ provisional server cluster Scenes = 5 { readonly attribute int8u currentScene = 1; readonly attribute group_id currentGroup = 2; readonly attribute boolean sceneValid = 3; - readonly attribute bitmap8 nameSupport = 4; + readonly attribute NameSupportBitmap nameSupport = 4; readonly attribute nullable node_id lastConfiguredBy = 5; readonly attribute int16u sceneTableSize = 6; readonly attribute int8u remainingCapacity = 7; 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 74028e4ef9f8ae..868aa36967f642 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 @@ -166,6 +166,10 @@ server cluster Groups = 4 { /** Attributes and commands for scene configuration and manipulation. */ provisional client cluster Scenes = 5 { + bitmap CopyModeBitmap : bitmap8 { + kCopyAllScenes = 0x1; + } + bitmap Feature : bitmap32 { kSceneNames = 0x1; kExplicit = 0x2; @@ -173,8 +177,8 @@ provisional client cluster Scenes = 5 { kFabricScenes = 0x8; } - bitmap ScenesCopyMode : bitmap8 { - kCopyAllScenes = 0x1; + bitmap NameSupportBitmap : bitmap8 { + kSceneNames = 0x80; } struct AttributeValuePair { @@ -191,7 +195,7 @@ provisional client cluster Scenes = 5 { readonly attribute int8u currentScene = 1; readonly attribute group_id currentGroup = 2; readonly attribute boolean sceneValid = 3; - readonly attribute bitmap8 nameSupport = 4; + readonly attribute NameSupportBitmap nameSupport = 4; readonly attribute optional nullable node_id lastConfiguredBy = 5; readonly attribute int16u sceneTableSize = 6; readonly attribute int8u remainingCapacity = 7; @@ -307,7 +311,7 @@ provisional client cluster Scenes = 5 { } request struct CopySceneRequest { - ScenesCopyMode mode = 0; + CopyModeBitmap mode = 0; group_id groupIdentifierFrom = 1; int8u sceneIdentifierFrom = 2; group_id groupIdentifierTo = 3; diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index 3ff6f8d4ede74f..7874b41f683300 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -118,6 +118,10 @@ server cluster Groups = 4 { /** Attributes and commands for scene configuration and manipulation. */ provisional server cluster Scenes = 5 { + bitmap CopyModeBitmap : bitmap8 { + kCopyAllScenes = 0x1; + } + bitmap Feature : bitmap32 { kSceneNames = 0x1; kExplicit = 0x2; @@ -125,8 +129,8 @@ provisional server cluster Scenes = 5 { kFabricScenes = 0x8; } - bitmap ScenesCopyMode : bitmap8 { - kCopyAllScenes = 0x1; + bitmap NameSupportBitmap : bitmap8 { + kSceneNames = 0x80; } struct AttributeValuePair { @@ -143,7 +147,7 @@ provisional server cluster Scenes = 5 { readonly attribute int8u currentScene = 1; readonly attribute group_id currentGroup = 2; readonly attribute boolean sceneValid = 3; - readonly attribute bitmap8 nameSupport = 4; + readonly attribute NameSupportBitmap nameSupport = 4; readonly attribute nullable node_id lastConfiguredBy = 5; readonly attribute int16u sceneTableSize = 6; readonly attribute int8u remainingCapacity = 7; @@ -205,7 +209,7 @@ provisional server cluster Scenes = 5 { } request struct CopySceneRequest { - ScenesCopyMode mode = 0; + CopyModeBitmap mode = 0; group_id groupIdentifierFrom = 1; int8u sceneIdentifierFrom = 2; group_id groupIdentifierTo = 3; 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 551342811a2428..8c228875e3e8eb 100644 --- a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter @@ -118,6 +118,10 @@ server cluster Groups = 4 { /** Attributes and commands for scene configuration and manipulation. */ provisional server cluster Scenes = 5 { + bitmap CopyModeBitmap : bitmap8 { + kCopyAllScenes = 0x1; + } + bitmap Feature : bitmap32 { kSceneNames = 0x1; kExplicit = 0x2; @@ -125,8 +129,8 @@ provisional server cluster Scenes = 5 { kFabricScenes = 0x8; } - bitmap ScenesCopyMode : bitmap8 { - kCopyAllScenes = 0x1; + bitmap NameSupportBitmap : bitmap8 { + kSceneNames = 0x80; } struct AttributeValuePair { @@ -143,7 +147,7 @@ provisional server cluster Scenes = 5 { readonly attribute int8u currentScene = 1; readonly attribute group_id currentGroup = 2; readonly attribute boolean sceneValid = 3; - readonly attribute bitmap8 nameSupport = 4; + readonly attribute NameSupportBitmap nameSupport = 4; readonly attribute nullable node_id lastConfiguredBy = 5; readonly attribute int16u sceneTableSize = 6; readonly attribute int8u remainingCapacity = 7; @@ -205,7 +209,7 @@ provisional server cluster Scenes = 5 { } request struct CopySceneRequest { - ScenesCopyMode mode = 0; + CopyModeBitmap mode = 0; group_id groupIdentifierFrom = 1; int8u sceneIdentifierFrom = 2; group_id groupIdentifierTo = 3; 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 404029c1978ca1..144717de3cf5f4 100644 --- a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter @@ -118,6 +118,10 @@ server cluster Groups = 4 { /** Attributes and commands for scene configuration and manipulation. */ provisional server cluster Scenes = 5 { + bitmap CopyModeBitmap : bitmap8 { + kCopyAllScenes = 0x1; + } + bitmap Feature : bitmap32 { kSceneNames = 0x1; kExplicit = 0x2; @@ -125,8 +129,8 @@ provisional server cluster Scenes = 5 { kFabricScenes = 0x8; } - bitmap ScenesCopyMode : bitmap8 { - kCopyAllScenes = 0x1; + bitmap NameSupportBitmap : bitmap8 { + kSceneNames = 0x80; } struct AttributeValuePair { @@ -143,7 +147,7 @@ provisional server cluster Scenes = 5 { readonly attribute int8u currentScene = 1; readonly attribute group_id currentGroup = 2; readonly attribute boolean sceneValid = 3; - readonly attribute bitmap8 nameSupport = 4; + readonly attribute NameSupportBitmap nameSupport = 4; readonly attribute nullable node_id lastConfiguredBy = 5; readonly attribute int16u sceneTableSize = 6; readonly attribute int8u remainingCapacity = 7; @@ -205,7 +209,7 @@ provisional server cluster Scenes = 5 { } request struct CopySceneRequest { - ScenesCopyMode mode = 0; + CopyModeBitmap mode = 0; group_id groupIdentifierFrom = 1; int8u sceneIdentifierFrom = 2; group_id groupIdentifierTo = 3; diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index b11384ba3b829d..9c8f973de9a8f1 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -166,6 +166,10 @@ server cluster Groups = 4 { /** Attributes and commands for scene configuration and manipulation. */ provisional server cluster Scenes = 5 { + bitmap CopyModeBitmap : bitmap8 { + kCopyAllScenes = 0x1; + } + bitmap Feature : bitmap32 { kSceneNames = 0x1; kExplicit = 0x2; @@ -173,8 +177,8 @@ provisional server cluster Scenes = 5 { kFabricScenes = 0x8; } - bitmap ScenesCopyMode : bitmap8 { - kCopyAllScenes = 0x1; + bitmap NameSupportBitmap : bitmap8 { + kSceneNames = 0x80; } struct AttributeValuePair { @@ -191,7 +195,7 @@ provisional server cluster Scenes = 5 { readonly attribute int8u currentScene = 1; readonly attribute group_id currentGroup = 2; readonly attribute boolean sceneValid = 3; - readonly attribute bitmap8 nameSupport = 4; + readonly attribute NameSupportBitmap nameSupport = 4; readonly attribute int16u sceneTableSize = 6; readonly attribute int8u remainingCapacity = 7; readonly attribute command_id generatedCommandList[] = 65528; diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 6ab8cec8fd39ad..b6de3ec30f2df4 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -166,6 +166,10 @@ server cluster Groups = 4 { /** Attributes and commands for scene configuration and manipulation. */ provisional server cluster Scenes = 5 { + bitmap CopyModeBitmap : bitmap8 { + kCopyAllScenes = 0x1; + } + bitmap Feature : bitmap32 { kSceneNames = 0x1; kExplicit = 0x2; @@ -173,8 +177,8 @@ provisional server cluster Scenes = 5 { kFabricScenes = 0x8; } - bitmap ScenesCopyMode : bitmap8 { - kCopyAllScenes = 0x1; + bitmap NameSupportBitmap : bitmap8 { + kSceneNames = 0x80; } struct AttributeValuePair { @@ -191,7 +195,7 @@ provisional server cluster Scenes = 5 { readonly attribute int8u currentScene = 1; readonly attribute group_id currentGroup = 2; readonly attribute boolean sceneValid = 3; - readonly attribute bitmap8 nameSupport = 4; + readonly attribute NameSupportBitmap nameSupport = 4; readonly attribute int16u sceneTableSize = 6; readonly attribute int8u remainingCapacity = 7; readonly attribute command_id generatedCommandList[] = 65528; diff --git a/examples/thermostat/nxp/zap/thermostat_matter_thread.matter b/examples/thermostat/nxp/zap/thermostat_matter_thread.matter index 6c00996c41eaca..aeb41da2c13fe0 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_thread.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_thread.matter @@ -160,6 +160,10 @@ server cluster Groups = 4 { /** Attributes and commands for scene configuration and manipulation. */ provisional server cluster Scenes = 5 { + bitmap CopyModeBitmap : bitmap8 { + kCopyAllScenes = 0x1; + } + bitmap Feature : bitmap32 { kSceneNames = 0x1; kExplicit = 0x2; @@ -167,8 +171,8 @@ provisional server cluster Scenes = 5 { kFabricScenes = 0x8; } - bitmap ScenesCopyMode : bitmap8 { - kCopyAllScenes = 0x1; + bitmap NameSupportBitmap : bitmap8 { + kSceneNames = 0x80; } struct AttributeValuePair { @@ -185,7 +189,7 @@ provisional server cluster Scenes = 5 { readonly attribute int8u currentScene = 1; readonly attribute group_id currentGroup = 2; readonly attribute boolean sceneValid = 3; - readonly attribute bitmap8 nameSupport = 4; + readonly attribute NameSupportBitmap nameSupport = 4; readonly attribute int16u sceneTableSize = 6; readonly attribute int8u remainingCapacity = 7; readonly attribute command_id generatedCommandList[] = 65528; diff --git a/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter b/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter index 7123a0dadf1874..d58570d607ab75 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter @@ -160,6 +160,10 @@ server cluster Groups = 4 { /** Attributes and commands for scene configuration and manipulation. */ provisional server cluster Scenes = 5 { + bitmap CopyModeBitmap : bitmap8 { + kCopyAllScenes = 0x1; + } + bitmap Feature : bitmap32 { kSceneNames = 0x1; kExplicit = 0x2; @@ -167,8 +171,8 @@ provisional server cluster Scenes = 5 { kFabricScenes = 0x8; } - bitmap ScenesCopyMode : bitmap8 { - kCopyAllScenes = 0x1; + bitmap NameSupportBitmap : bitmap8 { + kSceneNames = 0x80; } struct AttributeValuePair { @@ -185,7 +189,7 @@ provisional server cluster Scenes = 5 { readonly attribute int8u currentScene = 1; readonly attribute group_id currentGroup = 2; readonly attribute boolean sceneValid = 3; - readonly attribute bitmap8 nameSupport = 4; + readonly attribute NameSupportBitmap nameSupport = 4; readonly attribute int16u sceneTableSize = 6; readonly attribute int8u remainingCapacity = 7; readonly attribute command_id generatedCommandList[] = 65528; diff --git a/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter b/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter index 41a46c5c47d3ac..984821d90c715c 100644 --- a/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter +++ b/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter @@ -118,6 +118,10 @@ server cluster Groups = 4 { /** Attributes and commands for scene configuration and manipulation. */ provisional server cluster Scenes = 5 { + bitmap CopyModeBitmap : bitmap8 { + kCopyAllScenes = 0x1; + } + bitmap Feature : bitmap32 { kSceneNames = 0x1; kExplicit = 0x2; @@ -125,8 +129,8 @@ provisional server cluster Scenes = 5 { kFabricScenes = 0x8; } - bitmap ScenesCopyMode : bitmap8 { - kCopyAllScenes = 0x1; + bitmap NameSupportBitmap : bitmap8 { + kSceneNames = 0x80; } struct AttributeValuePair { @@ -143,7 +147,7 @@ provisional server cluster Scenes = 5 { readonly attribute int8u currentScene = 1; readonly attribute group_id currentGroup = 2; readonly attribute boolean sceneValid = 3; - readonly attribute bitmap8 nameSupport = 4; + readonly attribute NameSupportBitmap nameSupport = 4; readonly attribute int16u sceneTableSize = 6; readonly attribute int8u remainingCapacity = 7; readonly attribute command_id generatedCommandList[] = 65528; diff --git a/src/app/clusters/scenes-server/scenes-server.cpp b/src/app/clusters/scenes-server/scenes-server.cpp index 2386e2155d6722..08f92596757309 100644 --- a/src/app/clusters/scenes-server/scenes-server.cpp +++ b/src/app/clusters/scenes-server/scenes-server.cpp @@ -119,13 +119,11 @@ CHIP_ERROR ScenesServer::Init() EmberAfStatus status = Attributes::FeatureMap::Get(endpoint, &featureMap); if (EMBER_ZCL_STATUS_SUCCESS == status) { - // Setting NameSupport attribute value to 0x80 if the feature bit is set - // The bit of 7 (0x80) the NameSupport attribute indicates whether or not scene names are supported - // - // According to spec, bit 7 (Scene Names) MUST match feature bit 0 (Scene Names) - uint8_t nameSupport = - (featureMap & to_underlying(Feature::kSceneNames)) ? static_cast(0x80) : static_cast(0x00); - status = Attributes::NameSupport::Set(endpoint, nameSupport); + // According to spec, bit 7 MUST match feature bit 0 (SceneNames) + BitMask nameSupport = (featureMap & to_underlying(Feature::kSceneNames)) + ? BitMask(NameSupportBitmap::kSceneNames) + : BitMask(); + status = Attributes::NameSupport::Set(endpoint, nameSupport); if (EMBER_ZCL_STATUS_SUCCESS != status) { ChipLogDetail(Zcl, "ERR: setting NameSupport on Endpoint %hu Status: %x", endpoint, status); @@ -851,7 +849,7 @@ void ScenesServer::HandleCopyScene(HandlerContext & ctx, const Commands::CopySce sceneTable->GetRemainingCapacity(ctx.mCommandHandler.GetAccessingFabricIndex(), capacity))); // Checks if we copy a single scene or all of them - if (req.mode.GetField(app::Clusters::Scenes::ScenesCopyMode::kCopyAllScenes)) + if (req.mode.GetField(app::Clusters::Scenes::CopyModeBitmap::kCopyAllScenes)) { // Scene Table interface data SceneId scenesInGroup[scenes::kMaxScenesPerFabric]; diff --git a/src/app/zap-templates/zcl/data-model/chip/scene.xml b/src/app/zap-templates/zcl/data-model/chip/scene.xml index 43b63e67409b37..69455e4de08469 100644 --- a/src/app/zap-templates/zcl/data-model/chip/scene.xml +++ b/src/app/zap-templates/zcl/data-model/chip/scene.xml @@ -15,7 +15,12 @@ See the License for the specific language governing permissions and limitations under the License. --> - + + + + + + @@ -47,7 +52,7 @@ limitations under the License. CurrentScene CurrentGroup SceneValid - NameSupport + NameSupport LastConfiguredBy SceneTableSize RemainingCapacity @@ -134,7 +139,7 @@ limitations under the License. Allows a client to efficiently copy scenes from one group/scene identifier pair to another group/scene identifier pair. - + diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index d10f65b38f9b6e..ae8aed40bf7e40 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -126,6 +126,10 @@ client cluster Groups = 4 { /** Attributes and commands for scene configuration and manipulation. */ provisional client cluster Scenes = 5 { + bitmap CopyModeBitmap : bitmap8 { + kCopyAllScenes = 0x1; + } + bitmap Feature : bitmap32 { kSceneNames = 0x1; kExplicit = 0x2; @@ -133,8 +137,8 @@ provisional client cluster Scenes = 5 { kFabricScenes = 0x8; } - bitmap ScenesCopyMode : bitmap8 { - kCopyAllScenes = 0x1; + bitmap NameSupportBitmap : bitmap8 { + kSceneNames = 0x80; } struct AttributeValuePair { @@ -151,7 +155,7 @@ provisional client cluster Scenes = 5 { readonly attribute int8u currentScene = 1; readonly attribute group_id currentGroup = 2; readonly attribute boolean sceneValid = 3; - readonly attribute bitmap8 nameSupport = 4; + readonly attribute NameSupportBitmap nameSupport = 4; readonly attribute optional nullable node_id lastConfiguredBy = 5; readonly attribute int16u sceneTableSize = 6; readonly attribute int8u remainingCapacity = 7; @@ -267,7 +271,7 @@ provisional client cluster Scenes = 5 { } request struct CopySceneRequest { - ScenesCopyMode mode = 0; + CopyModeBitmap mode = 0; group_id groupIdentifierFrom = 1; int8u sceneIdentifierFrom = 2; group_id groupIdentifierTo = 3; diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index 05f84ea0041019..b78186b015e332 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -448,7 +448,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jobject value; std::string valueClassName = "java/lang/Integer"; std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); + jint jnivalue = static_cast(cppValue.Raw()); chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, value); return value; diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 4ee0663a3ef736..216dde98086885 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -622,14 +622,17 @@ def descriptor(cls) -> ClusterObjectDescriptor: clusterRevision: 'uint' = None class Bitmaps: + class CopyModeBitmap(IntFlag): + kCopyAllScenes = 0x1 + class Feature(IntFlag): kSceneNames = 0x1 kExplicit = 0x2 kTableSize = 0x4 kFabricScenes = 0x8 - class ScenesCopyMode(IntFlag): - kCopyAllScenes = 0x1 + class NameSupportBitmap(IntFlag): + kSceneNames = 0x80 class Structs: @dataclass diff --git a/src/darwin/Framework/CHIP/templates/availability.yaml b/src/darwin/Framework/CHIP/templates/availability.yaml index abe0c77d9ec5b7..d7b9f200956d9e 100644 --- a/src/darwin/Framework/CHIP/templates/availability.yaml +++ b/src/darwin/Framework/CHIP/templates/availability.yaml @@ -7730,12 +7730,20 @@ versions: "future" introduced: bitmaps: + Scenes: + - CopyModeBitmap + - NameSupportBitmap AdministratorCommissioning: - Feature bitmap values: PumpConfigurationAndControl: PumpStatusBitmap: - SupplyFault + Scenes: + CopyModeBitmap: + - CopyAllScenes + NameSupportBitmap: + - SceneNames SoftwareDiagnostics: Feature: - Watermarks @@ -7743,6 +7751,9 @@ Feature: - Basic deprecated: + bitmaps: + Scenes: + - ScenesCopyMode bitmap values: PumpConfigurationAndControl: PumpStatusBitmap: @@ -7767,6 +7778,9 @@ # Targeting Spring 2024 Matter release - ThreadCapabilitiesBitmap renames: + bitmaps: + Scenes: + CopyModeBitmap: ScenesCopyMode bitmap values: PumpConfigurationAndControl: PumpStatusBitmap: diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index f6594bfd3a1e5a..80e2bed641acef 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -286,7 +286,7 @@ static id _Nullable DecodeAttributeValueForScenesCluster(AttributeId aAttributeI return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; return value; } case Attributes::LastConfiguredBy::Id: { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index ba9b2092fc0abf..7e4cd17bf0cf57 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -13388,6 +13388,17 @@ typedef NS_OPTIONS(uint8_t, MTRGroupsNameSupportBitmap) { MTRGroupsNameSupportBitmapGroupNames MTR_AVAILABLE(ios(17.0), macos(14.0), watchos(10.0), tvos(17.0)) = 0x80, } MTR_AVAILABLE(ios(17.0), macos(14.0), watchos(10.0), tvos(17.0)); +typedef NS_OPTIONS(uint8_t, MTRScenesCopyModeBitmap) { + MTRScenesCopyModeBitmapCopyAllScenes MTR_NEWLY_AVAILABLE = 0x1, +} MTR_NEWLY_AVAILABLE; + +typedef NS_OPTIONS(uint8_t, MTRScenesCopyMode) { + MTRScenesCopyModeCopyAllScenes MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRScenesCopyModeBitmapCopyAllScenes") + = 0x1, +} MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRScenesCopyModeBitmap"); + typedef NS_OPTIONS(uint32_t, MTRScenesFeature) { MTRScenesFeatureSceneNames MTR_AVAILABLE(ios(17.0), macos(14.0), watchos(10.0), tvos(17.0)) = 0x1, MTRScenesFeatureExplicit MTR_PROVISIONALLY_AVAILABLE = 0x2, @@ -13395,9 +13406,9 @@ typedef NS_OPTIONS(uint32_t, MTRScenesFeature) { MTRScenesFeatureFabricScenes MTR_PROVISIONALLY_AVAILABLE = 0x8, } MTR_AVAILABLE(ios(17.0), macos(14.0), watchos(10.0), tvos(17.0)); -typedef NS_OPTIONS(uint8_t, MTRScenesCopyMode) { - MTRScenesCopyModeCopyAllScenes MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x1, -} MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +typedef NS_OPTIONS(uint8_t, MTRScenesNameSupportBitmap) { + MTRScenesNameSupportBitmapSceneNames MTR_NEWLY_AVAILABLE = 0x80, +} MTR_NEWLY_AVAILABLE; typedef NS_ENUM(uint8_t, MTROnOffDelayedAllOffEffectVariant) { MTROnOffDelayedAllOffEffectVariantDelayedOffFastFade MTR_AVAILABLE(ios(17.2), macos(14.2), watchos(10.2), tvos(17.2)) = 0x00, diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp index 9b37a5f2b3634f..89d6c8f9673530 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp @@ -363,9 +363,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value) namespace NameSupport { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::BitMask * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits>; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::Scenes::Id, Id, readable, sizeof(temp)); @@ -377,9 +377,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) *value = Traits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index db36e68bedfd0d..ab3e2bad0d1cb0 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h @@ -100,8 +100,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value); } // namespace SceneValid namespace NameSupport { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +EmberAfStatus Get(chip::EndpointId endpoint, + chip::BitMask * value); // NameSupportBitmap +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value); } // namespace NameSupport namespace LastConfiguredBy { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h index 7ce7b602e43144..1b229194a23e25 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h @@ -90,6 +90,12 @@ enum class NameSupportBitmap : uint8_t namespace Scenes { +// Bitmap for CopyModeBitmap +enum class CopyModeBitmap : uint8_t +{ + kCopyAllScenes = 0x1, +}; + // Bitmap for Feature enum class Feature : uint32_t { @@ -99,10 +105,10 @@ enum class Feature : uint32_t kFabricScenes = 0x8, }; -// Bitmap for ScenesCopyMode -enum class ScenesCopyMode : uint8_t +// Bitmap for NameSupportBitmap +enum class NameSupportBitmap : uint8_t { - kCopyAllScenes = 0x1, + kSceneNames = 0x80, }; } // namespace Scenes diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 91c37ab7cf81c3..5253bd5eaef4f2 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -1739,7 +1739,7 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::CopyScene::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } - chip::BitMask mode = static_cast>(0); + chip::BitMask mode = static_cast>(0); chip::GroupId groupIdentifierFrom = static_cast(0); uint8_t sceneIdentifierFrom = static_cast(0); chip::GroupId groupIdentifierTo = static_cast(0); @@ -1758,7 +1758,7 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::CopyScene::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } - chip::BitMask mode = static_cast>(0); + chip::BitMask mode = static_cast>(0); chip::GroupId groupIdentifierFrom = static_cast(0); uint8_t sceneIdentifierFrom = static_cast(0); chip::GroupId groupIdentifierTo = static_cast(0); @@ -1859,9 +1859,9 @@ struct TypeInfo namespace NameSupport { struct TypeInfo { - using Type = uint8_t; - using DecodableType = uint8_t; - using DecodableArgType = uint8_t; + using Type = chip::BitMask; + using DecodableType = chip::BitMask; + using DecodableArgType = chip::BitMask; static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NameSupport::Id; } @@ -1953,7 +1953,8 @@ struct TypeInfo Attributes::CurrentScene::TypeInfo::DecodableType currentScene = static_cast(0); Attributes::CurrentGroup::TypeInfo::DecodableType currentGroup = static_cast(0); Attributes::SceneValid::TypeInfo::DecodableType sceneValid = static_cast(0); - Attributes::NameSupport::TypeInfo::DecodableType nameSupport = static_cast(0); + Attributes::NameSupport::TypeInfo::DecodableType nameSupport = + static_cast>(0); Attributes::LastConfiguredBy::TypeInfo::DecodableType lastConfiguredBy; Attributes::SceneTableSize::TypeInfo::DecodableType sceneTableSize = static_cast(0); Attributes::RemainingCapacity::TypeInfo::DecodableType remainingCapacity = static_cast(0); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index cc4b4110263688..bc8d7d9586fad8 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -11794,8 +11794,8 @@ void registerClusterScenes(Commands & commands, CredentialIssuerCommands * creds WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>(Id, "scene-valid", 0, 1, Attributes::SceneValid::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "name-support", 0, UINT8_MAX, Attributes::NameSupport::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "name-support", 0, UINT8_MAX, Attributes::NameSupport::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>>( Id, "last-configured-by", 0, UINT64_MAX, Attributes::LastConfiguredBy::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index bfc126a803e51e..b745371e19bc0f 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -5206,7 +5206,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP return DataModelLogger::LogValue("SceneValid", 1, value); } case Scenes::Attributes::NameSupport::Id: { - uint8_t value; + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("NameSupport", 1, value); }