From 9856081f1b84583086f51b6dde4f31209ec15f46 Mon Sep 17 00:00:00 2001 From: mkardous-silabs <84793247+mkardous-silabs@users.noreply.github.com> Date: Thu, 20 Jul 2023 10:35:16 -0400 Subject: [PATCH] [ICD] Update ICD Management Cluster xml to match spec (#28088) --------- Co-authored-by: Restyled.io --- .../all-clusters-common/all-clusters-app.matter | 2 +- .../silabs/data_model/lighting-thread-app.matter | 2 +- .../smoke-co-alarm-common/smoke-co-alarm-app.matter | 2 +- .../icd-management-server/icd-management-server.cpp | 4 ++-- src/app/icd/IcdManagementServer.cpp | 6 +++--- src/app/icd/IcdManagementServer.h | 2 +- src/app/tests/suites/TestIcdManagementCluster.yaml | 2 +- .../zcl/data-model/chip/icd-management-cluster.xml | 4 ++-- src/controller/data_model/controller-clusters.matter | 2 +- .../java/chip/devicecontroller/ClusterIDMapping.java | 2 +- .../chip/devicecontroller/ChipClusters.java | 10 +++++----- .../chip/devicecontroller/ClusterInfoMapping.java | 6 +++--- src/controller/python/chip/clusters/CHIPClusters.py | 2 +- src/controller/python/chip/clusters/Objects.py | 4 ++-- .../app-common/zap-generated/cluster-objects.cpp | 6 +++--- .../app-common/zap-generated/cluster-objects.h | 8 ++++---- .../chip-tool/zap-generated/cluster/Commands.h | 2 +- zzz_generated/chip-tool/zap-generated/test/Commands.h | 4 ++-- 18 files changed, 35 insertions(+), 35 deletions(-) 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 0b0662b149ccf9..638d709919bb37 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 @@ -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 { 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 7492eb6d3017b2..5e4a911199f773 100644 --- a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter @@ -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 { diff --git a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter index 25da4e63c69535..97f09da8a4b90e 100644 --- a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter +++ b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter @@ -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 { diff --git a/src/app/clusters/icd-management-server/icd-management-server.cpp b/src/app/clusters/icd-management-server/icd-management-server.cpp index 30fc0b072c7448..5877224f2d2841 100644 --- a/src/app/clusters/icd-management-server/icd-management-server.cpp +++ b/src/app/clusters/icd-management-server/icd-management-server.cpp @@ -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); diff --git a/src/app/icd/IcdManagementServer.cpp b/src/app/icd/IcdManagementServer.cpp index 4d6c11c8e76c08..1db9006f5f5965 100644 --- a/src/app/icd/IcdManagementServer.cpp +++ b/src/app/icd/IcdManagementServer.cpp @@ -49,7 +49,7 @@ Status IcdManagementServer::RegisterClient(PersistentStorageDelegate & storage, } Status IcdManagementServer::UnregisterClient(PersistentStorageDelegate & storage, FabricIndex fabric_index, chip::NodeId node_id, - Optional key, bool is_admin) + Optional verificationKey, bool is_admin) { IcdMonitoringTable table(storage, fabric_index, GetClientsSupportedPerFabric()); @@ -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); diff --git a/src/app/icd/IcdManagementServer.h b/src/app/icd/IcdManagementServer.h index 8d7f4b2030307a..8f08d62b38b5d2 100644 --- a/src/app/icd/IcdManagementServer.h +++ b/src/app/icd/IcdManagementServer.h @@ -56,7 +56,7 @@ class IcdManagementServer uint64_t monitored_subject, chip::ByteSpan key, Optional verification_key, bool is_admin); Status UnregisterClient(PersistentStorageDelegate & storage, FabricIndex fabric_index, chip::NodeId node_id, - Optional key, bool is_admin); + Optional verificationKey, bool is_admin); Status StayActiveRequest(FabricIndex fabric_index); diff --git a/src/app/tests/suites/TestIcdManagementCluster.yaml b/src/app/tests/suites/TestIcdManagementCluster.yaml index 985e943df5057f..6b3d29c1fc5f6b 100644 --- a/src/app/tests/suites/TestIcdManagementCluster.yaml +++ b/src/app/tests/suites/TestIcdManagementCluster.yaml @@ -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" diff --git a/src/app/zap-templates/zcl/data-model/chip/icd-management-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/icd-management-cluster.xml index f0fcc662285de9..5488f587487818 100644 --- a/src/app/zap-templates/zcl/data-model/chip/icd-management-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/icd-management-cluster.xml @@ -42,7 +42,7 @@ limitations under the License. - IdleModeInterval + IdleModeInterval ActiveModeInterval ActiveModeThreshold @@ -72,7 +72,7 @@ limitations under the License. Unregister a client from an end device - + diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 0e4d35164b121f..543c6fe139a91a 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -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 */ diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java index 89e93ae475c0ee..1d666b7dadceb0 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -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; diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java index 17dcb067252c6a..3be313a4ff970d 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -13221,14 +13221,14 @@ public void registerClient(RegisterClientResponseCallback callback } public void unregisterClient(DefaultClusterCallback callback - , Long checkInNodeID, Optional key) { - unregisterClient(chipClusterPtr, callback, checkInNodeID, key, null); + , Long checkInNodeID, Optional verificationKey) { + unregisterClient(chipClusterPtr, callback, checkInNodeID, verificationKey, null); } public void unregisterClient(DefaultClusterCallback callback - , Long checkInNodeID, Optional key + , Long checkInNodeID, Optional verificationKey , int timedInvokeTimeoutMs) { - unregisterClient(chipClusterPtr, callback, checkInNodeID, key, timedInvokeTimeoutMs); + unregisterClient(chipClusterPtr, callback, checkInNodeID, verificationKey, timedInvokeTimeoutMs); } public void stayActiveRequest(DefaultClusterCallback callback @@ -13245,7 +13245,7 @@ private native void registerClient(long chipClusterPtr, RegisterClientResponseCa , Long checkInNodeID, Long monitoredSubject, byte[] key, Optional verificationKey , @Nullable Integer timedInvokeTimeoutMs); private native void unregisterClient(long chipClusterPtr, DefaultClusterCallback Callback - , Long checkInNodeID, Optional key + , Long checkInNodeID, Optional verificationKey , @Nullable Integer timedInvokeTimeoutMs); private native void stayActiveRequest(long chipClusterPtr, DefaultClusterCallback Callback diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java index ed16c1c3a72044..2f745f9a1a6652 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java @@ -17468,8 +17468,8 @@ public Map> getCommandMap() { CommandParameterInfo icdManagementunregisterClientcheckInNodeIDCommandParameterInfo = new CommandParameterInfo("checkInNodeID", Long.class, Long.class); icdManagementunregisterClientCommandParams.put("checkInNodeID",icdManagementunregisterClientcheckInNodeIDCommandParameterInfo); - CommandParameterInfo icdManagementunregisterClientkeyCommandParameterInfo = new CommandParameterInfo("key", Optional.class, byte[].class); - icdManagementunregisterClientCommandParams.put("key",icdManagementunregisterClientkeyCommandParameterInfo); + CommandParameterInfo icdManagementunregisterClientverificationKeyCommandParameterInfo = new CommandParameterInfo("verificationKey", Optional.class, byte[].class); + icdManagementunregisterClientCommandParams.put("verificationKey",icdManagementunregisterClientverificationKeyCommandParameterInfo); InteractionInfo icdManagementunregisterClientInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { @@ -17478,7 +17478,7 @@ public Map> getCommandMap() { , (Long) commandArguments.get("checkInNodeID") , (Optional) - commandArguments.get("key") + commandArguments.get("verificationKey") ); }, diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 2002d1a40b73db..fb2c9b2a3479e3 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -4189,7 +4189,7 @@ class ChipClusters: "commandName": "UnregisterClient", "args": { "checkInNodeID": "int", - "key": "bytes", + "verificationKey": "bytes", }, }, 0x00000003: { diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 4b292be96dc6be..4a987bb5da8683 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -14666,11 +14666,11 @@ def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ ClusterObjectFieldDescriptor(Label="checkInNodeID", Tag=0, Type=uint), - ClusterObjectFieldDescriptor(Label="key", Tag=1, Type=typing.Optional[bytes]), + ClusterObjectFieldDescriptor(Label="verificationKey", Tag=1, Type=typing.Optional[bytes]), ]) checkInNodeID: 'uint' = 0 - key: 'typing.Optional[bytes]' = None + verificationKey: 'typing.Optional[bytes]' = None @dataclass class StayActiveRequest(ClusterCommand): diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index f646cc4f178343..5bafcc01a9039a 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -11303,7 +11303,7 @@ CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const TLV::TLVType outer; ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kCheckInNodeID), checkInNodeID)); - ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kKey), key)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kVerificationKey), verificationKey)); ReturnErrorOnFailure(aWriter.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -11325,8 +11325,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) case to_underlying(Fields::kCheckInNodeID): ReturnErrorOnFailure(DataModel::Decode(reader, checkInNodeID)); break; - case to_underlying(Fields::kKey): - ReturnErrorOnFailure(DataModel::Decode(reader, key)); + case to_underlying(Fields::kVerificationKey): + ReturnErrorOnFailure(DataModel::Decode(reader, verificationKey)); break; default: break; 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 26c8dd148e2e70..d7d0095d88c8ce 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 @@ -13885,8 +13885,8 @@ struct DecodableType namespace UnregisterClient { enum class Fields : uint8_t { - kCheckInNodeID = 0, - kKey = 1, + kCheckInNodeID = 0, + kVerificationKey = 1, }; struct Type @@ -13897,7 +13897,7 @@ struct Type static constexpr ClusterId GetClusterId() { return Clusters::IcdManagement::Id; } chip::NodeId checkInNodeID = static_cast(0); - Optional key; + Optional verificationKey; CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -13913,7 +13913,7 @@ struct DecodableType static constexpr ClusterId GetClusterId() { return Clusters::IcdManagement::Id; } chip::NodeId checkInNodeID = static_cast(0); - Optional key; + Optional verificationKey; CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace UnregisterClient diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index a732fe129bea93..30c2cdc531e8df 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -3944,7 +3944,7 @@ class IcdManagementUnregisterClient : public ClusterCommand ClusterCommand("unregister-client", credsIssuerConfig) { AddArgument("CheckInNodeID", 0, UINT64_MAX, &mRequest.checkInNodeID); - AddArgument("Key", &mRequest.key); + AddArgument("VerificationKey", &mRequest.verificationKey); ClusterCommand::AddArguments(); } diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 8b7c61ae562fdb..4a209ef3d3c52d 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -32089,8 +32089,8 @@ class TestIcdManagementClusterSuite : public TestCommand ListFreer listFreer; chip::app::Clusters::IcdManagement::Commands::UnregisterClient::Type value; value.checkInNodeID = 101ULL; - value.key.Emplace(); - value.key.Value() = chip::ByteSpan( + value.verificationKey.Emplace(); + value.verificationKey.Value() = chip::ByteSpan( chip::Uint8::from_const_char("\001!!1AQaq\201\221\241\261\301\321\341\361garbage: not in length on purpose"), 16); return SendCommand(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Commands::UnregisterClient::Id, value, chip::NullOptional