Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Scenes] Enabling the scene-cluster #26186

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
c93f176
Merge for rebase onto master
lpbeliveau-silabs Nov 7, 2022
c41252e
Restyled by whitespace
restyled-commits Apr 20, 2023
dd8937e
fixed shadowing in InvokeCommand, modified scenes to scenes-server in…
lpbeliveau-silabs Apr 20, 2023
1b4e9e8
Regenerated zap files and .matter files for lighting app with Scenes
lpbeliveau-silabs Apr 21, 2023
b87d8bd
Modified CMakeList for lighting app to include scene src files
lpbeliveau-silabs Apr 24, 2023
d6092d4
Apply suggestions from code review, swapped checks on groupId != 0, r…
lpbeliveau-silabs May 12, 2023
ff7a3c0
Removed scenes-tokens.h
lpbeliveau-silabs May 17, 2023
bcf73c8
removed scenes-token.h for test's BUID.gn
lpbeliveau-silabs May 17, 2023
1113427
Regenerated zap files
lpbeliveau-silabs May 17, 2023
25d7529
Rework of endpoint scope in progress
lpbeliveau-silabs May 18, 2023
be9f34d
Completed refactor of SceneTable to have per endpoint flash storage, …
lpbeliveau-silabs May 19, 2023
09a91e6
WIP for Attributes handling, needs to add checks on status for Sets a…
lpbeliveau-silabs May 19, 2023
cca73d1
Refactored the scenes table and scenes server to be endpoint scoped a…
lpbeliveau-silabs May 23, 2023
e927935
Fix multi-endpoint on scenes-server cluster, updated attribute access…
lpbeliveau-silabs May 24, 2023
9e146de
Restyled by whitespace
restyled-commits May 24, 2023
4a014d1
Restyled by clang-format
restyled-commits May 24, 2023
baf40df
Applied changes to build after rebase and regenerated zap files
lpbeliveau-silabs May 25, 2023
5d4294c
Restyled by shfmt
restyled-commits May 25, 2023
c1fdb13
Fixed uint16 to uint8 conversion issues in SceneTableImpl
lpbeliveau-silabs May 25, 2023
e58843b
Apply suggestions from code review
lpbeliveau-silabs May 26, 2023
0ca1a07
Update src/app/clusters/groups-server/groups-server.cpp
lpbeliveau-silabs May 26, 2023
127078f
Apply suggestions from code review
lpbeliveau-silabs May 26, 2023
bb1a523
Removed un-necessary attribute assignation, added attribute dirtying …
lpbeliveau-silabs May 26, 2023
fe7302f
Added missing description for scene storage key allocators and remove…
lpbeliveau-silabs May 26, 2023
9e93729
Restyled by clang-format
restyled-commits May 26, 2023
b05316b
Restyled by prettier-json
restyled-commits May 26, 2023
312b654
Shadowing fix
lpbeliveau-silabs May 26, 2023
a6a23bf
Update src/lib/support/DefaultStorageKeyAllocator.h
lpbeliveau-silabs May 26, 2023
e97f727
Update src/app/clusters/scenes-server/SceneTableImpl.cpp
lpbeliveau-silabs May 26, 2023
15225a8
Add comment on Storage Keys, removed unused variables in comments and…
lpbeliveau-silabs May 26, 2023
30c51b2
Restyled by clang-format
restyled-commits May 26, 2023
f7dc440
Apply suggestions from code review
lpbeliveau-silabs May 26, 2023
a951398
Removed un-necessary check on transition time
lpbeliveau-silabs May 26, 2023
9693abe
Restyled by whitespace
restyled-commits May 26, 2023
ab58787
Restyled by clang-format
restyled-commits May 26, 2023
17364e3
Added missing uint16_t in loop to mMaxScenesPerFabric
lpbeliveau-silabs May 26, 2023
3c3fefb
Added check on nullptr in TestSceneTable
lpbeliveau-silabs May 26, 2023
df94216
Moved init to MatterScenesPluginServerInitCallback to allow all-clust…
lpbeliveau-silabs May 29, 2023
418768c
Update src/app/clusters/scenes-server/scenes-server.cpp
lpbeliveau-silabs May 30, 2023
84df131
Update src/app/clusters/scenes-server/scenes-server.cpp
lpbeliveau-silabs May 30, 2023
17de6b8
Added using for ScenesServer in Matter init callback
lpbeliveau-silabs May 30, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5072,14 +5072,14 @@ endpoint 1 {
}

server cluster Scenes {
ram attribute sceneCount default = 0x00;
callback attribute sceneCount default = 0x00;
ram attribute currentScene default = 0x00;
ram attribute currentGroup default = 0x0000;
ram attribute sceneValid default = 0x00;
ram attribute nameSupport;
ram attribute lastConfiguredBy;
ram attribute sceneTableSize;
ram attribute remainingCapacity;
callback attribute remainingCapacity;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 4;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/all-clusters-app/esp32/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ set(SRC_DIRS_LIST
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thermostat-user-interface-configuration-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thread-network-diagnostics-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/channel-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/scenes"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/scenes-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/software-diagnostics-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/switch-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-diagnostics-server"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4181,14 +4181,14 @@ endpoint 1 {
}

server cluster Scenes {
ram attribute sceneCount default = 0x00;
callback attribute sceneCount default = 0x00;
ram attribute currentScene default = 0x00;
ram attribute currentGroup default = 0x0000;
ram attribute sceneValid default = 0x00;
ram attribute nameSupport;
ram attribute lastConfiguredBy;
ram attribute sceneTableSize;
ram attribute remainingCapacity;
callback attribute remainingCapacity;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 4;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ set(SRC_DIRS_LIST
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thermostat-user-interface-configuration-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thread-network-diagnostics-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/channel-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/scenes"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/scenes-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/software-diagnostics-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/switch-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-diagnostics-server"
Expand Down
1 change: 1 addition & 0 deletions examples/lighting-app/esp32/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ set(SRC_DIRS_LIST
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ota-requestor"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/groups-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/group-key-mgmt-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/scenes-server"
)

set(PRIV_REQUIRES_LIST chip QRCode bt led_strip app_update openthread driver nvs_flash spi_flash)
Expand Down
161 changes: 161 additions & 0 deletions examples/lighting-app/lighting-common/lighting-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,150 @@ server cluster Groups = 4 {
fabric command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5;
}

/** Attributes and commands for scene configuration and manipulation. */
server cluster Scenes = 5 {
bitmap Feature : BITMAP32 {
kSceneNames = 0x1;
}

bitmap ScenesCopyMode : BITMAP8 {
kCopyAllScenes = 0x1;
}

struct AttributeValuePair {
optional attrib_id attributeID = 0;
int32u attributeValue = 1;
}

struct ExtensionFieldSet {
cluster_id clusterID = 0;
AttributeValuePair attributeValueList[] = 1;
}

readonly attribute int8u sceneCount = 0;
readonly attribute int8u currentScene = 1;
readonly attribute group_id currentGroup = 2;
readonly attribute boolean sceneValid = 3;
readonly attribute bitmap8 nameSupport = 4;
readonly attribute nullable node_id lastConfiguredBy = 5;
readonly attribute int16u sceneTableSize = 6;
readonly attribute int8u remainingCapacity = 7;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
readonly attribute attrib_id attributeList[] = 65531;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;

request struct AddSceneRequest {
group_id groupID = 0;
INT8U sceneID = 1;
INT16U transitionTime = 2;
CHAR_STRING sceneName = 3;
ExtensionFieldSet extensionFieldSets[] = 4;
}

request struct ViewSceneRequest {
group_id groupID = 0;
INT8U sceneID = 1;
}

request struct RemoveSceneRequest {
group_id groupID = 0;
INT8U sceneID = 1;
}

request struct RemoveAllScenesRequest {
group_id groupID = 0;
}

request struct StoreSceneRequest {
group_id groupID = 0;
INT8U sceneID = 1;
}

request struct RecallSceneRequest {
group_id groupID = 0;
INT8U sceneID = 1;
optional nullable INT16U transitionTime = 2;
}

request struct GetSceneMembershipRequest {
group_id groupID = 0;
}

request struct EnhancedAddSceneRequest {
group_id groupID = 0;
INT8U sceneID = 1;
INT16U transitionTime = 2;
CHAR_STRING sceneName = 3;
ExtensionFieldSet extensionFieldSets[] = 4;
}

request struct EnhancedViewSceneRequest {
group_id groupID = 0;
INT8U sceneID = 1;
}

request struct CopySceneRequest {
ScenesCopyMode mode = 0;
group_id groupIdentifierFrom = 1;
INT8U sceneIdentifierFrom = 2;
group_id groupIdentifierTo = 3;
INT8U sceneIdentifierTo = 4;
}

response struct AddSceneResponse = 0 {
status status = 0;
group_id groupID = 1;
INT8U sceneID = 2;
}

response struct ViewSceneResponse = 1 {
status status = 0;
group_id groupID = 1;
INT8U sceneID = 2;
optional INT16U transitionTime = 3;
optional CHAR_STRING sceneName = 4;
optional ExtensionFieldSet extensionFieldSets[] = 5;
}

response struct RemoveSceneResponse = 2 {
status status = 0;
group_id groupID = 1;
INT8U sceneID = 2;
}

response struct RemoveAllScenesResponse = 3 {
status status = 0;
group_id groupID = 1;
}

response struct StoreSceneResponse = 4 {
status status = 0;
group_id groupID = 1;
INT8U sceneID = 2;
}

response struct GetSceneMembershipResponse = 6 {
status status = 0;
nullable INT8U capacity = 1;
group_id groupID = 2;
optional INT8U sceneList[] = 3;
}

fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0;
fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1;
fabric command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2;
fabric command access(invoke: manage) RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3;
fabric command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4;
fabric command RecallScene(RecallSceneRequest): DefaultSuccess = 5;
fabric command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6;
fabric command EnhancedAddScene(EnhancedAddSceneRequest): EnhancedAddSceneResponse = 64;
fabric command EnhancedViewScene(EnhancedViewSceneRequest): EnhancedViewSceneResponse = 65;
fabric command CopyScene(CopySceneRequest): CopySceneResponse = 66;
}

/** Attributes and commands for switching devices between 'On' and 'Off' states. */
server cluster OnOff = 6 {
enum OnOffDelayedAllOffEffectVariant : ENUM8 {
Expand Down Expand Up @@ -2252,6 +2396,23 @@ endpoint 1 {
ram attribute clusterRevision default = 4;
}

server cluster Scenes {
callback attribute sceneCount default = 0x00;
ram attribute currentScene default = 0x00;
ram attribute currentGroup default = 0x0000;
ram attribute sceneValid default = 0x00;
ram attribute nameSupport default = 0x80;
ram attribute lastConfiguredBy;
ram attribute sceneTableSize;
callback attribute remainingCapacity;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
ram attribute featureMap default = 1;
ram attribute clusterRevision default = 4;
}

server cluster OnOff {
persist attribute onOff default = 0x00;
ram attribute globalSceneControl default = 0x01;
Expand Down
132 changes: 130 additions & 2 deletions examples/lighting-app/lighting-common/lighting-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -5843,7 +5843,7 @@
"mfgCode": null,
"define": "SCENES_CLUSTER",
"side": "server",
"enabled": 0,
"enabled": 1,
"commands": [
{
"name": "AddSceneResponse",
Expand Down Expand Up @@ -5969,12 +5969,140 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": "0x80",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
},
{
"name": "LastConfiguredBy",
"code": 5,
"mfgCode": null,
"side": "server",
"type": "node_id",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "SceneTableSize",
"code": 6,
"mfgCode": null,
"side": "server",
"type": "int16u",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "RemainingCapacity",
"code": 7,
"mfgCode": null,
"side": "server",
"type": "int8u",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "GeneratedCommandList",
"code": 65528,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"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": "",
"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": "",
"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": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "FeatureMap",
"code": 65532,
"mfgCode": null,
"side": "server",
"type": "bitmap32",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "1",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "ClusterRevision",
"code": 65533,
Expand Down
Loading