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 7f3601b0078991..947e4b70a5ebc2 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 { @@ -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 e2ee1bc8b3f7ce..3e8762198e55ef 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 { diff --git a/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter b/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter index b85baa83661958..be20f63dee2c36 100644 --- a/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter +++ b/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter @@ -1332,5 +1332,3 @@ endpoint 1 { handle command OperationalCommandResponse; } } - - 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 625104b359a561..d4cabbd5cc3f15 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 { @@ -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 d2949059cc557e..e1c627f85b0046 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 { @@ -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 7fba724a460eac..793785e7f8a926 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 { @@ -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 7a76484abf4fa3..d2089eaf013066 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 { @@ -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 5ff8d4573fef7f..bbcf4f3b856a56 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 { diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 4250eaf837efb1..e02fcafc80913e 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 { 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 5910114fc99122..306536bcaf89bc 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 { 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..99dbbce533e414 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. --> - + + + + + + @@ -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 caabe18f4fa4b4..3ae30e742cecc2 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 { @@ -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/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index e67077ba62feb3..7c823c4f767808 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/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 43dde2ac143c4e..93eb24ccd1f349 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -13268,6 +13268,10 @@ 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_PROVISIONALLY_AVAILABLE = 0x1, +} MTR_PROVISIONALLY_AVAILABLE; + 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, @@ -13275,9 +13279,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_PROVISIONALLY_AVAILABLE = 0x80, +} MTR_PROVISIONALLY_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/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h index 67788b9dd4318d..46ac55b1d39446 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 26ad7ac20b2b50..5c537d798e30be 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);