Skip to content

Commit

Permalink
Add group and scene clusters (#18141)
Browse files Browse the repository at this point in the history
* Add group and scene clusters

* Restyled by whitespace

* Restyled by clang-format

* Zap regen (#18153)

* Add group and scene clusters

* Restyled by whitespace

* Restyled by clang-format

* Rebase

* Fix Merging error

Co-authored-by: Restyled.io <[email protected]>
Co-authored-by: Andrei Litvin <[email protected]>
  • Loading branch information
3 people authored and pull[bot] committed Sep 12, 2023
1 parent 3b4877c commit 2773954
Show file tree
Hide file tree
Showing 10 changed files with 765 additions and 53 deletions.
172 changes: 172 additions & 0 deletions examples/window-app/common/window-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,61 @@ server cluster GroupKeyManagement = 63 {
command access(invoke: administer) KeySetReadAllIndices(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4;
}

server cluster Groups = 4 {
readonly attribute bitmap8 nameSupport = 0;
readonly attribute int16u clusterRevision = 65533;

request struct AddGroupRequest {
group_id groupId = 0;
CHAR_STRING groupName = 1;
}

request struct ViewGroupRequest {
group_id groupId = 0;
}

request struct GetGroupMembershipRequest {
group_id groupList[] = 0;
}

request struct RemoveGroupRequest {
group_id groupId = 0;
}

request struct AddGroupIfIdentifyingRequest {
group_id groupId = 0;
CHAR_STRING groupName = 1;
}

response struct AddGroupResponse = 0 {
ENUM8 status = 0;
group_id groupId = 1;
}

response struct ViewGroupResponse = 1 {
ENUM8 status = 0;
group_id groupId = 1;
CHAR_STRING groupName = 2;
}

response struct GetGroupMembershipResponse = 2 {
nullable INT8U capacity = 0;
group_id groupList[] = 1;
}

response struct RemoveGroupResponse = 3 {
ENUM8 status = 0;
group_id groupId = 1;
}

command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0;
command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1;
command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2;
command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3;
command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4;
command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5;
}

server cluster Identify = 3 {
enum IdentifyEffectIdentifier : ENUM8 {
kBlink = 0;
Expand Down Expand Up @@ -944,6 +999,111 @@ server cluster PowerSource = 47 {
readonly attribute int16u clusterRevision = 65533;
}

client cluster Scenes = 5 {
bitmap ScenesCopyMode : BITMAP8 {
kCopyAllScenes = 0x1;
}

struct SceneExtensionFieldSet {
CLUSTER_ID clusterId = 0;
INT8U length = 1;
INT8U value = 2;
}

readonly attribute int8u sceneCount = 0;
readonly attribute int8u currentScene = 1;
readonly attribute int16u currentGroup = 2;
readonly attribute boolean sceneValid = 3;
readonly attribute bitmap8 nameSupport = 4;
readonly attribute attrib_id attributeList[] = 65531;
readonly attribute int16u clusterRevision = 65533;

request struct AddSceneRequest {
INT16U groupId = 0;
INT8U sceneId = 1;
INT16U transitionTime = 2;
CHAR_STRING sceneName = 3;
SceneExtensionFieldSet extensionFieldSets[] = 4;
}

request struct ViewSceneRequest {
INT16U groupId = 0;
INT8U sceneId = 1;
}

request struct RemoveSceneRequest {
INT16U groupId = 0;
INT8U sceneId = 1;
}

request struct RemoveAllScenesRequest {
INT16U groupId = 0;
}

request struct StoreSceneRequest {
INT16U groupId = 0;
INT8U sceneId = 1;
}

request struct RecallSceneRequest {
INT16U groupId = 0;
INT8U sceneId = 1;
INT16U transitionTime = 2;
}

request struct GetSceneMembershipRequest {
INT16U groupId = 0;
}

response struct AddSceneResponse = 0 {
ENUM8 status = 0;
INT16U groupId = 1;
INT8U sceneId = 2;
}

response struct ViewSceneResponse = 1 {
ENUM8 status = 0;
INT16U groupId = 1;
INT8U sceneId = 2;
INT16U transitionTime = 3;
CHAR_STRING sceneName = 4;
SceneExtensionFieldSet extensionFieldSets[] = 5;
}

response struct RemoveSceneResponse = 2 {
ENUM8 status = 0;
INT16U groupId = 1;
INT8U sceneId = 2;
}

response struct RemoveAllScenesResponse = 3 {
ENUM8 status = 0;
INT16U groupId = 1;
}

response struct StoreSceneResponse = 4 {
ENUM8 status = 0;
INT16U groupId = 1;
INT8U sceneId = 2;
}

response struct GetSceneMembershipResponse = 6 {
ENUM8 status = 0;
INT8U capacity = 1;
INT16U groupId = 2;
INT8U sceneCount = 3;
INT8U sceneList[] = 4;
}

command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0;
command ViewScene(ViewSceneRequest): ViewSceneResponse = 1;
command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2;
command access(invoke: manage) RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3;
command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4;
command RecallScene(RecallSceneRequest): DefaultSuccess = 5;
command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6;
}

server cluster SoftwareDiagnostics = 52 {
struct ThreadMetrics {
INT64U id = 0;
Expand Down Expand Up @@ -1672,13 +1832,19 @@ endpoint 0 {
}

endpoint 1 {
binding cluster Scenes;

server cluster Identify {
ram attribute identifyTime;
ram attribute identifyType;
ram attribute clusterRevision default = 4;
}

server cluster Groups {
ram attribute nameSupport;
ram attribute clusterRevision default = 4;
}

server cluster Descriptor {
callback attribute deviceList;
callback attribute serverList;
Expand Down Expand Up @@ -1712,6 +1878,12 @@ endpoint 1 {
}

endpoint 2 {
binding cluster Scenes;

server cluster Groups {
ram attribute nameSupport;
ram attribute clusterRevision default = 4;
}

server cluster Descriptor {
callback attribute deviceList;
Expand Down
Loading

0 comments on commit 2773954

Please sign in to comment.