Skip to content

Commit

Permalink
Add event definitions in Access Control Cluster xml (project-chip#13667)
Browse files Browse the repository at this point in the history
* Add event definations in Access Control Cluster

* Run codegen
  • Loading branch information
yufengwangca authored Jan 19, 2022
1 parent 4f84672 commit 150c479
Show file tree
Hide file tree
Showing 9 changed files with 699 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ server cluster AccessControl = 31 {
kGroup = 3;
}

enum ChangeTypeEnum : ENUM8 {
kChanged = 0;
kAdded = 1;
kRemoved = 2;
}

enum Privilege : ENUM8 {
kView = 1;
kProxyView = 2;
Expand Down Expand Up @@ -40,6 +46,22 @@ server cluster AccessControl = 31 {
OCTET_STRING data = 1;
}

info event AccessControlEntryChanged = 0 {
fabric_idx adminFabricIndex = 0;
node_id adminNodeID = 1;
INT16U adminPasscodeID = 2;
ChangeTypeEnum changeType = 3;
AccessControlEntry latestValue = 4;
}

info event AccessControlExtensionChanged = 1 {
fabric_idx adminFabricIndex = 0;
node_id adminNodeID = 1;
INT16U adminPasscodeID = 2;
ChangeTypeEnum changeType = 3;
ExtensionEntry latestValue = 4;
}

attribute(writable) AccessControlEntry acl[] = 0;
attribute(writable) ExtensionEntry extension[] = 1;
attribute(readonly) int16u clusterRevision = 65533;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ limitations under the License.
<item name="Group" value="0x03"/>
</enum>

<enum name="ChangeTypeEnum" type="ENUM8">
<cluster code="0x001F"/>
<item name="Changed" value="0x00"/>
<item name="Added" value="0x01"/>
<item name="Removed" value="0x02"/>
</enum>

<struct name="Target">
<cluster code="0x001F"/>
<item fieldId="0" name="Cluster" type="cluster_id" isNullable="true"/>
Expand Down Expand Up @@ -79,5 +86,21 @@ limitations under the License.
<access op="write" privilege="administer"/>
<access modifier="fabric-scoped"/>
</attribute>
<event side="server" code="0x0000" name="AccessControlEntryChanged" priority="info" optional="false">
<description>The cluster SHALL send AccessControlEntryChanged events whenever its ACL attribute data is changed by an Administrator.</description>
<field id="0" name="AdminFabricIndex" type="fabric_idx"/>
<field id="1" name="AdminNodeID" type="node_id"/>
<field id="2" name="AdminPasscodeID" type="INT16U"/>
<field id="3" name="ChangeType" type="ChangeTypeEnum"/>
<field id="4" name="LatestValue" type="AccessControlEntry"/>
</event>
<event side="server" code="0x0001" name="AccessControlExtensionChanged" priority="info" optional="false">
<description>The cluster SHALL send AccessControlExtensionChanged events whenever its extension attribute data is changed by an Administrator.</description>
<field id="0" name="AdminFabricIndex" type="fabric_idx"/>
<field id="1" name="AdminNodeID" type="node_id"/>
<field id="2" name="AdminPasscodeID" type="INT16U"/>
<field id="3" name="ChangeType" type="ChangeTypeEnum"/>
<field id="4" name="LatestValue" type="ExtensionEntry"/>
</event>
</cluster>
</configurator>
22 changes: 22 additions & 0 deletions src/controller/data_model/controller-clusters.matter
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ client cluster AccessControl = 31 {
kGroup = 3;
}

enum ChangeTypeEnum : ENUM8 {
kChanged = 0;
kAdded = 1;
kRemoved = 2;
}

enum Privilege : ENUM8 {
kView = 1;
kProxyView = 2;
Expand Down Expand Up @@ -40,6 +46,22 @@ client cluster AccessControl = 31 {
OCTET_STRING data = 1;
}

info event AccessControlEntryChanged = 0 {
fabric_idx adminFabricIndex = 0;
node_id adminNodeID = 1;
INT16U adminPasscodeID = 2;
ChangeTypeEnum changeType = 3;
AccessControlEntry latestValue = 4;
}

info event AccessControlExtensionChanged = 1 {
fabric_idx adminFabricIndex = 0;
node_id adminNodeID = 1;
INT16U adminPasscodeID = 2;
ChangeTypeEnum changeType = 3;
ExtensionEntry latestValue = 4;
}

attribute(writable) AccessControlEntry acl[] = 0;
attribute(writable) ExtensionEntry extension[] = 1;
attribute(readonly) attrib_id attributeList[] = 65531;
Expand Down
60 changes: 60 additions & 0 deletions src/controller/python/chip/clusters/Objects.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 52 additions & 0 deletions src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 150c479

Please sign in to comment.