Skip to content

Commit

Permalink
[ICD] Update ICD Management Cluster xml to match spec (#28088)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Oct 4, 2023
1 parent c232b26 commit 9856081
Show file tree
Hide file tree
Showing 18 changed files with 35 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2432,7 +2432,7 @@ server cluster IcdManagement = 70 {

request struct UnregisterClientRequest {
node_id checkInNodeID = 0;
optional OCTET_STRING<16> key = 1;
optional OCTET_STRING<16> verificationKey = 1;
}

response struct RegisterClientResponse = 1 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1938,7 +1938,7 @@ server cluster IcdManagement = 70 {

request struct UnregisterClientRequest {
node_id checkInNodeID = 0;
optional OCTET_STRING<16> key = 1;
optional OCTET_STRING<16> verificationKey = 1;
}

response struct RegisterClientResponse = 1 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1597,7 +1597,7 @@ server cluster IcdManagement = 70 {

request struct UnregisterClientRequest {
node_id checkInNodeID = 0;
optional OCTET_STRING<16> key = 1;
optional OCTET_STRING<16> verificationKey = 1;
}

response struct RegisterClientResponse = 1 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ bool emberAfIcdManagementClusterUnregisterClientCallback(chip::app::CommandHandl
{
PersistentStorageDelegate & storage = chip::Server::GetInstance().GetPersistentStorage();
FabricIndex fabric = commandObj->GetAccessingFabricIndex();
status = IcdManagementServer::GetInstance().UnregisterClient(storage, fabric, commandData.checkInNodeID, commandData.key,
is_admin);
status = IcdManagementServer::GetInstance().UnregisterClient(storage, fabric, commandData.checkInNodeID,
commandData.verificationKey, is_admin);
}

commandObj->AddStatus(commandPath, status);
Expand Down
6 changes: 3 additions & 3 deletions src/app/icd/IcdManagementServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Status IcdManagementServer::RegisterClient(PersistentStorageDelegate & storage,
}

Status IcdManagementServer::UnregisterClient(PersistentStorageDelegate & storage, FabricIndex fabric_index, chip::NodeId node_id,
Optional<chip::ByteSpan> key, bool is_admin)
Optional<chip::ByteSpan> verificationKey, bool is_admin)
{
IcdMonitoringTable table(storage, fabric_index, GetClientsSupportedPerFabric());

Expand All @@ -62,8 +62,8 @@ Status IcdManagementServer::UnregisterClient(PersistentStorageDelegate & storage
// Existing entry: Validate Key if, and only if, the ISD has NOT administrator permissions
if (!is_admin)
{
VerifyOrReturnError(key.HasValue(), InteractionModel::Status::Failure);
VerifyOrReturnError(key.Value().data_equal(entry.key), InteractionModel::Status::Failure);
VerifyOrReturnError(verificationKey.HasValue(), InteractionModel::Status::Failure);
VerifyOrReturnError(verificationKey.Value().data_equal(entry.key), InteractionModel::Status::Failure);
}

err = table.Remove(entry.index);
Expand Down
2 changes: 1 addition & 1 deletion src/app/icd/IcdManagementServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class IcdManagementServer
uint64_t monitored_subject, chip::ByteSpan key, Optional<chip::ByteSpan> verification_key, bool is_admin);

Status UnregisterClient(PersistentStorageDelegate & storage, FabricIndex fabric_index, chip::NodeId node_id,
Optional<chip::ByteSpan> key, bool is_admin);
Optional<chip::ByteSpan> verificationKey, bool is_admin);

Status StayActiveRequest(FabricIndex fabric_index);

Expand Down
2 changes: 1 addition & 1 deletion src/app/tests/suites/TestIcdManagementCluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ tests:
values:
- name: "CheckInNodeID"
value: 101
- name: "Key"
- name: "VerificationKey"
value: "\x01\x21\x21\x31\x41\x51\x61\x71\x81\x91\xa1\xb1\xc1\xd1\xe1\xf1"

- label: "Read RegisteredClients"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ limitations under the License.
<!-- Current cluster version -->
<globalAttribute side="either" code="0xFFFD" value="1"/>

<attribute side="server" code="0x00" define="IDLE_MODE_INTERVAL" type="INT32U" min="500" max="86400000" default="500" writable="false" optional="false" isNullable="false">IdleModeInterval</attribute>
<attribute side="server" code="0x00" define="IDLE_MODE_INTERVAL" type="INT32U" min="500" max="64800000" default="500" writable="false" optional="false" isNullable="false">IdleModeInterval</attribute>
<attribute side="server" code="0x01" define="ACTIVE_MODE_INTERVAL" type="INT32U" min="300" default="300" writable="false" optional="false" isNullable="false">ActiveModeInterval</attribute>
<attribute side="server" code="0x02" define="ACTIVE_MODE_THRESHOLD" type="INT16U" min="300" default="300" writable="false" optional="false" isNullable="false">ActiveModeThreshold</attribute>
<attribute side="server" code="0x03" define="REGISTERED_CLIENTS" type="ARRAY" entryType="MonitoringRegistrationStruct" writable="false" optional="true" isNullable="false">
Expand Down Expand Up @@ -72,7 +72,7 @@ limitations under the License.
<command source="client" code="0x02" name="UnregisterClient" isFabricScoped="true" optional="true">
<description> Unregister a client from an end device </description>
<arg name="CheckInNodeID" type="node_id"/>
<arg name="Key" type="OCTET_STRING" length="16" optional="true"/>
<arg name="VerificationKey" type="OCTET_STRING" length="16" optional="true"/>
<access op="invoke" privilege="manage"/>
</command>

Expand Down
2 changes: 1 addition & 1 deletion src/controller/data_model/controller-clusters.matter
Original file line number Diff line number Diff line change
Expand Up @@ -2751,7 +2751,7 @@ client cluster IcdManagement = 70 {

request struct UnregisterClientRequest {
node_id checkInNodeID = 0;
optional OCTET_STRING<16> key = 1;
optional OCTET_STRING<16> verificationKey = 1;
}

/** Register a client to the end device */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6043,7 +6043,7 @@ public static RegisterClientCommandField value(int id) throws NoSuchFieldError {
}
throw new NoSuchFieldError();
}
}public enum UnregisterClientCommandField {CheckInNodeID(0),Key(1),;
}public enum UnregisterClientCommandField {CheckInNodeID(0),VerificationKey(1),;
private final int id;
UnregisterClientCommandField(int id) {
this.id = id;
Expand Down

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.

2 changes: 1 addition & 1 deletion src/controller/python/chip/clusters/CHIPClusters.py

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

4 changes: 2 additions & 2 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.

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.

2 changes: 1 addition & 1 deletion zzz_generated/chip-tool/zap-generated/cluster/Commands.h

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

4 changes: 2 additions & 2 deletions zzz_generated/chip-tool/zap-generated/test/Commands.h

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

0 comments on commit 9856081

Please sign in to comment.