diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index 3ef8c861387327..db4fdf6ecc0a55 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -4304,7 +4304,40 @@ "define": "GROUP_KEY_MANAGEMENT_CLUSTER", "side": "client", "enabled": 0, - "commands": [], + "commands": [ + { + "name": "KeySetWrite", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "KeySetRead", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "KeySetRemove", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "KeySetReadAllIndices", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], "attributes": [ { "name": "ClusterRevision", @@ -4330,15 +4363,32 @@ "define": "GROUP_KEY_MANAGEMENT_CLUSTER", "side": "server", "enabled": 1, - "commands": [], + "commands": [ + { + "name": "KeySetReadResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "KeySetReadAllIndicesResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], "attributes": [ { - "name": "groups", + "name": "groupKeyMap", "code": 0, "mfgCode": null, "side": "server", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -4348,12 +4398,12 @@ "reportableChange": 0 }, { - "name": "group keys", + "name": "groupTable", "code": 1, "mfgCode": null, "side": "server", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -4362,6 +4412,36 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "maxGroupsPerFabric", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "maxGroupKeysPerFabric", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -9420,7 +9500,7 @@ "commands": [], "attributes": [ { - "name": "groups", + "name": "groupKeyMap", "code": 0, "mfgCode": null, "side": "server", @@ -9435,7 +9515,7 @@ "reportableChange": 0 }, { - "name": "group keys", + "name": "groupTable", "code": 1, "mfgCode": null, "side": "server", diff --git a/examples/all-clusters-app/esp32/main/CMakeLists.txt b/examples/all-clusters-app/esp32/main/CMakeLists.txt index 7b9ebc9a971c74..f9cd39ea9a23ed 100644 --- a/examples/all-clusters-app/esp32/main/CMakeLists.txt +++ b/examples/all-clusters-app/esp32/main/CMakeLists.txt @@ -68,6 +68,7 @@ set(SRC_DIRS_LIST "${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" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/group-key-mgmt-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/basic" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/bindings" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/diagnostic-logs-server" diff --git a/examples/all-clusters-app/mbed/CMakeLists.txt b/examples/all-clusters-app/mbed/CMakeLists.txt index ed3d61123b92d7..52231736125945 100644 --- a/examples/all-clusters-app/mbed/CMakeLists.txt +++ b/examples/all-clusters-app/mbed/CMakeLists.txt @@ -136,6 +136,7 @@ target_sources(${APP_TARGET} PRIVATE ${APP_CLUSTERS}/identify-server/identify-server.cpp ${APP_CLUSTERS}/window-covering-server/window-covering-server.cpp ${APP_CLUSTERS}/general-diagnostics-server/general-diagnostics-server.cpp + ${APP_CLUSTERS}/group-key-mgmt-server/group-key-mgmt-server.cpp ${APP_CLUSTERS}/power-source-configuration-server/power-source-configuration-server.cpp ) diff --git a/examples/bridge-app/esp32/main/CMakeLists.txt b/examples/bridge-app/esp32/main/CMakeLists.txt index 66fa70ee9a23f4..4031f15de317f9 100644 --- a/examples/bridge-app/esp32/main/CMakeLists.txt +++ b/examples/bridge-app/esp32/main/CMakeLists.txt @@ -37,6 +37,7 @@ idf_component_register(PRIV_INCLUDE_DIRS "${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" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/group-key-mgmt-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/descriptor" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/on-off-server" diff --git a/examples/chip-tool/templates/tests.js b/examples/chip-tool/templates/tests.js index b37f8f2413b36b..29d60ddf3cdc71 100644 --- a/examples/chip-tool/templates/tests.js +++ b/examples/chip-tool/templates/tests.js @@ -196,6 +196,7 @@ function getTests() 'TestBasicInformation', 'TestIdentifyCluster', 'TestGroupsCluster', + 'TestGroupKeyManagementCluster', 'TestOperationalCredentialsCluster', 'TestModeSelectCluster', 'TestGroupMessaging', diff --git a/examples/lighting-app/mbed/CMakeLists.txt b/examples/lighting-app/mbed/CMakeLists.txt index 20a8878e93c4a9..811d5990b95fd3 100644 --- a/examples/lighting-app/mbed/CMakeLists.txt +++ b/examples/lighting-app/mbed/CMakeLists.txt @@ -87,6 +87,7 @@ target_sources(${APP_TARGET} PRIVATE ${CHIP_ROOT}/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp ${CHIP_ROOT}/src/app/clusters/switch-server/switch-server.cpp ${CHIP_ROOT}/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp + ${CHIP_ROOT}/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp ${CHIP_ROOT}/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp ${CHIP_ROOT}/src/app/clusters/on-off-server/on-off-server.cpp ${CHIP_ROOT}/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp diff --git a/examples/lighting-app/telink/CMakeLists.txt b/examples/lighting-app/telink/CMakeLists.txt index d3b4e08f646bd2..0ae36a67418eb3 100644 --- a/examples/lighting-app/telink/CMakeLists.txt +++ b/examples/lighting-app/telink/CMakeLists.txt @@ -87,6 +87,7 @@ target_sources(app PRIVATE ${CHIP_ROOT}/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp ${CHIP_ROOT}/src/app/clusters/switch-server/switch-server.cpp ${CHIP_ROOT}/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp + ${CHIP_ROOT}/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp ${CHIP_ROOT}/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp ${CHIP_ROOT}/src/app/clusters/on-off-server/on-off-server.cpp ${CHIP_ROOT}/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp diff --git a/examples/lock-app/esp32/main/CMakeLists.txt b/examples/lock-app/esp32/main/CMakeLists.txt index 2525e67b1f7b4a..59972099fdd693 100644 --- a/examples/lock-app/esp32/main/CMakeLists.txt +++ b/examples/lock-app/esp32/main/CMakeLists.txt @@ -55,8 +55,8 @@ idf_component_register(INCLUDE_DIRS "${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" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/power-source-configuration-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/user-label-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/group-key-mgmt-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/power-source-configuration-server" PRIV_REQUIRES bt chip QRCode) get_filename_component(CHIP_ROOT ../third_party/connectedhomeip REALPATH) @@ -144,6 +144,7 @@ idf_component_register(PRIV_INCLUDE_DIRS "${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" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/group-key-mgmt-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/on-off-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials-server" diff --git a/examples/lock-app/mbed/CMakeLists.txt b/examples/lock-app/mbed/CMakeLists.txt index 71915eb01b071d..ddc6fb8b144a7e 100644 --- a/examples/lock-app/mbed/CMakeLists.txt +++ b/examples/lock-app/mbed/CMakeLists.txt @@ -84,6 +84,7 @@ target_sources(${APP_TARGET} PRIVATE ${CHIP_ROOT}/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp ${CHIP_ROOT}/src/app/clusters/switch-server/switch-server.cpp ${CHIP_ROOT}/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp + ${CHIP_ROOT}/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp ${CHIP_ROOT}/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp ${CHIP_ROOT}/src/app/clusters/network-commissioning/network-commissioning-ember.cpp ${CHIP_ROOT}/src/app/clusters/network-commissioning/network-commissioning.cpp diff --git a/examples/ota-provider-app/esp32/main/CMakeLists.txt b/examples/ota-provider-app/esp32/main/CMakeLists.txt index 777e87a07ecf3e..10219078b5ff9b 100644 --- a/examples/ota-provider-app/esp32/main/CMakeLists.txt +++ b/examples/ota-provider-app/esp32/main/CMakeLists.txt @@ -41,6 +41,7 @@ idf_component_register(PRIV_INCLUDE_DIRS "${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" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/group-key-mgmt-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-commissioning-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials-server" diff --git a/examples/ota-requestor-app/esp32/main/CMakeLists.txt b/examples/ota-requestor-app/esp32/main/CMakeLists.txt index da030f0bccf926..a3d8d6876e3b1b 100644 --- a/examples/ota-requestor-app/esp32/main/CMakeLists.txt +++ b/examples/ota-requestor-app/esp32/main/CMakeLists.txt @@ -41,6 +41,7 @@ idf_component_register(PRIV_INCLUDE_DIRS "${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" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/group-key-mgmt-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-commissioning-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials-server" diff --git a/examples/temperature-measurement-app/esp32/main/CMakeLists.txt b/examples/temperature-measurement-app/esp32/main/CMakeLists.txt index d9f4e09f30d1ae..2c396c4be9f2ec 100644 --- a/examples/temperature-measurement-app/esp32/main/CMakeLists.txt +++ b/examples/temperature-measurement-app/esp32/main/CMakeLists.txt @@ -41,6 +41,7 @@ idf_component_register(PRIV_INCLUDE_DIRS "${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" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/group-key-mgmt-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-commissioning-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials-server" diff --git a/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp b/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp new file mode 100644 index 00000000000000..94584d346e1ea9 --- /dev/null +++ b/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp @@ -0,0 +1,529 @@ +/** + * + * Copyright (c) 2020 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace chip; +using namespace chip::app; +using namespace chip::Credentials; +using namespace chip::app::Clusters; + +// +// Attributes +// + +namespace { + +struct GroupKeyCodec +{ + static const TLV::Tag kTagFabric = TLV::ContextTag(to_underlying(GroupKeyManagement::Structs::GroupKey::Fields::kFabricIndex)); + static const TLV::Tag kTagGroup = TLV::ContextTag(to_underlying(GroupKeyManagement::Structs::GroupKey::Fields::kGroupId)); + static const TLV::Tag kTagKeyset = + TLV::ContextTag(to_underlying(GroupKeyManagement::Structs::GroupKey::Fields::kGroupKeySetID)); + + chip::FabricIndex mFabric = 0; + GroupDataProvider::GroupKey mMapping; + + GroupKeyCodec() = default; + GroupKeyCodec(chip::FabricIndex fabric_index, const GroupDataProvider::GroupKey & mapping) : + mFabric(fabric_index), mMapping(mapping) + {} + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const + { + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + + // FabricIndex + ReturnErrorOnFailure(DataModel::Encode(writer, kTagFabric, mFabric)); + // GroupId + ReturnErrorOnFailure(DataModel::Encode(writer, kTagGroup, mMapping.group_id)); + // GroupKeySetID + ReturnErrorOnFailure(DataModel::Encode(writer, kTagKeyset, mMapping.keyset_id)); + + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Decode(TLV::TLVReader & reader) + { + TLV::TLVType outer; + + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + + // FabricIndex + ReturnErrorOnFailure(reader.Next(kTagFabric)); + ReturnErrorOnFailure(reader.Get(mFabric)); + // GroupId + ReturnErrorOnFailure(reader.Next(kTagGroup)); + ReturnErrorOnFailure(reader.Get(mMapping.group_id)); + // GroupKeySetID + ReturnErrorOnFailure(reader.Next(kTagKeyset)); + ReturnErrorOnFailure(reader.Get(mMapping.keyset_id)); + + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; + } +}; + +struct GroupTableCodec +{ + static const TLV::Tag kTagFabric = TLV::ContextTag(to_underlying(GroupKeyManagement::Structs::GroupInfo::Fields::kFabricIndex)); + static const TLV::Tag kTagGroup = TLV::ContextTag(to_underlying(GroupKeyManagement::Structs::GroupInfo::Fields::kGroupId)); + static const TLV::Tag kTagEndpoints = + TLV::ContextTag(to_underlying(GroupKeyManagement::Structs::GroupInfo::Fields::kEndpoints)); + static const TLV::Tag kTagGroupName = + TLV::ContextTag(to_underlying(GroupKeyManagement::Structs::GroupInfo::Fields::kGroupName)); + + GroupDataProvider * mProvider = nullptr; + chip::FabricIndex mFabric; + GroupDataProvider::GroupInfo mInfo; + + GroupTableCodec(GroupDataProvider * provider, chip::FabricIndex fabric_index, GroupDataProvider::GroupInfo & info) : + mProvider(provider), mFabric(fabric_index), mInfo(info) + {} + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const + { + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + + // FabricIndex + ReturnErrorOnFailure(DataModel::Encode(writer, kTagFabric, mFabric)); + // GroupId + ReturnErrorOnFailure(DataModel::Encode(writer, kTagGroup, mInfo.group_id)); + // Endpoints + TLV::TLVType inner; + ReturnErrorOnFailure(writer.StartContainer(kTagEndpoints, TLV::kTLVType_Array, inner)); + GroupDataProvider::GroupEndpoint mapping; + auto iter = mProvider->IterateEndpoints(mFabric); + if (nullptr != iter) + { + while (iter->Next(mapping)) + { + if (mapping.group_id == mInfo.group_id) + { + ReturnErrorOnFailure(writer.Put(TLV::AnonymousTag, static_cast(mapping.endpoint_id))); + } + } + iter->Release(); + } + ReturnErrorOnFailure(writer.EndContainer(inner)); + // GroupName + uint32_t name_size = static_cast(strnlen(mInfo.name, GroupDataProvider::GroupInfo::kGroupNameMax)); + ReturnErrorOnFailure(writer.PutString(kTagGroupName, mInfo.name, name_size)); + + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; + } +}; + +class GroupKeyManagementAttributeAccess : public AttributeAccessInterface +{ +public: + // Register for the GroupKeyManagement cluster on all endpoints. + GroupKeyManagementAttributeAccess() : AttributeAccessInterface(Optional(0), GroupKeyManagement::Id) {} + + CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override + { + VerifyOrDie(aPath.mClusterId == GroupKeyManagement::Id); + + switch (aPath.mAttributeId) + { + case GroupKeyManagement::Attributes::ClusterRevision::Id: + return ReadClusterRevision(aPath.mEndpointId, aEncoder); + case GroupKeyManagement::Attributes::GroupKeyMap::Id: + return ReadGroupKeyMap(aPath.mEndpointId, aEncoder); + case GroupKeyManagement::Attributes::GroupTable::Id: + return ReadGroupTable(aPath.mEndpointId, aEncoder); + case GroupKeyManagement::Attributes::MaxGroupsPerFabric::Id: + return ReadMaxGroupsPerFabric(aPath.mEndpointId, aEncoder); + case GroupKeyManagement::Attributes::MaxGroupKeysPerFabric::Id: + return ReadMaxGroupKeysPerFabric(aPath.mEndpointId, aEncoder); + default: + break; + } + return CHIP_ERROR_READ_FAILED; + } + + CHIP_ERROR Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override + { + + if (GroupKeyManagement::Attributes::GroupKeyMap::Id == aPath.mAttributeId) + { + return WriteGroupKeyMap(aPath.mEndpointId, aDecoder); + } + return CHIP_ERROR_WRITE_FAILED; + } + +private: + static constexpr uint16_t kClusterRevision = 1; + + CHIP_ERROR ReadClusterRevision(EndpointId endpoint, AttributeValueEncoder & aEncoder) + { + return aEncoder.Encode(kClusterRevision); + } + CHIP_ERROR ReadGroupKeyMap(EndpointId endpoint, AttributeValueEncoder & aEncoder) + { + auto fabric_index = aEncoder.AccessingFabricIndex(); + auto provider = GetGroupDataProvider(); + VerifyOrReturnError(nullptr != provider, CHIP_ERROR_INTERNAL); + + CHIP_ERROR err = aEncoder.EncodeList([provider, fabric_index](const auto & encoder) -> CHIP_ERROR { + auto iter = provider->IterateGroupKeys(fabric_index); + VerifyOrReturnError(nullptr != iter, CHIP_ERROR_NO_MEMORY); + + GroupDataProvider::GroupKey mapping; + while (iter->Next(mapping)) + { + encoder.Encode(GroupKeyCodec(fabric_index, mapping)); + } + iter->Release(); + return CHIP_NO_ERROR; + }); + return err; + } + + CHIP_ERROR WriteGroupKeyMap(EndpointId endpoint, AttributeValueDecoder & aDecoder) + { + auto fabric_index = aDecoder.AccessingFabricIndex(); + auto provider = GetGroupDataProvider(); + DataModel::DecodableList list; + size_t new_count; + + VerifyOrReturnError(nullptr != provider, CHIP_ERROR_INTERNAL); + ReturnErrorOnFailure(aDecoder.Decode(list)); + ReturnErrorOnFailure(list.ComputeSize(&new_count)); + + // Remove existing keys + ReturnErrorOnFailure(provider->RemoveGroupKeys(fabric_index)); + + // Add the new keys + auto iter = list.begin(); + size_t i = 0; + while (iter.Next()) + { + const GroupKeyCodec & value = iter.GetValue(); + VerifyOrReturnError(fabric_index == value.mFabric, CHIP_ERROR_INVALID_FABRIC_ID); + ReturnErrorOnFailure(provider->SetGroupKeyAt(value.mFabric, i++, value.mMapping)); + } + ReturnErrorOnFailure(iter.GetStatus()); + return CHIP_NO_ERROR; + } + + CHIP_ERROR ReadGroupTable(EndpointId endpoint, AttributeValueEncoder & aEncoder) + { + auto fabric_index = aEncoder.AccessingFabricIndex(); + auto provider = GetGroupDataProvider(); + VerifyOrReturnError(nullptr != provider, CHIP_ERROR_INTERNAL); + + CHIP_ERROR err = aEncoder.EncodeList([provider, fabric_index](const auto & encoder) -> CHIP_ERROR { + auto iter = provider->IterateGroupInfo(fabric_index); + VerifyOrReturnError(nullptr != iter, CHIP_ERROR_NO_MEMORY); + + GroupDataProvider::GroupInfo info; + while (iter->Next(info)) + { + encoder.Encode(GroupTableCodec(provider, fabric_index, info)); + } + iter->Release(); + return CHIP_NO_ERROR; + }); + return err; + } + CHIP_ERROR ReadMaxGroupsPerFabric(EndpointId endpoint, AttributeValueEncoder & aEncoder) + { + auto * provider = GetGroupDataProvider(); + VerifyOrReturnError(nullptr != provider, CHIP_ERROR_INTERNAL); + return aEncoder.Encode(provider->GetMaxGroupsPerFabric()); + } + CHIP_ERROR ReadMaxGroupKeysPerFabric(EndpointId endpoint, AttributeValueEncoder & aEncoder) + { + auto * provider = GetGroupDataProvider(); + VerifyOrReturnError(nullptr != provider, CHIP_ERROR_INTERNAL); + return aEncoder.Encode(provider->GetMaxGroupKeysPerFabric()); + } +}; + +constexpr uint16_t GroupKeyManagementAttributeAccess::kClusterRevision; + +GroupKeyManagementAttributeAccess gAttribute; + +} // anonymous namespace + +void MatterGroupKeyManagementPluginServerInitCallback() +{ + registerAttributeAccessOverride(&gAttribute); +} + +// +// Commands +// + +void emberAfGroupKeyManagementClusterServerInitCallback(chip::EndpointId endpoint) {} + +bool emberAfGroupKeyManagementClusterKeySetWriteCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::DecodableType & commandData) +{ + auto fabric = commandObj->GetAccessingFabricIndex(); + auto * provider = GetGroupDataProvider(); + + if (nullptr == provider) + { + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); + return true; + } + + if (commandData.groupKeySet.epochKey0.empty() || (0 == commandData.groupKeySet.epochStartTime0)) + { + // If the EpochKey0 field is null or its associated EpochStartTime0 field is null, + // then this command SHALL fail with an INVALID_COMMAND + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_INVALID_COMMAND); + return true; + } + + GroupDataProvider::KeySet keyset(commandData.groupKeySet.groupKeySetID, commandData.groupKeySet.securityPolicy, 0); + + // Epoch Key 0 + keyset.epoch_keys[0].start_time = commandData.groupKeySet.epochStartTime0; + memcpy(keyset.epoch_keys[0].key, commandData.groupKeySet.epochKey0.data(), GroupDataProvider::EpochKey::kLengthBytes); + keyset.num_keys_used++; + + // Epoch Key 1 + if (!commandData.groupKeySet.epochKey1.empty()) + { + if (commandData.groupKeySet.epochStartTime1 <= commandData.groupKeySet.epochStartTime0) + { + // If the EpochKey1 field is not null, its associated EpochStartTime1 field SHALL contain + // a later epoch start time than the epoch start time found in the EpochStartTime0 field. + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_INVALID_COMMAND); + return true; + } + keyset.epoch_keys[1].start_time = commandData.groupKeySet.epochStartTime1; + memcpy(keyset.epoch_keys[1].key, commandData.groupKeySet.epochKey1.data(), GroupDataProvider::EpochKey::kLengthBytes); + keyset.num_keys_used++; + } + + // Epoch Key 2 + if (!commandData.groupKeySet.epochKey2.empty()) + { + keyset.num_keys_used++; + if (commandData.groupKeySet.epochStartTime2 <= commandData.groupKeySet.epochStartTime1) + { + // If the EpochKey1 field is not null, its associated EpochStartTime1 field SHALL contain + // a later epoch start time than the epoch start time found in the EpochStartTime0 field. + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_INVALID_COMMAND); + return true; + } + keyset.epoch_keys[2].start_time = commandData.groupKeySet.epochStartTime2; + memcpy(keyset.epoch_keys[2].key, commandData.groupKeySet.epochKey2.data(), GroupDataProvider::EpochKey::kLengthBytes); + keyset.num_keys_used++; + } + + // Set KeySet + CHIP_ERROR err = provider->SetKeySet(fabric, keyset); + if (CHIP_NO_ERROR == err) + { + ChipLogDetail(Zcl, "GroupKeyManagementCluster: KeySetWrite OK"); + } + else + { + ChipLogDetail(Zcl, "GroupKeyManagementCluster: KeySetWrite: %s", err.AsString()); + } + + // Send response + EmberStatus status = + emberAfSendImmediateDefaultResponse(CHIP_NO_ERROR == err ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE); + if (EMBER_SUCCESS != status) + { + ChipLogDetail(Zcl, "GroupKeyManagementCluster: KeySetWrite failed: 0x%x", status); + } + return true; +} + +bool emberAfGroupKeyManagementClusterKeySetReadCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::GroupKeyManagement::Commands::KeySetRead::DecodableType & commandData) +{ + auto fabric = commandObj->GetAccessingFabricIndex(); + auto * provider = GetGroupDataProvider(); + + if (nullptr == provider) + { + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); + return true; + } + + GroupDataProvider::KeySet keyset; + if (CHIP_NO_ERROR != provider->GetKeySet(fabric, commandData.groupKeySetID, keyset)) + { + // KeySet ID not found + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_NOT_FOUND); + return true; + } + + GroupKeyManagement::Commands::KeySetReadResponse::Type response; + response.groupKeySet.groupKeySetID = keyset.keyset_id; + response.groupKeySet.securityPolicy = keyset.policy; + // Keyset 0 + if (keyset.num_keys_used > 0) + { + response.groupKeySet.epochStartTime0 = keyset.epoch_keys[0].start_time; + response.groupKeySet.epochKey0 = chip::ByteSpan(keyset.epoch_keys[0].key, GroupDataProvider::EpochKey::kLengthBytes); + } + else + { + response.groupKeySet.epochStartTime0 = 0; + response.groupKeySet.epochKey0 = chip::ByteSpan(nullptr, 0); + } + // Keyset 1 + if (keyset.num_keys_used > 1) + { + response.groupKeySet.epochStartTime1 = keyset.epoch_keys[1].start_time; + response.groupKeySet.epochKey1 = chip::ByteSpan(keyset.epoch_keys[1].key, GroupDataProvider::EpochKey::kLengthBytes); + } + else + { + response.groupKeySet.epochStartTime1 = 0; + response.groupKeySet.epochKey1 = chip::ByteSpan(nullptr, 0); + } + // Keyset 2 + if (keyset.num_keys_used > 2) + { + response.groupKeySet.epochStartTime2 = keyset.epoch_keys[2].start_time; + response.groupKeySet.epochKey2 = chip::ByteSpan(keyset.epoch_keys[2].key, GroupDataProvider::EpochKey::kLengthBytes); + } + else + { + response.groupKeySet.epochStartTime2 = 0; + response.groupKeySet.epochKey2 = chip::ByteSpan(nullptr, 0); + } + + CHIP_ERROR err = commandObj->AddResponseData(commandPath, response); + if (CHIP_NO_ERROR != err) + { + ChipLogDetail(Zcl, "GroupKeyManagementCluster: KeySetRead failed: %s", ErrorStr(err)); + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); + } + return true; +} + +bool emberAfGroupKeyManagementClusterKeySetRemoveCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::GroupKeyManagement::Commands::KeySetRemove::DecodableType & commandData) + +{ + auto fabric = commandObj->GetAccessingFabricIndex(); + auto * provider = GetGroupDataProvider(); + EmberAfStatus status = EMBER_ZCL_STATUS_FAILURE; + + if (nullptr != provider) + { + // Remove keyset + CHIP_ERROR err = provider->RemoveKeySet(fabric, commandData.groupKeySetID); + if (CHIP_ERROR_KEY_NOT_FOUND == err) + { + status = EMBER_ZCL_STATUS_NOT_FOUND; + } + else if (CHIP_NO_ERROR == err) + { + status = EMBER_ZCL_STATUS_SUCCESS; + } + } + + // Send response + EmberStatus send_status = emberAfSendImmediateDefaultResponse(status); + if (EMBER_SUCCESS != send_status) + { + ChipLogDetail(Zcl, "GroupKeyManagementCluster: KeySetRemove failed: 0x%x", send_status); + } + return true; +} + +struct KeySetReadAllIndicesResponse +{ + static constexpr CommandId GetCommandId() { return GroupKeyManagement::Commands::KeySetReadAllIndicesResponse::Id; } + static constexpr ClusterId GetClusterId() { return GroupKeyManagement::Id; } + + GroupDataProvider::KeySetIterator * mIterator = nullptr; + + KeySetReadAllIndicesResponse(GroupDataProvider::KeySetIterator * iter) : mIterator(iter) {} + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const + { + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + + TLV::TLVType array; + ReturnErrorOnFailure(writer.StartContainer( + TLV::ContextTag(to_underlying(GroupKeyManagement::Commands::KeySetReadAllIndicesResponse::Fields::kGroupKeySetIDs)), + TLV::kTLVType_Array, array)); + + GroupDataProvider::KeySet keyset; + while (mIterator && mIterator->Next(keyset)) + { + ReturnErrorOnFailure(app::DataModel::Encode(writer, TLV::AnonymousTag, keyset.keyset_id)); + } + + ReturnErrorOnFailure(writer.EndContainer(array)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; + } +}; + +bool emberAfGroupKeyManagementClusterKeySetReadAllIndicesCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndices::DecodableType & commandData) +{ + auto fabric = commandObj->GetAccessingFabricIndex(); + auto * provider = GetGroupDataProvider(); + + if (nullptr == provider) + { + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); + return true; + } + + auto keysIt = provider->IterateKeySets(fabric); + if (nullptr == keysIt) + { + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); + return true; + } + + CHIP_ERROR err = commandObj->AddResponseData(commandPath, KeySetReadAllIndicesResponse(keysIt)); + if (CHIP_NO_ERROR != err) + { + ChipLogDetail(Zcl, "GroupKeyManagementCluster: KeySetReadAllIndices failed: %s", ErrorStr(err)); + } + keysIt->Release(); + return true; +} diff --git a/src/app/clusters/groups-server/groups-server.cpp b/src/app/clusters/groups-server/groups-server.cpp index e1c954fa841b19..bd8ee0a20ec928 100644 --- a/src/app/clusters/groups-server/groups-server.cpp +++ b/src/app/clusters/groups-server/groups-server.cpp @@ -342,7 +342,6 @@ bool emberAfGroupsClusterRemoveAllGroupsCallback(app::CommandHandler * commandOb #ifdef EMBER_AF_PLUGIN_SCENES { GroupDataProvider::EndpointIterator * iter = provider->IterateEndpoints(fabricIndex); - ; GroupDataProvider::GroupEndpoint mapping; VerifyOrExit(nullptr != iter, status = EMBER_ZCL_STATUS_FAILURE); diff --git a/src/app/tests/suites/TestGroupKeyManagementCluster.yaml b/src/app/tests/suites/TestGroupKeyManagementCluster.yaml new file mode 100644 index 00000000000000..e72319faffe01f --- /dev/null +++ b/src/app/tests/suites/TestGroupKeyManagementCluster.yaml @@ -0,0 +1,181 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +#` +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: GroupKeyManagement Cluster Tests + +config: + cluster: "Group Key Management" + endpoint: 0 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + + - label: "Add Group 1" + disabled: true + cluster: "Groups" + endpoint: 1 + command: "AddGroup" + arguments: + values: + - name: "groupId" + value: 11 + - name: "groupName" + value: "Group #1" + response: + values: + - name: "status" + value: 0 + - name: "groupId" + value: 11 + + - label: "Add Group 2" + disabled: true + cluster: "Groups" + endpoint: 1 + command: "AddGroup" + arguments: + values: + - name: "groupId" + value: 12 + - name: "groupName" + value: "Group #2" + response: + values: + - name: "status" + value: 0 + - name: "groupId" + value: 12 + + - label: "KeySetWrite 1" + disabled: true + command: "KeySetWrite" + arguments: + values: + - name: "groupKeySet" + value: + { + groupKeySetID: 101, + securityPolicy: 0, + epochKey0: + [ + 0xa0, + 0xa1, + 0xa2, + 0xa3, + 0xa4, + 0xa5, + 0xa6, + 0xa7, + 0xa8, + 0xa9, + 0xaa, + 0xab, + 0xac, + 0xad, + 0xae, + 0xaf, + ], + epochStartTime0: 1110000, + epochKey1: + [ + 0xb0, + 0xb1, + 0xb2, + 0xb3, + 0xb4, + 0xb5, + 0xb6, + 0xb7, + 0xb8, + 0xb9, + 0xba, + 0xbb, + 0xbc, + 0xbd, + 0xbe, + 0xbf, + ], + epochStartTime1: 1110001, + epochKey2: + [ + 0xc0, + 0xc1, + 0xc2, + 0xc3, + 0xc4, + 0xc5, + 0xc6, + 0xc7, + 0xc8, + 0xc9, + 0xca, + 0xcb, + 0xcc, + 0xcd, + 0xce, + 0xcf, + ], + epochStartTime2: 1110002, + } + + - label: "Write Group Keys" + disabled: true + command: "writeAttribute" + attribute: "groupKeyMap" + arguments: + value: + [ + { fabricIndex: 1, groupId: 11, groupKeySetID: 101 }, + { fabricIndex: 1, groupId: 12, groupKeySetID: 102 }, + ] + + - label: "Read Group Keys" + disabled: true + command: "readAttribute" + attribute: "groupKeyMap" + response: + value: + [ + { fabricIndex: 1, groupId: 11, groupKeySetID: 101 }, + { fabricIndex: 1, groupId: 12, groupKeySetID: 102 }, + ] + + - label: "Read GroupTable" + disabled: true + command: "readAttribute" + attribute: "groupTable" + response: + value: + [ + { + fabricIndex: 1, + groupId: 11, + endpoints: [1], + groupName: "Group #1", + }, + ] + + - label: "Read maxGroupsPerFabric" + command: "readAttribute" + attribute: "maxGroupsPerFabric" + response: + value: 1 + + - label: "Read maxGroupKeysPerFabric" + command: "readAttribute" + attribute: "maxGroupKeysPerFabric" + response: + value: 1 diff --git a/src/app/tests/suites/TestGroupsCluster.yaml b/src/app/tests/suites/TestGroupsCluster.yaml index 992986f10dbaec..3c3031de30775a 100644 --- a/src/app/tests/suites/TestGroupsCluster.yaml +++ b/src/app/tests/suites/TestGroupsCluster.yaml @@ -106,6 +106,8 @@ tests: value: [0x01] - label: "Add Group 2 (new)" + # https://github.com/project-chip/connectedhomeip/issues/11312 + disabled: true command: "AddGroup" arguments: values: @@ -121,6 +123,8 @@ tests: value: 0x1111 - label: "View Group 2 (new)" + # https://github.com/project-chip/connectedhomeip/issues/11312 + disabled: true command: "ViewGroup" arguments: values: @@ -149,6 +153,8 @@ tests: value: 0x7fff - label: "Add Group 3 (new)" + # https://github.com/project-chip/connectedhomeip/issues/11312 + disabled: true command: "AddGroup" arguments: values: @@ -179,6 +185,8 @@ tests: value: "Group #1" - label: "View Group 2 (existing)" + # https://github.com/project-chip/connectedhomeip/issues/11312 + disabled: true command: "ViewGroup" arguments: values: @@ -194,6 +202,8 @@ tests: value: "Group #2" - label: "Get Group Membership 2" + # https://github.com/project-chip/connectedhomeip/issues/11312 + disabled: true command: "GetGroupMembership" arguments: values: @@ -207,6 +217,8 @@ tests: value: [0x7fff] - label: "View Group 3 (new)" + # https://github.com/project-chip/connectedhomeip/issues/11312 + disabled: true command: "ViewGroup" arguments: values: @@ -248,6 +260,8 @@ tests: value: 0x04 - label: "Remove Group 2 (existing)" + # https://github.com/project-chip/connectedhomeip/issues/11312 + disabled: true command: "RemoveGroup" arguments: values: @@ -289,6 +303,8 @@ tests: value: 0x1111 - label: "View Group 3 (not removed)" + # https://github.com/project-chip/connectedhomeip/issues/11312 + disabled: true command: "ViewGroup" arguments: values: diff --git a/src/app/util/util.cpp b/src/app/util/util.cpp index d82283c909f802..4a99b32d53d890 100644 --- a/src/app/util/util.cpp +++ b/src/app/util/util.cpp @@ -295,7 +295,6 @@ void MatterBooleanStatePluginServerInitCallback() {} void MatterBridgedDeviceBasicPluginServerInitCallback() {} void MatterElectricalMeasurementPluginServerInitCallback() {} void MatterOtaSoftwareUpdateRequestorPluginServerInitCallback() {} -void MatterGroupKeyManagementPluginServerInitCallback() {} void MatterRelativeHumidityMeasurementPluginServerInitCallback() {} void MatterIlluminanceMeasurementPluginServerInitCallback() {} void MatterBinaryInputBasicPluginServerInitCallback() {} diff --git a/src/app/zap-templates/zcl/data-model/chip/group-key-mgmt-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/group-key-mgmt-cluster.xml index 72be9b90fd368d..b77a31d37bb6ab 100644 --- a/src/app/zap-templates/zcl/data-model/chip/group-key-mgmt-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/group-key-mgmt-cluster.xml @@ -17,26 +17,37 @@ limitations under the License. - - - - - + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + - - - + + + @@ -45,7 +56,44 @@ limitations under the License. 0x003F GROUP_KEY_MANAGEMENT_CLUSTER The Group Key Management Cluster is the mechanism by which group keys are managed. - groups - group keys + groupKeyMap + groupTable + maxGroupsPerFabric + maxGroupKeysPerFabric + + + Revoke a Root Key from a Group + + + + + Revoke a Root Key from a Group + + + + + + Response to KeySetRead + + + + + + Revoke a Root Key from a Group + + + + + Revoke a Root Key from a Group + + + + + + Reseponse to KeySetReadAllIndices + + + + \ No newline at end of file diff --git a/src/app/zap_cluster_list.py b/src/app/zap_cluster_list.py index c1562d6855a38b..a39395f2499dc2 100755 --- a/src/app/zap_cluster_list.py +++ b/src/app/zap_cluster_list.py @@ -37,7 +37,7 @@ 'FLOW_MEASUREMENT_CLUSTER': [], 'GENERAL_COMMISSIONING_CLUSTER': ['general-commissioning-server'], 'GENERAL_DIAGNOSTICS_CLUSTER': ['general-diagnostics-server'], - 'GROUP_KEY_MANAGEMENT_CLUSTER': [], + 'GROUP_KEY_MANAGEMENT_CLUSTER': ['group-key-mgmt-server'], 'GROUPS_CLUSTER': ['groups-server'], 'IAS_ZONE_CLUSTER': ['ias-zone-server'], 'IDENTIFY_CLUSTER': ['identify-server'], diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index da223c90c736ac..7290cbb0c2b783 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -6112,7 +6112,40 @@ "define": "GROUP_KEY_MANAGEMENT_CLUSTER", "side": "client", "enabled": 1, - "commands": [], + "commands": [ + { + "name": "KeySetWrite", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "KeySetRead", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "KeySetRemove", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "KeySetReadAllIndices", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + } + ], "attributes": [ { "name": "ClusterRevision", @@ -6138,15 +6171,32 @@ "define": "GROUP_KEY_MANAGEMENT_CLUSTER", "side": "server", "enabled": 0, - "commands": [], + "commands": [ + { + "name": "KeySetReadResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "KeySetReadAllIndicesResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 0 + } + ], "attributes": [ { - "name": "groups", + "name": "groupKeyMap", "code": 0, "mfgCode": null, "side": "server", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -6156,12 +6206,12 @@ "reportableChange": 0 }, { - "name": "group keys", + "name": "groupTable", "code": 1, "mfgCode": null, "side": "server", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -6170,6 +6220,36 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "maxGroupsPerFabric", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "maxGroupKeysPerFabric", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "AttributeList", "code": 65531, diff --git a/src/controller/java/zap-generated/CHIPCallbackTypes.h b/src/controller/java/zap-generated/CHIPCallbackTypes.h index ad02a448a0211f..531732aec635a7 100644 --- a/src/controller/java/zap-generated/CHIPCallbackTypes.h +++ b/src/controller/java/zap-generated/CHIPCallbackTypes.h @@ -489,11 +489,19 @@ typedef void (*CHIPGeneralDiagnosticsClusterAttributeListAttributeCallbackType)( void *, const chip::app::Clusters::GeneralDiagnostics::Attributes::AttributeList::TypeInfo::DecodableType &); typedef void (*CHIPGeneralDiagnosticsClusterClusterRevisionAttributeCallbackType)( void *, chip::app::Clusters::GeneralDiagnostics::Attributes::ClusterRevision::TypeInfo::DecodableArgType); +typedef void (*CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallbackType)( + void *, const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndicesResponse::DecodableType &); +typedef void (*CHIPGroupKeyManagementClusterKeySetReadResponseCallbackType)( + void *, const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadResponse::DecodableType &); -typedef void (*CHIPGroupKeyManagementClusterGroupsAttributeCallbackType)( - void *, const chip::app::Clusters::GroupKeyManagement::Attributes::Groups::TypeInfo::DecodableType &); -typedef void (*CHIPGroupKeyManagementClusterGroupKeysAttributeCallbackType)( - void *, const chip::app::Clusters::GroupKeyManagement::Attributes::GroupKeys::TypeInfo::DecodableType &); +typedef void (*CHIPGroupKeyManagementClusterGroupKeyMapAttributeCallbackType)( + void *, const chip::app::Clusters::GroupKeyManagement::Attributes::GroupKeyMap::TypeInfo::DecodableType &); +typedef void (*CHIPGroupKeyManagementClusterGroupTableAttributeCallbackType)( + void *, const chip::app::Clusters::GroupKeyManagement::Attributes::GroupTable::TypeInfo::DecodableType &); +typedef void (*CHIPGroupKeyManagementClusterMaxGroupsPerFabricAttributeCallbackType)( + void *, chip::app::Clusters::GroupKeyManagement::Attributes::MaxGroupsPerFabric::TypeInfo::DecodableArgType); +typedef void (*CHIPGroupKeyManagementClusterMaxGroupKeysPerFabricAttributeCallbackType)( + void *, chip::app::Clusters::GroupKeyManagement::Attributes::MaxGroupKeysPerFabric::TypeInfo::DecodableArgType); typedef void (*CHIPGroupKeyManagementClusterAttributeListAttributeCallbackType)( void *, const chip::app::Clusters::GroupKeyManagement::Attributes::AttributeList::TypeInfo::DecodableType &); typedef void (*CHIPGroupKeyManagementClusterClusterRevisionAttributeCallbackType)( diff --git a/src/controller/java/zap-generated/CHIPClusters-JNI.cpp b/src/controller/java/zap-generated/CHIPClusters-JNI.cpp index 6858e8dac9c58e..f184dfeae17ca9 100644 --- a/src/controller/java/zap-generated/CHIPClusters-JNI.cpp +++ b/src/controller/java/zap-generated/CHIPClusters-JNI.cpp @@ -9662,6 +9662,169 @@ JNI_METHOD(jlong, GroupKeyManagementCluster, initWithDevice)(JNIEnv * env, jobje return reinterpret_cast(cppCluster); } +JNI_METHOD(void, GroupKeyManagementCluster, keySetRead) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupKeySetID) +{ + chip::DeviceLayer::StackLock lock; + CHIP_ERROR err = CHIP_NO_ERROR; + GroupKeyManagementCluster * cppCluster; + + chip::app::Clusters::GroupKeyManagement::Commands::KeySetRead::Type request; + + request.groupKeySetID = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupKeySetID)); + + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); +} +JNI_METHOD(void, GroupKeyManagementCluster, keySetReadAllIndices) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupKeySetIDs) +{ + chip::DeviceLayer::StackLock lock; + CHIP_ERROR err = CHIP_NO_ERROR; + GroupKeyManagementCluster * cppCluster; + + chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndices::Type request; + + request.groupKeySetIDs = chip::app::DataModel::List(); + + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); +} +JNI_METHOD(void, GroupKeyManagementCluster, keySetRemove) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupKeySetID) +{ + chip::DeviceLayer::StackLock lock; + CHIP_ERROR err = CHIP_NO_ERROR; + GroupKeyManagementCluster * cppCluster; + + chip::app::Clusters::GroupKeyManagement::Commands::KeySetRemove::Type request; + + request.groupKeySetID = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupKeySetID)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); +} +JNI_METHOD(void, GroupKeyManagementCluster, keySetWrite) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupKeySetID, jobject securityPolicy, + jbyteArray epochKey0, jobject epochStartTime0, jbyteArray epochKey1, jobject epochStartTime1, jbyteArray epochKey2, + jobject epochStartTime2) +{ + chip::DeviceLayer::StackLock lock; + CHIP_ERROR err = CHIP_NO_ERROR; + GroupKeyManagementCluster * cppCluster; + + chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type request; + + request.groupKeySet = chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySet::Type(); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); +} JNI_METHOD(void, GroupKeyManagementCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { diff --git a/src/controller/java/zap-generated/CHIPClustersRead-JNI.cpp b/src/controller/java/zap-generated/CHIPClustersRead-JNI.cpp index 4dde312ef8757d..d34965f01cd872 100644 --- a/src/controller/java/zap-generated/CHIPClustersRead-JNI.cpp +++ b/src/controller/java/zap-generated/CHIPClustersRead-JNI.cpp @@ -7305,13 +7305,52 @@ JNI_METHOD(void, GeneralDiagnosticsCluster, readClusterRevisionAttribute) onFailure.release(); } -JNI_METHOD(void, GroupKeyManagementCluster, readGroupsAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, GroupKeyManagementCluster, readGroupKeyMapAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::GroupKeyManagement::Attributes::GroupKeyMap::TypeInfo; + std::unique_ptr + onSuccess(chip::Platform::New(callback, false), + chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + chip::Controller::GroupKeyManagementCluster * cppCluster = + reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, GroupKeyManagementCluster, readGroupTableAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::GroupKeyManagement::Attributes::Groups::TypeInfo; - std::unique_ptr - onSuccess(chip::Platform::New(callback, false), - chip::Platform::Delete); + using TypeInfo = chip::app::Clusters::GroupKeyManagement::Attributes::GroupTable::TypeInfo; + std::unique_ptr + onSuccess(chip::Platform::New(callback, false), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -7330,7 +7369,43 @@ JNI_METHOD(void, GroupKeyManagementCluster, readGroupsAttribute)(JNIEnv * env, j env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, GroupKeyManagementCluster, readMaxGroupsPerFabricAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::GroupKeyManagement::Attributes::MaxGroupsPerFabric::TypeInfo; + std::unique_ptr onSuccess( + chip::Platform::New(callback, false), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + chip::Controller::GroupKeyManagementCluster * cppCluster = + reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( @@ -7341,13 +7416,13 @@ JNI_METHOD(void, GroupKeyManagementCluster, readGroupsAttribute)(JNIEnv * env, j onFailure.release(); } -JNI_METHOD(void, GroupKeyManagementCluster, readGroupKeysAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, GroupKeyManagementCluster, readMaxGroupKeysPerFabricAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::GroupKeyManagement::Attributes::GroupKeys::TypeInfo; - std::unique_ptr - onSuccess(chip::Platform::New(callback, false), - chip::Platform::Delete); + using TypeInfo = chip::app::Clusters::GroupKeyManagement::Attributes::MaxGroupKeysPerFabric::TypeInfo; + std::unique_ptr onSuccess( + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -7366,7 +7441,8 @@ JNI_METHOD(void, GroupKeyManagementCluster, readGroupKeysAttribute)(JNIEnv * env env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp index 014a651f428df9..68c28826fb38f2 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp @@ -1034,6 +1034,126 @@ void CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback::Callbac env->CallVoidMethod(javaCallbackRef, javaMethod, errorCode, debugText); } +CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback:: + CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback:: + ~CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback::CallbackFn( + void * context, + const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndicesResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "()V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject groupKeySetIDs; + + groupKeySetIDs = nullptr; /* Array - Conversion from this type to Java is not properly implemented yet */ + + env->CallVoidMethod(javaCallbackRef, javaMethod, groupKeySetIDs); +} +CHIPGroupKeyManagementClusterKeySetReadResponseCallback::CHIPGroupKeyManagementClusterKeySetReadResponseCallback( + jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPGroupKeyManagementClusterKeySetReadResponseCallback::~CHIPGroupKeyManagementClusterKeySetReadResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPGroupKeyManagementClusterKeySetReadResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "()V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject groupKeySet; + + groupKeySet = nullptr; /* Struct - conversion from this type to Java is not properly implemented yet */ + + env->CallVoidMethod(javaCallbackRef, javaMethod, groupKeySet); +} CHIPGroupsClusterAddGroupResponseCallback::CHIPGroupsClusterAddGroupResponseCallback(jobject javaCallback) : Callback::Callback(CallbackFn, this) { diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.h b/src/controller/java/zap-generated/CHIPInvokeCallbacks.h index 2d92f6dab72906..6d1e9a2545856f 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.h +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.h @@ -234,6 +234,37 @@ class CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback jobject javaCallbackRef; }; +class CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback + : public Callback::Callback +{ +public: + CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback(jobject javaCallback); + + ~CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback(); + + static void + CallbackFn(void * context, + const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndicesResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPGroupKeyManagementClusterKeySetReadResponseCallback + : public Callback::Callback +{ +public: + CHIPGroupKeyManagementClusterKeySetReadResponseCallback(jobject javaCallback); + + ~CHIPGroupKeyManagementClusterKeySetReadResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + class CHIPGroupsClusterAddGroupResponseCallback : public Callback::Callback { public: diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index fce016748eff28..bfcae76141533c 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -5184,8 +5184,10 @@ void CHIPGeneralDiagnosticsAttributeListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPGroupKeyManagementGroupsAttributeCallback::CHIPGroupKeyManagementGroupsAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +CHIPGroupKeyManagementGroupKeyMapAttributeCallback::CHIPGroupKeyManagementGroupKeyMapAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -5201,7 +5203,7 @@ CHIPGroupKeyManagementGroupsAttributeCallback::CHIPGroupKeyManagementGroupsAttri } } -CHIPGroupKeyManagementGroupsAttributeCallback::~CHIPGroupKeyManagementGroupsAttributeCallback() +CHIPGroupKeyManagementGroupKeyMapAttributeCallback::~CHIPGroupKeyManagementGroupKeyMapAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -5212,9 +5214,9 @@ CHIPGroupKeyManagementGroupsAttributeCallback::~CHIPGroupKeyManagementGroupsAttr env->DeleteGlobalRef(javaCallbackRef); } -void CHIPGroupKeyManagementGroupsAttributeCallback::CallbackFn( +void CHIPGroupKeyManagementGroupKeyMapAttributeCallback::CallbackFn( void * context, - const chip::app::DataModel::DecodableList & list) + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -5223,8 +5225,8 @@ void CHIPGroupKeyManagementGroupsAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -5248,80 +5250,81 @@ void CHIPGroupKeyManagementGroupsAttributeCallback::CallbackFn( jclass attributeClass; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipClusters$GroupKeyManagementCluster$GroupsAttribute", attributeClass); + env, "chip/devicecontroller/ChipClusters$GroupKeyManagementCluster$GroupKeyMapAttribute", attributeClass); VerifyOrReturn( err == CHIP_NO_ERROR, - ChipLogError(Zcl, "Could not find class chip/devicecontroller/ChipClusters$GroupKeyManagementCluster$GroupsAttribute")); + ChipLogError(Zcl, + "Could not find class chip/devicecontroller/ChipClusters$GroupKeyManagementCluster$GroupKeyMapAttribute")); chip::JniClass attributeJniClass(attributeClass); jmethodID attributeCtor = env->GetMethodID(attributeClass, "", "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V"); - VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find GroupsAttribute constructor")); + VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find GroupKeyMapAttribute constructor")); auto iter = list.begin(); while (iter.Next()) { auto & entry = iter.GetValue(); (void) entry; - bool vendorIdNull = false; - bool vendorIdHasValue = true; + bool fabricIndexNull = false; + bool fabricIndexHasValue = true; - uint16_t vendorIdValue = entry.vendorId; + uint16_t fabricIndexValue = entry.fabricIndex; - jobject vendorId = nullptr; - if (!vendorIdNull && vendorIdHasValue) + jobject fabricIndex = nullptr; + if (!fabricIndexNull && fabricIndexHasValue) { - jclass vendorIdEntryCls; - chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", vendorIdEntryCls); - chip::JniClass vendorIdJniClass(vendorIdEntryCls); - jmethodID vendorIdEntryTypeCtor = env->GetMethodID(vendorIdEntryCls, "", "(I)V"); - vendorId = env->NewObject(vendorIdEntryCls, vendorIdEntryTypeCtor, vendorIdValue); + jclass fabricIndexEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", fabricIndexEntryCls); + chip::JniClass fabricIndexJniClass(fabricIndexEntryCls); + jmethodID fabricIndexEntryTypeCtor = env->GetMethodID(fabricIndexEntryCls, "", "(I)V"); + fabricIndex = env->NewObject(fabricIndexEntryCls, fabricIndexEntryTypeCtor, fabricIndexValue); } - bool vendorGroupIdNull = false; - bool vendorGroupIdHasValue = true; + bool groupIdNull = false; + bool groupIdHasValue = true; - uint16_t vendorGroupIdValue = entry.vendorGroupId; + uint16_t groupIdValue = entry.groupId; - jobject vendorGroupId = nullptr; - if (!vendorGroupIdNull && vendorGroupIdHasValue) + jobject groupId = nullptr; + if (!groupIdNull && groupIdHasValue) { - jclass vendorGroupIdEntryCls; - chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", vendorGroupIdEntryCls); - chip::JniClass vendorGroupIdJniClass(vendorGroupIdEntryCls); - jmethodID vendorGroupIdEntryTypeCtor = env->GetMethodID(vendorGroupIdEntryCls, "", "(I)V"); - vendorGroupId = env->NewObject(vendorGroupIdEntryCls, vendorGroupIdEntryTypeCtor, vendorGroupIdValue); + jclass groupIdEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", groupIdEntryCls); + chip::JniClass groupIdJniClass(groupIdEntryCls); + jmethodID groupIdEntryTypeCtor = env->GetMethodID(groupIdEntryCls, "", "(I)V"); + groupId = env->NewObject(groupIdEntryCls, groupIdEntryTypeCtor, groupIdValue); } - bool groupKeySetIndexNull = false; - bool groupKeySetIndexHasValue = true; + bool groupKeySetIDNull = false; + bool groupKeySetIDHasValue = true; - uint16_t groupKeySetIndexValue = entry.groupKeySetIndex; + uint16_t groupKeySetIDValue = entry.groupKeySetID; - jobject groupKeySetIndex = nullptr; - if (!groupKeySetIndexNull && groupKeySetIndexHasValue) + jobject groupKeySetID = nullptr; + if (!groupKeySetIDNull && groupKeySetIDHasValue) { - jclass groupKeySetIndexEntryCls; - chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", groupKeySetIndexEntryCls); - chip::JniClass groupKeySetIndexJniClass(groupKeySetIndexEntryCls); - jmethodID groupKeySetIndexEntryTypeCtor = env->GetMethodID(groupKeySetIndexEntryCls, "", "(I)V"); - groupKeySetIndex = env->NewObject(groupKeySetIndexEntryCls, groupKeySetIndexEntryTypeCtor, groupKeySetIndexValue); + jclass groupKeySetIDEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", groupKeySetIDEntryCls); + chip::JniClass groupKeySetIDJniClass(groupKeySetIDEntryCls); + jmethodID groupKeySetIDEntryTypeCtor = env->GetMethodID(groupKeySetIDEntryCls, "", "(I)V"); + groupKeySetID = env->NewObject(groupKeySetIDEntryCls, groupKeySetIDEntryTypeCtor, groupKeySetIDValue); } - jobject attributeObj = env->NewObject(attributeClass, attributeCtor, vendorId, vendorGroupId, groupKeySetIndex); - VerifyOrReturn(attributeObj != nullptr, ChipLogError(Zcl, "Could not create GroupsAttribute object")); + jobject attributeObj = env->NewObject(attributeClass, attributeCtor, fabricIndex, groupId, groupKeySetID); + VerifyOrReturn(attributeObj != nullptr, ChipLogError(Zcl, "Could not create GroupKeyMapAttribute object")); env->CallBooleanMethod(arrayListObj, arrayListAddMethod, attributeObj); } VerifyOrReturn(iter.GetStatus() == CHIP_NO_ERROR, - ChipLogError(Zcl, "Error decoding GroupsAttribute value: %" CHIP_ERROR_FORMAT, iter.GetStatus().Format())); + ChipLogError(Zcl, "Error decoding GroupKeyMapAttribute value: %" CHIP_ERROR_FORMAT, iter.GetStatus().Format())); env->ExceptionClear(); env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPGroupKeyManagementGroupKeysAttributeCallback::CHIPGroupKeyManagementGroupKeysAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPGroupKeyManagementGroupTableAttributeCallback::CHIPGroupKeyManagementGroupTableAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -5338,7 +5341,7 @@ CHIPGroupKeyManagementGroupKeysAttributeCallback::CHIPGroupKeyManagementGroupKey } } -CHIPGroupKeyManagementGroupKeysAttributeCallback::~CHIPGroupKeyManagementGroupKeysAttributeCallback() +CHIPGroupKeyManagementGroupTableAttributeCallback::~CHIPGroupKeyManagementGroupTableAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -5349,9 +5352,9 @@ CHIPGroupKeyManagementGroupKeysAttributeCallback::~CHIPGroupKeyManagementGroupKe env->DeleteGlobalRef(javaCallbackRef); } -void CHIPGroupKeyManagementGroupKeysAttributeCallback::CallbackFn( +void CHIPGroupKeyManagementGroupTableAttributeCallback::CallbackFn( void * context, - const chip::app::DataModel::DecodableList & list) + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -5360,8 +5363,8 @@ void CHIPGroupKeyManagementGroupKeysAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -5385,103 +5388,69 @@ void CHIPGroupKeyManagementGroupKeysAttributeCallback::CallbackFn( jclass attributeClass; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipClusters$GroupKeyManagementCluster$GroupKeysAttribute", attributeClass); + env, "chip/devicecontroller/ChipClusters$GroupKeyManagementCluster$GroupTableAttribute", attributeClass); VerifyOrReturn( err == CHIP_NO_ERROR, - ChipLogError(Zcl, "Could not find class chip/devicecontroller/ChipClusters$GroupKeyManagementCluster$GroupKeysAttribute")); + ChipLogError(Zcl, "Could not find class chip/devicecontroller/ChipClusters$GroupKeyManagementCluster$GroupTableAttribute")); chip::JniClass attributeJniClass(attributeClass); - jmethodID attributeCtor = env->GetMethodID(attributeClass, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;[BLjava/lang/Long;Ljava/lang/Integer;)V"); - VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find GroupKeysAttribute constructor")); + jmethodID attributeCtor = + env->GetMethodID(attributeClass, "", "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/String;)V"); + VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find GroupTableAttribute constructor")); auto iter = list.begin(); while (iter.Next()) { auto & entry = iter.GetValue(); (void) entry; - bool vendorIdNull = false; - bool vendorIdHasValue = true; - - uint16_t vendorIdValue = entry.vendorId; - - jobject vendorId = nullptr; - if (!vendorIdNull && vendorIdHasValue) - { - jclass vendorIdEntryCls; - chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", vendorIdEntryCls); - chip::JniClass vendorIdJniClass(vendorIdEntryCls); - jmethodID vendorIdEntryTypeCtor = env->GetMethodID(vendorIdEntryCls, "", "(I)V"); - vendorId = env->NewObject(vendorIdEntryCls, vendorIdEntryTypeCtor, vendorIdValue); - } - - bool groupKeyIndexNull = false; - bool groupKeyIndexHasValue = true; - - uint16_t groupKeyIndexValue = entry.groupKeyIndex; - - jobject groupKeyIndex = nullptr; - if (!groupKeyIndexNull && groupKeyIndexHasValue) - { - jclass groupKeyIndexEntryCls; - chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", groupKeyIndexEntryCls); - chip::JniClass groupKeyIndexJniClass(groupKeyIndexEntryCls); - jmethodID groupKeyIndexEntryTypeCtor = env->GetMethodID(groupKeyIndexEntryCls, "", "(I)V"); - groupKeyIndex = env->NewObject(groupKeyIndexEntryCls, groupKeyIndexEntryTypeCtor, groupKeyIndexValue); - } - - bool groupKeyRootNull = false; - bool groupKeyRootHasValue = true; + bool fabricIndexNull = false; + bool fabricIndexHasValue = true; - chip::ByteSpan groupKeyRootValue = entry.groupKeyRoot; + uint16_t fabricIndexValue = entry.fabricIndex; - jbyteArray groupKeyRoot = nullptr; - if (!groupKeyRootNull && groupKeyRootHasValue) + jobject fabricIndex = nullptr; + if (!fabricIndexNull && fabricIndexHasValue) { - groupKeyRoot = env->NewByteArray(groupKeyRootValue.size()); - env->SetByteArrayRegion(groupKeyRoot, 0, groupKeyRootValue.size(), - reinterpret_cast(groupKeyRootValue.data())); + jclass fabricIndexEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", fabricIndexEntryCls); + chip::JniClass fabricIndexJniClass(fabricIndexEntryCls); + jmethodID fabricIndexEntryTypeCtor = env->GetMethodID(fabricIndexEntryCls, "", "(I)V"); + fabricIndex = env->NewObject(fabricIndexEntryCls, fabricIndexEntryTypeCtor, fabricIndexValue); } - bool groupKeyEpochStartTimeNull = false; - bool groupKeyEpochStartTimeHasValue = true; + bool groupIdNull = false; + bool groupIdHasValue = true; - uint64_t groupKeyEpochStartTimeValue = entry.groupKeyEpochStartTime; + uint16_t groupIdValue = entry.groupId; - jobject groupKeyEpochStartTime = nullptr; - if (!groupKeyEpochStartTimeNull && groupKeyEpochStartTimeHasValue) + jobject groupId = nullptr; + if (!groupIdNull && groupIdHasValue) { - jclass groupKeyEpochStartTimeEntryCls; - chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Long", groupKeyEpochStartTimeEntryCls); - chip::JniClass groupKeyEpochStartTimeJniClass(groupKeyEpochStartTimeEntryCls); - jmethodID groupKeyEpochStartTimeEntryTypeCtor = env->GetMethodID(groupKeyEpochStartTimeEntryCls, "", "(J)V"); - groupKeyEpochStartTime = - env->NewObject(groupKeyEpochStartTimeEntryCls, groupKeyEpochStartTimeEntryTypeCtor, groupKeyEpochStartTimeValue); + jclass groupIdEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", groupIdEntryCls); + chip::JniClass groupIdJniClass(groupIdEntryCls); + jmethodID groupIdEntryTypeCtor = env->GetMethodID(groupIdEntryCls, "", "(I)V"); + groupId = env->NewObject(groupIdEntryCls, groupIdEntryTypeCtor, groupIdValue); } - bool groupKeySecurityPolicyNull = false; - bool groupKeySecurityPolicyHasValue = true; + bool groupNameNull = false; + bool groupNameHasValue = true; - chip::app::Clusters::GroupKeyManagement::GroupKeySecurityPolicy groupKeySecurityPolicyValue = entry.groupKeySecurityPolicy; + chip::CharSpan groupNameValue = entry.groupName; - jobject groupKeySecurityPolicy = nullptr; - if (!groupKeySecurityPolicyNull && groupKeySecurityPolicyHasValue) + jstring groupName = nullptr; + chip::UtfString groupNameStr(env, groupNameValue); + if (!groupNameNull && groupNameHasValue) { - jclass groupKeySecurityPolicyEntryCls; - chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", groupKeySecurityPolicyEntryCls); - chip::JniClass groupKeySecurityPolicyJniClass(groupKeySecurityPolicyEntryCls); - jmethodID groupKeySecurityPolicyEntryTypeCtor = env->GetMethodID(groupKeySecurityPolicyEntryCls, "", "(I)V"); - groupKeySecurityPolicy = - env->NewObject(groupKeySecurityPolicyEntryCls, groupKeySecurityPolicyEntryTypeCtor, groupKeySecurityPolicyValue); + groupName = jstring(groupNameStr.jniValue()); } - jobject attributeObj = env->NewObject(attributeClass, attributeCtor, vendorId, groupKeyIndex, groupKeyRoot, - groupKeyEpochStartTime, groupKeySecurityPolicy); - VerifyOrReturn(attributeObj != nullptr, ChipLogError(Zcl, "Could not create GroupKeysAttribute object")); + jobject attributeObj = env->NewObject(attributeClass, attributeCtor, fabricIndex, groupId, groupName); + VerifyOrReturn(attributeObj != nullptr, ChipLogError(Zcl, "Could not create GroupTableAttribute object")); env->CallBooleanMethod(arrayListObj, arrayListAddMethod, attributeObj); } VerifyOrReturn(iter.GetStatus() == CHIP_NO_ERROR, - ChipLogError(Zcl, "Error decoding GroupKeysAttribute value: %" CHIP_ERROR_FORMAT, iter.GetStatus().Format())); + ChipLogError(Zcl, "Error decoding GroupTableAttribute value: %" CHIP_ERROR_FORMAT, iter.GetStatus().Format())); env->ExceptionClear(); env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.h b/src/controller/java/zap-generated/CHIPReadCallbacks.h index c937177539498e..b896fa62716f37 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.h +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.h @@ -1792,31 +1792,31 @@ class CHIPGeneralDiagnosticsAttributeListAttributeCallback bool keepAlive; }; -class CHIPGroupKeyManagementGroupsAttributeCallback - : public chip::Callback::Callback +class CHIPGroupKeyManagementGroupKeyMapAttributeCallback + : public chip::Callback::Callback { public: - CHIPGroupKeyManagementGroupsAttributeCallback(jobject javaCallback, bool keepAlive = false); + CHIPGroupKeyManagementGroupKeyMapAttributeCallback(jobject javaCallback, bool keepAlive = false); - ~CHIPGroupKeyManagementGroupsAttributeCallback(); + ~CHIPGroupKeyManagementGroupKeyMapAttributeCallback(); - static void maybeDestroy(CHIPGroupKeyManagementGroupsAttributeCallback * callback) + static void maybeDestroy(CHIPGroupKeyManagementGroupKeyMapAttributeCallback * callback) { if (!callback->keepAlive) { callback->Cancel(); - chip::Platform::Delete(callback); + chip::Platform::Delete(callback); } } static void CallbackFn( void * context, - const chip::app::DataModel::DecodableList & + const chip::app::DataModel::DecodableList & list); static void OnSubscriptionEstablished(void * context) { CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( - reinterpret_cast(context)->javaCallbackRef); + reinterpret_cast(context)->javaCallbackRef); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); }; @@ -1825,31 +1825,31 @@ class CHIPGroupKeyManagementGroupsAttributeCallback bool keepAlive; }; -class CHIPGroupKeyManagementGroupKeysAttributeCallback - : public chip::Callback::Callback +class CHIPGroupKeyManagementGroupTableAttributeCallback + : public chip::Callback::Callback { public: - CHIPGroupKeyManagementGroupKeysAttributeCallback(jobject javaCallback, bool keepAlive = false); + CHIPGroupKeyManagementGroupTableAttributeCallback(jobject javaCallback, bool keepAlive = false); - ~CHIPGroupKeyManagementGroupKeysAttributeCallback(); + ~CHIPGroupKeyManagementGroupTableAttributeCallback(); - static void maybeDestroy(CHIPGroupKeyManagementGroupKeysAttributeCallback * callback) + static void maybeDestroy(CHIPGroupKeyManagementGroupTableAttributeCallback * callback) { if (!callback->keepAlive) { callback->Cancel(); - chip::Platform::Delete(callback); + chip::Platform::Delete(callback); } } static void CallbackFn( void * context, - const chip::app::DataModel::DecodableList & + const chip::app::DataModel::DecodableList & list); static void OnSubscriptionEstablished(void * context) { CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( - reinterpret_cast(context)->javaCallbackRef); + reinterpret_cast(context)->javaCallbackRef); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); }; diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java index aac3ab56f1b7d0..2357f6512e7e17 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -5111,93 +5111,149 @@ public static long clusterId() { @Override public native long initWithDevice(long devicePtr, int endpointId); - public static class GroupsAttribute { - public Integer vendorId; - public Integer vendorGroupId; - public Integer groupKeySetIndex; + public void keySetRead(KeySetReadResponseCallback callback, Integer groupKeySetID) { + keySetRead(chipClusterPtr, callback, groupKeySetID); + } - public GroupsAttribute(Integer vendorId, Integer vendorGroupId, Integer groupKeySetIndex) { - this.vendorId = vendorId; - this.vendorGroupId = vendorGroupId; - this.groupKeySetIndex = groupKeySetIndex; + public void keySetReadAllIndices( + KeySetReadAllIndicesResponseCallback callback, Integer groupKeySetIDs) { + keySetReadAllIndices(chipClusterPtr, callback, groupKeySetIDs); + } + + public void keySetRemove(DefaultClusterCallback callback, Integer groupKeySetID) { + keySetRemove(chipClusterPtr, callback, groupKeySetID); + } + + public void keySetWrite( + DefaultClusterCallback callback, + Integer groupKeySetID, + Integer securityPolicy, + byte[] epochKey0, + Long epochStartTime0, + byte[] epochKey1, + Long epochStartTime1, + byte[] epochKey2, + Long epochStartTime2) { + keySetWrite( + chipClusterPtr, + callback, + groupKeySetID, + securityPolicy, + epochKey0, + epochStartTime0, + epochKey1, + epochStartTime1, + epochKey2, + epochStartTime2); + } + + private native void keySetRead( + long chipClusterPtr, KeySetReadResponseCallback Callback, Integer groupKeySetID); + + private native void keySetReadAllIndices( + long chipClusterPtr, KeySetReadAllIndicesResponseCallback Callback, Integer groupKeySetIDs); + + private native void keySetRemove( + long chipClusterPtr, DefaultClusterCallback Callback, Integer groupKeySetID); + + private native void keySetWrite( + long chipClusterPtr, + DefaultClusterCallback Callback, + Integer groupKeySetID, + Integer securityPolicy, + byte[] epochKey0, + Long epochStartTime0, + byte[] epochKey1, + Long epochStartTime1, + byte[] epochKey2, + Long epochStartTime2); + + public interface KeySetReadAllIndicesResponseCallback { + void onSuccess( // groupKeySetIDs: /* TYPE WARNING: array array defaults to */ uint8_t * + // Conversion from this type to Java is not properly implemented yet + ); + + void onError(Exception error); + } + + public interface KeySetReadResponseCallback { + void onSuccess( // groupKeySet: Struct GroupKeySet + // Conversion from this type to Java is not properly implemented yet + ); + + void onError(Exception error); + } + + public static class GroupKeyMapAttribute { + public Integer fabricIndex; + public Integer groupId; + public Integer groupKeySetID; + + public GroupKeyMapAttribute(Integer fabricIndex, Integer groupId, Integer groupKeySetID) { + this.fabricIndex = fabricIndex; + this.groupId = groupId; + this.groupKeySetID = groupKeySetID; } @Override public String toString() { StringBuilder output = new StringBuilder(""); - output.append("int vendorId: "); - output.append(this.vendorId); + output.append("int fabricIndex: "); + output.append(this.fabricIndex); output.append("\n"); - output.append("int vendorGroupId: "); - output.append(this.vendorGroupId); + output.append("int groupId: "); + output.append(this.groupId); output.append("\n"); - output.append("int groupKeySetIndex: "); - output.append(this.groupKeySetIndex); + output.append("int groupKeySetID: "); + output.append(this.groupKeySetID); output.append("\n"); return output.toString(); } } - public interface GroupsAttributeCallback { - void onSuccess(List valueList); + public interface GroupKeyMapAttributeCallback { + void onSuccess(List valueList); void onError(Exception ex); default void onSubscriptionEstablished() {} } - public static class GroupKeysAttribute { - public Integer vendorId; - public Integer groupKeyIndex; - public byte[] groupKeyRoot; - public Long groupKeyEpochStartTime; - public Integer groupKeySecurityPolicy; + public static class GroupTableAttribute { + public Integer fabricIndex; + public Integer groupId; + public String groupName; - public GroupKeysAttribute( - Integer vendorId, - Integer groupKeyIndex, - byte[] groupKeyRoot, - Long groupKeyEpochStartTime, - Integer groupKeySecurityPolicy) { - this.vendorId = vendorId; - this.groupKeyIndex = groupKeyIndex; - this.groupKeyRoot = groupKeyRoot; - this.groupKeyEpochStartTime = groupKeyEpochStartTime; - this.groupKeySecurityPolicy = groupKeySecurityPolicy; + public GroupTableAttribute(Integer fabricIndex, Integer groupId, String groupName) { + this.fabricIndex = fabricIndex; + this.groupId = groupId; + this.groupName = groupName; } @Override public String toString() { StringBuilder output = new StringBuilder(""); - output.append("int vendorId: "); - output.append(this.vendorId); - output.append("\n"); - - output.append("int groupKeyIndex: "); - output.append(this.groupKeyIndex); - output.append("\n"); - - output.append("byte[] "); - output.append(Arrays.toString(groupKeyRoot)); + output.append("int fabricIndex: "); + output.append(this.fabricIndex); output.append("\n"); - output.append("long groupKeyEpochStartTime: "); - output.append(this.groupKeyEpochStartTime); + output.append("int groupId: "); + output.append(this.groupId); output.append("\n"); - output.append("int groupKeySecurityPolicy: "); - output.append(this.groupKeySecurityPolicy); + output.append("String groupName: "); + output.append(this.groupName); output.append("\n"); return output.toString(); } } - public interface GroupKeysAttributeCallback { - void onSuccess(List valueList); + public interface GroupTableAttributeCallback { + void onSuccess(List valueList); void onError(Exception ex); @@ -5212,12 +5268,20 @@ public interface AttributeListAttributeCallback { default void onSubscriptionEstablished() {} } - public void readGroupsAttribute(GroupsAttributeCallback callback) { - readGroupsAttribute(chipClusterPtr, callback); + public void readGroupKeyMapAttribute(GroupKeyMapAttributeCallback callback) { + readGroupKeyMapAttribute(chipClusterPtr, callback); + } + + public void readGroupTableAttribute(GroupTableAttributeCallback callback) { + readGroupTableAttribute(chipClusterPtr, callback); + } + + public void readMaxGroupsPerFabricAttribute(IntegerAttributeCallback callback) { + readMaxGroupsPerFabricAttribute(chipClusterPtr, callback); } - public void readGroupKeysAttribute(GroupKeysAttributeCallback callback) { - readGroupKeysAttribute(chipClusterPtr, callback); + public void readMaxGroupKeysPerFabricAttribute(IntegerAttributeCallback callback) { + readMaxGroupKeysPerFabricAttribute(chipClusterPtr, callback); } public void readAttributeListAttribute(AttributeListAttributeCallback callback) { @@ -5233,10 +5297,17 @@ public void subscribeClusterRevisionAttribute( subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - private native void readGroupsAttribute(long chipClusterPtr, GroupsAttributeCallback callback); + private native void readGroupKeyMapAttribute( + long chipClusterPtr, GroupKeyMapAttributeCallback callback); + + private native void readGroupTableAttribute( + long chipClusterPtr, GroupTableAttributeCallback callback); - private native void readGroupKeysAttribute( - long chipClusterPtr, GroupKeysAttributeCallback callback); + private native void readMaxGroupsPerFabricAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void readMaxGroupKeysPerFabricAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java index 4e033d18b85ff3..cf50c03395cdbb 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java @@ -1743,8 +1743,8 @@ public void onError(Exception ex) { } } - public static class DelegatedGroupKeyManagementClusterGroupsAttributeCallback - implements ChipClusters.GroupKeyManagementCluster.GroupsAttributeCallback, + public static class DelegatedKeySetReadAllIndicesResponseCallback + implements ChipClusters.GroupKeyManagementCluster.KeySetReadAllIndicesResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -1754,11 +1754,64 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess( // groupKeySetIDs: /* TYPE WARNING: array array defaults to */ uint8_t * + // Conversion from this type to Java is not properly implemented yet + ) { + Map responseValues = new LinkedHashMap<>(); + // groupKeySetIDs: /* TYPE WARNING: array array defaults to */ uint8_t * + // Conversion from this type to Java is not properly implemented yet + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + + public static class DelegatedKeySetReadResponseCallback + implements ChipClusters.GroupKeyManagementCluster.KeySetReadResponseCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess( // groupKeySet: Struct GroupKeySet + // Conversion from this type to Java is not properly implemented yet + ) { + Map responseValues = new LinkedHashMap<>(); + // groupKeySet: Struct GroupKeySet + // Conversion from this type to Java is not properly implemented yet + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + + public static class DelegatedGroupKeyManagementClusterGroupKeyMapAttributeCallback + implements ChipClusters.GroupKeyManagementCluster.GroupKeyMapAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess( + List valueList) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo commandResponseInfo = new CommandResponseInfo( - "valueList", "List"); + "valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); @@ -1770,8 +1823,8 @@ public void onError(Exception ex) { } } - public static class DelegatedGroupKeyManagementClusterGroupKeysAttributeCallback - implements ChipClusters.GroupKeyManagementCluster.GroupKeysAttributeCallback, + public static class DelegatedGroupKeyManagementClusterGroupTableAttributeCallback + implements ChipClusters.GroupKeyManagementCluster.GroupTableAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -1782,11 +1835,11 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { @Override public void onSuccess( - List valueList) { + List valueList) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo commandResponseInfo = new CommandResponseInfo( - "valueList", "List"); + "valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); @@ -6891,6 +6944,129 @@ public Map> getCommandMap() { commandMap.put("generalDiagnostics", generalDiagnosticsClusterInteractionInfoMap); Map groupKeyManagementClusterInteractionInfoMap = new LinkedHashMap<>(); + Map groupKeyManagementkeySetReadCommandParams = + new LinkedHashMap(); + CommandParameterInfo groupKeyManagementkeySetReadgroupKeySetIDCommandParameterInfo = + new CommandParameterInfo("groupKeySetID", int.class); + groupKeyManagementkeySetReadCommandParams.put( + "groupKeySetID", groupKeyManagementkeySetReadgroupKeySetIDCommandParameterInfo); + + // Populate commands + InteractionInfo groupKeyManagementkeySetReadInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.GroupKeyManagementCluster) cluster) + .keySetRead( + (ChipClusters.GroupKeyManagementCluster.KeySetReadResponseCallback) callback, + (Integer) commandArguments.get("groupKeySetID")); + }, + () -> new DelegatedKeySetReadResponseCallback(), + groupKeyManagementkeySetReadCommandParams); + groupKeyManagementClusterInteractionInfoMap.put( + "keySetRead", groupKeyManagementkeySetReadInteractionInfo); + Map groupKeyManagementkeySetReadAllIndicesCommandParams = + new LinkedHashMap(); + CommandParameterInfo groupKeyManagementkeySetReadAllIndicesgroupKeySetIDsCommandParameterInfo = + new CommandParameterInfo("groupKeySetIDs", int.class); + groupKeyManagementkeySetReadAllIndicesCommandParams.put( + "groupKeySetIDs", groupKeyManagementkeySetReadAllIndicesgroupKeySetIDsCommandParameterInfo); + + // Populate commands + InteractionInfo groupKeyManagementkeySetReadAllIndicesInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.GroupKeyManagementCluster) cluster) + .keySetReadAllIndices( + (ChipClusters.GroupKeyManagementCluster.KeySetReadAllIndicesResponseCallback) + callback, + (Integer) commandArguments.get("groupKeySetIDs")); + }, + () -> new DelegatedKeySetReadAllIndicesResponseCallback(), + groupKeyManagementkeySetReadAllIndicesCommandParams); + groupKeyManagementClusterInteractionInfoMap.put( + "keySetReadAllIndices", groupKeyManagementkeySetReadAllIndicesInteractionInfo); + Map groupKeyManagementkeySetRemoveCommandParams = + new LinkedHashMap(); + CommandParameterInfo groupKeyManagementkeySetRemovegroupKeySetIDCommandParameterInfo = + new CommandParameterInfo("groupKeySetID", int.class); + groupKeyManagementkeySetRemoveCommandParams.put( + "groupKeySetID", groupKeyManagementkeySetRemovegroupKeySetIDCommandParameterInfo); + + // Populate commands + InteractionInfo groupKeyManagementkeySetRemoveInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.GroupKeyManagementCluster) cluster) + .keySetRemove( + (DefaultClusterCallback) callback, + (Integer) commandArguments.get("groupKeySetID")); + }, + () -> new DelegatedDefaultClusterCallback(), + groupKeyManagementkeySetRemoveCommandParams); + groupKeyManagementClusterInteractionInfoMap.put( + "keySetRemove", groupKeyManagementkeySetRemoveInteractionInfo); + Map groupKeyManagementkeySetWriteCommandParams = + new LinkedHashMap(); + CommandParameterInfo groupKeyManagementkeySetWritegroupKeySetIDCommandParameterInfo = + new CommandParameterInfo("groupKeySetID", int.class); + groupKeyManagementkeySetWriteCommandParams.put( + "groupKeySetID", groupKeyManagementkeySetWritegroupKeySetIDCommandParameterInfo); + + CommandParameterInfo groupKeyManagementkeySetWritesecurityPolicyCommandParameterInfo = + new CommandParameterInfo("securityPolicy", int.class); + groupKeyManagementkeySetWriteCommandParams.put( + "securityPolicy", groupKeyManagementkeySetWritesecurityPolicyCommandParameterInfo); + + CommandParameterInfo groupKeyManagementkeySetWriteepochKey0CommandParameterInfo = + new CommandParameterInfo("epochKey0", byte[].class); + groupKeyManagementkeySetWriteCommandParams.put( + "epochKey0", groupKeyManagementkeySetWriteepochKey0CommandParameterInfo); + + CommandParameterInfo groupKeyManagementkeySetWriteepochStartTime0CommandParameterInfo = + new CommandParameterInfo("epochStartTime0", long.class); + groupKeyManagementkeySetWriteCommandParams.put( + "epochStartTime0", groupKeyManagementkeySetWriteepochStartTime0CommandParameterInfo); + + CommandParameterInfo groupKeyManagementkeySetWriteepochKey1CommandParameterInfo = + new CommandParameterInfo("epochKey1", byte[].class); + groupKeyManagementkeySetWriteCommandParams.put( + "epochKey1", groupKeyManagementkeySetWriteepochKey1CommandParameterInfo); + + CommandParameterInfo groupKeyManagementkeySetWriteepochStartTime1CommandParameterInfo = + new CommandParameterInfo("epochStartTime1", long.class); + groupKeyManagementkeySetWriteCommandParams.put( + "epochStartTime1", groupKeyManagementkeySetWriteepochStartTime1CommandParameterInfo); + + CommandParameterInfo groupKeyManagementkeySetWriteepochKey2CommandParameterInfo = + new CommandParameterInfo("epochKey2", byte[].class); + groupKeyManagementkeySetWriteCommandParams.put( + "epochKey2", groupKeyManagementkeySetWriteepochKey2CommandParameterInfo); + + CommandParameterInfo groupKeyManagementkeySetWriteepochStartTime2CommandParameterInfo = + new CommandParameterInfo("epochStartTime2", long.class); + groupKeyManagementkeySetWriteCommandParams.put( + "epochStartTime2", groupKeyManagementkeySetWriteepochStartTime2CommandParameterInfo); + + // Populate commands + InteractionInfo groupKeyManagementkeySetWriteInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.GroupKeyManagementCluster) cluster) + .keySetWrite( + (DefaultClusterCallback) callback, + (Integer) commandArguments.get("groupKeySetID"), + (Integer) commandArguments.get("securityPolicy"), + (byte[]) commandArguments.get("epochKey0"), + (Long) commandArguments.get("epochStartTime0"), + (byte[]) commandArguments.get("epochKey1"), + (Long) commandArguments.get("epochStartTime1"), + (byte[]) commandArguments.get("epochKey2"), + (Long) commandArguments.get("epochStartTime2")); + }, + () -> new DelegatedDefaultClusterCallback(), + groupKeyManagementkeySetWriteCommandParams); + groupKeyManagementClusterInteractionInfoMap.put( + "keySetWrite", groupKeyManagementkeySetWriteInteractionInfo); commandMap.put("groupKeyManagement", groupKeyManagementClusterInteractionInfoMap); Map groupsClusterInteractionInfoMap = new LinkedHashMap<>(); Map groupsaddGroupCommandParams = diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java index 680572f1f415a0..b88892a190f0a1 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java @@ -2798,35 +2798,66 @@ public Map> getReadAttributeMap() { readGeneralDiagnosticsClusterRevisionAttributeInteractionInfo); readAttributeMap.put("generalDiagnostics", readGeneralDiagnosticsInteractionInfo); Map readGroupKeyManagementInteractionInfo = new LinkedHashMap<>(); - Map readGroupKeyManagementGroupsCommandParams = + Map readGroupKeyManagementGroupKeyMapCommandParams = new LinkedHashMap(); - InteractionInfo readGroupKeyManagementGroupsAttributeInteractionInfo = + InteractionInfo readGroupKeyManagementGroupKeyMapAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.GroupKeyManagementCluster) cluster) - .readGroupsAttribute( - (ChipClusters.GroupKeyManagementCluster.GroupsAttributeCallback) callback); + .readGroupKeyMapAttribute( + (ChipClusters.GroupKeyManagementCluster.GroupKeyMapAttributeCallback) + callback); }, () -> - new ClusterInfoMapping.DelegatedGroupKeyManagementClusterGroupsAttributeCallback(), - readGroupKeyManagementGroupsCommandParams); + new ClusterInfoMapping + .DelegatedGroupKeyManagementClusterGroupKeyMapAttributeCallback(), + readGroupKeyManagementGroupKeyMapCommandParams); readGroupKeyManagementInteractionInfo.put( - "readGroupsAttribute", readGroupKeyManagementGroupsAttributeInteractionInfo); - Map readGroupKeyManagementGroupKeysCommandParams = + "readGroupKeyMapAttribute", readGroupKeyManagementGroupKeyMapAttributeInteractionInfo); + Map readGroupKeyManagementGroupTableCommandParams = new LinkedHashMap(); - InteractionInfo readGroupKeyManagementGroupKeysAttributeInteractionInfo = + InteractionInfo readGroupKeyManagementGroupTableAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.GroupKeyManagementCluster) cluster) - .readGroupKeysAttribute( - (ChipClusters.GroupKeyManagementCluster.GroupKeysAttributeCallback) callback); + .readGroupTableAttribute( + (ChipClusters.GroupKeyManagementCluster.GroupTableAttributeCallback) + callback); }, () -> new ClusterInfoMapping - .DelegatedGroupKeyManagementClusterGroupKeysAttributeCallback(), - readGroupKeyManagementGroupKeysCommandParams); + .DelegatedGroupKeyManagementClusterGroupTableAttributeCallback(), + readGroupKeyManagementGroupTableCommandParams); + readGroupKeyManagementInteractionInfo.put( + "readGroupTableAttribute", readGroupKeyManagementGroupTableAttributeInteractionInfo); + Map readGroupKeyManagementMaxGroupsPerFabricCommandParams = + new LinkedHashMap(); + InteractionInfo readGroupKeyManagementMaxGroupsPerFabricAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.GroupKeyManagementCluster) cluster) + .readMaxGroupsPerFabricAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readGroupKeyManagementMaxGroupsPerFabricCommandParams); + readGroupKeyManagementInteractionInfo.put( + "readMaxGroupsPerFabricAttribute", + readGroupKeyManagementMaxGroupsPerFabricAttributeInteractionInfo); + Map readGroupKeyManagementMaxGroupKeysPerFabricCommandParams = + new LinkedHashMap(); + InteractionInfo readGroupKeyManagementMaxGroupKeysPerFabricAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.GroupKeyManagementCluster) cluster) + .readMaxGroupKeysPerFabricAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readGroupKeyManagementMaxGroupKeysPerFabricCommandParams); readGroupKeyManagementInteractionInfo.put( - "readGroupKeysAttribute", readGroupKeyManagementGroupKeysAttributeInteractionInfo); + "readMaxGroupKeysPerFabricAttribute", + readGroupKeyManagementMaxGroupKeysPerFabricAttributeInteractionInfo); Map readGroupKeyManagementAttributeListCommandParams = new LinkedHashMap(); InteractionInfo readGroupKeyManagementAttributeListAttributeInteractionInfo = diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 6dbe1a3c83f020..b1bbe59f5c58a1 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -2060,20 +2060,65 @@ class ChipClusters: "clusterName": "GroupKeyManagement", "clusterId": 0x0000003F, "commands": { + 0x00000001: { + "commandId": 0x00000001, + "commandName": "KeySetRead", + "args": { + "groupKeySetID": "int", + }, + }, + 0x00000004: { + "commandId": 0x00000004, + "commandName": "KeySetReadAllIndices", + "args": { + "groupKeySetIDs": "int", + }, + }, + 0x00000003: { + "commandId": 0x00000003, + "commandName": "KeySetRemove", + "args": { + "groupKeySetID": "int", + }, + }, + 0x00000000: { + "commandId": 0x00000000, + "commandName": "KeySetWrite", + "args": { + "groupKeySetID": "int", + "securityPolicy": "int", + "epochKey0": "bytes", + "epochStartTime0": "int", + "epochKey1": "bytes", + "epochStartTime1": "int", + "epochKey2": "bytes", + "epochStartTime2": "int", + }, + }, }, "attributes": { 0x00000000: { - "attributeName": "Groups", + "attributeName": "GroupKeyMap", "attributeId": 0x00000000, "type": "", "reportable": True, }, 0x00000001: { - "attributeName": "GroupKeys", + "attributeName": "GroupTable", "attributeId": 0x00000001, "type": "", "reportable": True, }, + 0x00000002: { + "attributeName": "MaxGroupsPerFabric", + "attributeId": 0x00000002, + "type": "int", + }, + 0x00000003: { + "attributeName": "MaxGroupKeysPerFabric", + "attributeId": 0x00000003, + "type": "int", + }, 0x0000FFFB: { "attributeName": "AttributeList", "attributeId": 0x0000FFFB, diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index e8adf036c8966f..9084dedbe98c6e 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -12683,15 +12683,19 @@ class GroupKeyManagement(Cluster): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="groups", Tag=0x00000000, Type=typing.List[GroupKeyManagement.Structs.GroupState]), - ClusterObjectFieldDescriptor(Label="groupKeys", Tag=0x00000001, Type=typing.List[GroupKeyManagement.Structs.GroupKey]), + ClusterObjectFieldDescriptor(Label="groupKeyMap", Tag=0x00000000, Type=typing.List[GroupKeyManagement.Structs.GroupKey]), + ClusterObjectFieldDescriptor(Label="groupTable", Tag=0x00000001, Type=typing.List[GroupKeyManagement.Structs.GroupInfo]), + ClusterObjectFieldDescriptor(Label="maxGroupsPerFabric", Tag=0x00000002, Type=uint), + ClusterObjectFieldDescriptor(Label="maxGroupKeysPerFabric", Tag=0x00000003, Type=uint), ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), ]) - groups: 'typing.List[GroupKeyManagement.Structs.GroupState]' = None - groupKeys: 'typing.List[GroupKeyManagement.Structs.GroupKey]' = None + groupKeyMap: 'typing.List[GroupKeyManagement.Structs.GroupKey]' = None + groupTable: 'typing.List[GroupKeyManagement.Structs.GroupInfo]' = None + maxGroupsPerFabric: 'uint' = None + maxGroupKeysPerFabric: 'uint' = None attributeList: 'typing.List[uint]' = None featureMap: 'typing.Optional[uint]' = None clusterRevision: 'uint' = None @@ -12703,46 +12707,160 @@ class GroupKeySecurityPolicy(IntEnum): class Structs: + @dataclass + class GroupInfo(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields = [ + ClusterObjectFieldDescriptor(Label="fabricIndex", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="groupId", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="endpoints", Tag=2, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="groupName", Tag=3, Type=str), + ]) + + fabricIndex: 'uint' = 0 + groupId: 'uint' = 0 + endpoints: 'typing.List[uint]' = field(default_factory=lambda: []) + groupName: 'str' = "" + @dataclass class GroupKey(ClusterObject): @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="vendorId", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="groupKeyIndex", Tag=2, Type=uint), - ClusterObjectFieldDescriptor(Label="groupKeyRoot", Tag=3, Type=bytes), - ClusterObjectFieldDescriptor(Label="groupKeyEpochStartTime", Tag=4, Type=uint), - ClusterObjectFieldDescriptor(Label="groupKeySecurityPolicy", Tag=5, Type=GroupKeyManagement.Enums.GroupKeySecurityPolicy), + ClusterObjectFieldDescriptor(Label="fabricIndex", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="groupId", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="groupKeySetID", Tag=2, Type=uint), ]) - vendorId: 'uint' = 0 - groupKeyIndex: 'uint' = 0 - groupKeyRoot: 'bytes' = b"" - groupKeyEpochStartTime: 'uint' = 0 - groupKeySecurityPolicy: 'GroupKeyManagement.Enums.GroupKeySecurityPolicy' = 0 + fabricIndex: 'uint' = 0 + groupId: 'uint' = 0 + groupKeySetID: 'uint' = 0 @dataclass - class GroupState(ClusterObject): + class GroupKeySet(ClusterObject): @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="vendorId", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="vendorGroupId", Tag=2, Type=uint), - ClusterObjectFieldDescriptor(Label="groupKeySetIndex", Tag=3, Type=uint), + ClusterObjectFieldDescriptor(Label="groupKeySetID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="securityPolicy", Tag=1, Type=GroupKeyManagement.Enums.GroupKeySecurityPolicy), + ClusterObjectFieldDescriptor(Label="epochKey0", Tag=2, Type=bytes), + ClusterObjectFieldDescriptor(Label="epochStartTime0", Tag=3, Type=uint), + ClusterObjectFieldDescriptor(Label="epochKey1", Tag=4, Type=bytes), + ClusterObjectFieldDescriptor(Label="epochStartTime1", Tag=5, Type=uint), + ClusterObjectFieldDescriptor(Label="epochKey2", Tag=6, Type=bytes), + ClusterObjectFieldDescriptor(Label="epochStartTime2", Tag=7, Type=uint), ]) - vendorId: 'uint' = 0 - vendorGroupId: 'uint' = 0 - groupKeySetIndex: 'uint' = 0 + groupKeySetID: 'uint' = 0 + securityPolicy: 'GroupKeyManagement.Enums.GroupKeySecurityPolicy' = 0 + epochKey0: 'bytes' = b"" + epochStartTime0: 'uint' = 0 + epochKey1: 'bytes' = b"" + epochStartTime1: 'uint' = 0 + epochKey2: 'bytes' = b"" + epochStartTime2: 'uint' = 0 + + + + class Commands: + @dataclass + class KeySetWrite(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x003F + command_id: typing.ClassVar[int] = 0x0000 + is_client: typing.ClassVar[bool] = True + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields = [ + ClusterObjectFieldDescriptor(Label="groupKeySet", Tag=0, Type=GroupKeyManagement.Structs.GroupKeySet), + ]) + groupKeySet: 'GroupKeyManagement.Structs.GroupKeySet' = field(default_factory=lambda: GroupKeyManagement.Structs.GroupKeySet()) + + @dataclass + class KeySetRead(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x003F + command_id: typing.ClassVar[int] = 0x0001 + is_client: typing.ClassVar[bool] = True + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields = [ + ClusterObjectFieldDescriptor(Label="groupKeySetID", Tag=0, Type=uint), + ]) + + groupKeySetID: 'uint' = 0 + + @dataclass + class KeySetReadResponse(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x003F + command_id: typing.ClassVar[int] = 0x0002 + is_client: typing.ClassVar[bool] = False + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields = [ + ClusterObjectFieldDescriptor(Label="groupKeySet", Tag=0, Type=GroupKeyManagement.Structs.GroupKeySet), + ]) + + groupKeySet: 'GroupKeyManagement.Structs.GroupKeySet' = field(default_factory=lambda: GroupKeyManagement.Structs.GroupKeySet()) + + @dataclass + class KeySetRemove(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x003F + command_id: typing.ClassVar[int] = 0x0003 + is_client: typing.ClassVar[bool] = True + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields = [ + ClusterObjectFieldDescriptor(Label="groupKeySetID", Tag=0, Type=uint), + ]) + + groupKeySetID: 'uint' = 0 + + @dataclass + class KeySetReadAllIndices(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x003F + command_id: typing.ClassVar[int] = 0x0004 + is_client: typing.ClassVar[bool] = True + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields = [ + ClusterObjectFieldDescriptor(Label="groupKeySetIDs", Tag=0, Type=typing.List[uint]), + ]) + + groupKeySetIDs: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class KeySetReadAllIndicesResponse(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x003F + command_id: typing.ClassVar[int] = 0x0005 + is_client: typing.ClassVar[bool] = False + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields = [ + ClusterObjectFieldDescriptor(Label="groupKeySetIDs", Tag=0, Type=typing.List[uint]), + ]) + + groupKeySetIDs: 'typing.List[uint]' = field(default_factory=lambda: []) class Attributes: @dataclass - class Groups(ClusterAttributeDescriptor): + class GroupKeyMap(ClusterAttributeDescriptor): @ChipUtility.classproperty def cluster_id(cls) -> int: return 0x003F @@ -12753,12 +12871,12 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[GroupKeyManagement.Structs.GroupState]) + return ClusterObjectFieldDescriptor(Type=typing.List[GroupKeyManagement.Structs.GroupKey]) - value: 'typing.List[GroupKeyManagement.Structs.GroupState]' = field(default_factory=lambda: []) + value: 'typing.List[GroupKeyManagement.Structs.GroupKey]' = field(default_factory=lambda: []) @dataclass - class GroupKeys(ClusterAttributeDescriptor): + class GroupTable(ClusterAttributeDescriptor): @ChipUtility.classproperty def cluster_id(cls) -> int: return 0x003F @@ -12769,9 +12887,41 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[GroupKeyManagement.Structs.GroupKey]) + return ClusterObjectFieldDescriptor(Type=typing.List[GroupKeyManagement.Structs.GroupInfo]) - value: 'typing.List[GroupKeyManagement.Structs.GroupKey]' = field(default_factory=lambda: []) + value: 'typing.List[GroupKeyManagement.Structs.GroupInfo]' = field(default_factory=lambda: []) + + @dataclass + class MaxGroupsPerFabric(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x003F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000002 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass + class MaxGroupKeysPerFabric(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x003F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000003 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 @dataclass class AttributeList(ClusterAttributeDescriptor): diff --git a/src/credentials/GroupDataProvider.h b/src/credentials/GroupDataProvider.h index d3fbc57cf03576..eccc7d50d2271b 100644 --- a/src/credentials/GroupDataProvider.h +++ b/src/credentials/GroupDataProvider.h @@ -30,9 +30,6 @@ namespace Credentials { class GroupDataProvider { public: - static constexpr uint16_t kMaxGroupsPerFabric = CHIP_CONFIG_MAX_GROUPS_PER_FABRIC; - static constexpr uint16_t kMaxGroupKeysPerFabric = CHIP_CONFIG_MAX_GROUP_KEYS_PER_FABRIC; - struct GroupInfo { static constexpr size_t kGroupNameMax = CHIP_CONFIG_MAX_GROUP_NAME_LENGTH; @@ -195,13 +192,21 @@ class GroupDataProvider using EndpointIterator = Iterator; using KeySetIterator = Iterator; - GroupDataProvider() = default; + GroupDataProvider(uint16_t maxGroupsPerFabric = CHIP_CONFIG_MAX_GROUPS_PER_FABRIC, + uint16_t maxGroupKeysPerFabric = CHIP_CONFIG_MAX_GROUP_KEYS_PER_FABRIC) : + mMaxGroupsPerFabric(maxGroupsPerFabric), + mMaxGroupKeysPerFabric(maxGroupKeysPerFabric) + {} + virtual ~GroupDataProvider() = default; // Not copyable GroupDataProvider(const GroupDataProvider &) = delete; GroupDataProvider & operator=(const GroupDataProvider &) = delete; + uint16_t GetMaxGroupsPerFabric() { return mMaxGroupsPerFabric; } + uint16_t GetMaxGroupKeysPerFabric() { return mMaxGroupKeysPerFabric; } + /** * Initialize the GroupDataProvider, including any persistent data store * initialization. Must be called once before any other API succeeds. @@ -254,6 +259,7 @@ class GroupDataProvider virtual CHIP_ERROR SetGroupKeyAt(chip::FabricIndex fabric_index, size_t index, const GroupKey & info) = 0; virtual CHIP_ERROR GetGroupKeyAt(chip::FabricIndex fabric_index, size_t index, GroupKey & info) = 0; virtual CHIP_ERROR RemoveGroupKeyAt(chip::FabricIndex fabric_index, size_t index) = 0; + virtual CHIP_ERROR RemoveGroupKeys(chip::FabricIndex fabric_index) = 0; /** * Creates an iterator that may be used to obtain the list of (group, keyset) pairs associated with the given fabric. @@ -298,6 +304,8 @@ class GroupDataProvider mListener->OnGroupAdded(fabric_index, new_group); } } + const uint16_t mMaxGroupsPerFabric; + const uint16_t mMaxGroupKeysPerFabric; GroupListener * mListener = nullptr; }; diff --git a/src/credentials/GroupDataProviderImpl.cpp b/src/credentials/GroupDataProviderImpl.cpp index 8873a27c870621..f5914c340fb727 100644 --- a/src/credentials/GroupDataProviderImpl.cpp +++ b/src/credentials/GroupDataProviderImpl.cpp @@ -669,8 +669,6 @@ struct KeySetData : public GroupDataProvider::KeySet, PersistentDataGetGroupKeyAt(kFabric2, 0, pair)); NL_TEST_ASSERT(apSuite, pair == kGroup3Keyset1); + + // Remove all + + NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->RemoveGroupKeys(kFabric1)); + + NL_TEST_ASSERT(apSuite, CHIP_ERROR_NOT_FOUND == provider->GetGroupKeyAt(kFabric1, 3, pair)); + NL_TEST_ASSERT(apSuite, CHIP_ERROR_NOT_FOUND == provider->GetGroupKeyAt(kFabric1, 2, pair)); + NL_TEST_ASSERT(apSuite, CHIP_ERROR_NOT_FOUND == provider->GetGroupKeyAt(kFabric1, 1, pair)); + NL_TEST_ASSERT(apSuite, CHIP_ERROR_NOT_FOUND == provider->GetGroupKeyAt(kFabric1, 0, pair)); + + NL_TEST_ASSERT(apSuite, CHIP_ERROR_NOT_FOUND == provider->GetGroupKeyAt(kFabric2, 3, pair)); + NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->GetGroupKeyAt(kFabric2, 2, pair)); + NL_TEST_ASSERT(apSuite, pair == kGroup2Keyset3); + NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->GetGroupKeyAt(kFabric2, 1, pair)); + NL_TEST_ASSERT(apSuite, pair == kGroup2Keyset2); + NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->GetGroupKeyAt(kFabric2, 0, pair)); + NL_TEST_ASSERT(apSuite, pair == kGroup3Keyset1); } void TestGroupKeyIterator(nlTestSuite * apSuite, void * apContext) @@ -978,7 +998,8 @@ void TestPerFabricData(nlTestSuite * apSuite, void * apContext) namespace { static chip::TestPersistentStorageDelegate sDelegate; -static GroupDataProviderImpl sProvider(sDelegate); +static GroupDataProviderImpl sProvider(sDelegate, chip::app::TestGroups::kMaxGroupsPerFabric, + chip::app::TestGroups::kMaxGroupKeysPerFabric); static EpochKey kEpochKeys0[] = { { 0x1111111111111111, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }, diff --git a/src/darwin/Framework/CHIP/templates/tests.js b/src/darwin/Framework/CHIP/templates/tests.js index 703f9f183bc5e8..0f317e229a7d4d 100644 --- a/src/darwin/Framework/CHIP/templates/tests.js +++ b/src/darwin/Framework/CHIP/templates/tests.js @@ -177,6 +177,7 @@ function getTests() 'TestDescriptorCluster', 'TestBasicInformation', 'TestGroupsCluster', + 'TestGroupKeyManagementCluster', 'TestIdentifyCluster', 'TestLogCommands', 'TestOperationalCredentialsCluster', diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm index 7afd479471ae14..3c4b84ec5f5d05 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm @@ -3325,8 +3325,8 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader case Clusters::GroupKeyManagement::Id: { using namespace Clusters::GroupKeyManagement; switch (aPath.mAttributeId) { - case Attributes::Groups::Id: { - using TypeInfo = Attributes::Groups::TypeInfo; + case Attributes::GroupKeyMap::Id: { + using TypeInfo = Attributes::GroupKeyMap::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -3337,11 +3337,11 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - CHIPGroupKeyManagementClusterGroupState * newElement_0; - newElement_0 = [CHIPGroupKeyManagementClusterGroupState new]; - newElement_0.vendorId = [NSNumber numberWithUnsignedShort:entry_0.vendorId]; - newElement_0.vendorGroupId = [NSNumber numberWithUnsignedShort:entry_0.vendorGroupId]; - newElement_0.groupKeySetIndex = [NSNumber numberWithUnsignedShort:entry_0.groupKeySetIndex]; + CHIPGroupKeyManagementClusterGroupKey * newElement_0; + newElement_0 = [CHIPGroupKeyManagementClusterGroupKey new]; + newElement_0.fabricIndex = [NSNumber numberWithUnsignedShort:entry_0.fabricIndex]; + newElement_0.groupId = [NSNumber numberWithUnsignedShort:entry_0.groupId]; + newElement_0.groupKeySetID = [NSNumber numberWithUnsignedShort:entry_0.groupKeySetID]; [array_0 addObject:newElement_0]; } { // Scope for the error so we will know what it's named @@ -3354,8 +3354,8 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader value = array_0; return value; } - case Attributes::GroupKeys::Id: { - using TypeInfo = Attributes::GroupKeys::TypeInfo; + case Attributes::GroupTable::Id: { + using TypeInfo = Attributes::GroupTable::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -3366,14 +3366,29 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - CHIPGroupKeyManagementClusterGroupKey * newElement_0; - newElement_0 = [CHIPGroupKeyManagementClusterGroupKey new]; - newElement_0.vendorId = [NSNumber numberWithUnsignedShort:entry_0.vendorId]; - newElement_0.groupKeyIndex = [NSNumber numberWithUnsignedShort:entry_0.groupKeyIndex]; - newElement_0.groupKeyRoot = [NSData dataWithBytes:entry_0.groupKeyRoot.data() length:entry_0.groupKeyRoot.size()]; - newElement_0.groupKeyEpochStartTime = [NSNumber numberWithUnsignedLongLong:entry_0.groupKeyEpochStartTime]; - newElement_0.groupKeySecurityPolicy = - [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.groupKeySecurityPolicy)]; + CHIPGroupKeyManagementClusterGroupInfo * newElement_0; + newElement_0 = [CHIPGroupKeyManagementClusterGroupInfo new]; + newElement_0.fabricIndex = [NSNumber numberWithUnsignedShort:entry_0.fabricIndex]; + newElement_0.groupId = [NSNumber numberWithUnsignedShort:entry_0.groupId]; + auto * array_2 = [NSMutableArray new]; + auto iter_2 = entry_0.endpoints.begin(); + while (iter_2.Next()) { + auto & entry_2 = iter_2.GetValue(); + NSNumber * newElement_2; + newElement_2 = [NSNumber numberWithUnsignedShort:entry_2]; + [array_2 addObject:newElement_2]; + } + { // Scope for the error so we will know what it's named + CHIP_ERROR err = iter_2.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + } + newElement_0.endpoints = array_2; + newElement_0.groupName = [[NSString alloc] initWithBytes:entry_0.groupName.data() + length:entry_0.groupName.size() + encoding:NSUTF8StringEncoding]; [array_0 addObject:newElement_0]; } { // Scope for the error so we will know what it's named @@ -3386,6 +3401,28 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader value = array_0; return value; } + case Attributes::MaxGroupsPerFabric::Id: { + using TypeInfo = Attributes::MaxGroupsPerFabric::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + case Attributes::MaxGroupKeysPerFabric::Id: { + using TypeInfo = Attributes::MaxGroupKeysPerFabric::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } case Attributes::AttributeList::Id: { using TypeInfo = Attributes::AttributeList::TypeInfo; TypeInfo::DecodableType cppValue; diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm index a86ae6d3234e16..c1203946f986ea 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm @@ -2544,19 +2544,19 @@ } } -void CHIPGroupKeyManagementGroupsListAttributeCallbackBridge::OnSuccessFn(void * context, - const chip::app::DataModel::DecodableList & value) +void CHIPGroupKeyManagementGroupKeyMapListAttributeCallbackBridge::OnSuccessFn(void * context, + const chip::app::DataModel::DecodableList & value) { NSArray * _Nonnull objCValue; auto * array_0 = [NSMutableArray new]; auto iter_0 = value.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - CHIPGroupKeyManagementClusterGroupState * newElement_0; - newElement_0 = [CHIPGroupKeyManagementClusterGroupState new]; - newElement_0.vendorId = [NSNumber numberWithUnsignedShort:entry_0.vendorId]; - newElement_0.vendorGroupId = [NSNumber numberWithUnsignedShort:entry_0.vendorGroupId]; - newElement_0.groupKeySetIndex = [NSNumber numberWithUnsignedShort:entry_0.groupKeySetIndex]; + CHIPGroupKeyManagementClusterGroupKey * newElement_0; + newElement_0 = [CHIPGroupKeyManagementClusterGroupKey new]; + newElement_0.fabricIndex = [NSNumber numberWithUnsignedShort:entry_0.fabricIndex]; + newElement_0.groupId = [NSNumber numberWithUnsignedShort:entry_0.groupId]; + newElement_0.groupKeySetID = [NSNumber numberWithUnsignedShort:entry_0.groupKeySetID]; [array_0 addObject:newElement_0]; } { // Scope for the error so we will know what it's named @@ -2570,9 +2570,9 @@ DispatchSuccess(context, objCValue); }; -void CHIPGroupKeyManagementGroupsListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +void CHIPGroupKeyManagementGroupKeyMapListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -2586,21 +2586,37 @@ } } -void CHIPGroupKeyManagementGroupKeysListAttributeCallbackBridge::OnSuccessFn(void * context, - const chip::app::DataModel::DecodableList & value) +void CHIPGroupKeyManagementGroupTableListAttributeCallbackBridge::OnSuccessFn(void * context, + const chip::app::DataModel::DecodableList & value) { NSArray * _Nonnull objCValue; auto * array_0 = [NSMutableArray new]; auto iter_0 = value.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - CHIPGroupKeyManagementClusterGroupKey * newElement_0; - newElement_0 = [CHIPGroupKeyManagementClusterGroupKey new]; - newElement_0.vendorId = [NSNumber numberWithUnsignedShort:entry_0.vendorId]; - newElement_0.groupKeyIndex = [NSNumber numberWithUnsignedShort:entry_0.groupKeyIndex]; - newElement_0.groupKeyRoot = [NSData dataWithBytes:entry_0.groupKeyRoot.data() length:entry_0.groupKeyRoot.size()]; - newElement_0.groupKeyEpochStartTime = [NSNumber numberWithUnsignedLongLong:entry_0.groupKeyEpochStartTime]; - newElement_0.groupKeySecurityPolicy = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.groupKeySecurityPolicy)]; + CHIPGroupKeyManagementClusterGroupInfo * newElement_0; + newElement_0 = [CHIPGroupKeyManagementClusterGroupInfo new]; + newElement_0.fabricIndex = [NSNumber numberWithUnsignedShort:entry_0.fabricIndex]; + newElement_0.groupId = [NSNumber numberWithUnsignedShort:entry_0.groupId]; + auto * array_2 = [NSMutableArray new]; + auto iter_2 = entry_0.endpoints.begin(); + while (iter_2.Next()) { + auto & entry_2 = iter_2.GetValue(); + NSNumber * newElement_2; + newElement_2 = [NSNumber numberWithUnsignedShort:entry_2]; + [array_2 addObject:newElement_2]; + } + { // Scope for the error so we will know what it's named + CHIP_ERROR err = iter_2.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, EMBER_ZCL_STATUS_INVALID_VALUE); + return; + } + } + newElement_0.endpoints = array_2; + newElement_0.groupName = [[NSString alloc] initWithBytes:entry_0.groupName.data() + length:entry_0.groupName.size() + encoding:NSUTF8StringEncoding]; [array_0 addObject:newElement_0]; } { // Scope for the error so we will know what it's named @@ -2614,9 +2630,9 @@ DispatchSuccess(context, objCValue); }; -void CHIPGroupKeyManagementGroupKeysListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +void CHIPGroupKeyManagementGroupTableListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -5269,6 +5285,53 @@ DispatchSuccess(context, response); }; +void CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallbackBridge::OnSuccessFn( + void * context, const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndicesResponse::DecodableType & data) +{ + auto * response = [CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseParams new]; + { + auto * array_0 = [NSMutableArray new]; + auto iter_0 = data.groupKeySetIDs.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedShort:entry_0]; + [array_0 addObject:newElement_0]; + } + { // Scope for the error so we will know what it's named + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, EMBER_ZCL_STATUS_INVALID_VALUE); + return; + } + } + response.groupKeySetIDs = array_0; + } + DispatchSuccess(context, response); +}; + +void CHIPGroupKeyManagementClusterKeySetReadResponseCallbackBridge::OnSuccessFn( + void * context, const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadResponse::DecodableType & data) +{ + auto * response = [CHIPGroupKeyManagementClusterKeySetReadResponseParams new]; + { + response.groupKeySet = [CHIPGroupKeyManagementClusterGroupKeySet new]; + response.groupKeySet.groupKeySetID = [NSNumber numberWithUnsignedShort:data.groupKeySet.groupKeySetID]; + response.groupKeySet.securityPolicy = + [NSNumber numberWithUnsignedChar:chip::to_underlying(data.groupKeySet.securityPolicy)]; + response.groupKeySet.epochKey0 = [NSData dataWithBytes:data.groupKeySet.epochKey0.data() + length:data.groupKeySet.epochKey0.size()]; + response.groupKeySet.epochStartTime0 = [NSNumber numberWithUnsignedLongLong:data.groupKeySet.epochStartTime0]; + response.groupKeySet.epochKey1 = [NSData dataWithBytes:data.groupKeySet.epochKey1.data() + length:data.groupKeySet.epochKey1.size()]; + response.groupKeySet.epochStartTime1 = [NSNumber numberWithUnsignedLongLong:data.groupKeySet.epochStartTime1]; + response.groupKeySet.epochKey2 = [NSData dataWithBytes:data.groupKeySet.epochKey2.data() + length:data.groupKeySet.epochKey2.size()]; + response.groupKeySet.epochStartTime2 = [NSNumber numberWithUnsignedLongLong:data.groupKeySet.epochStartTime2]; + } + DispatchSuccess(context, response); +}; + void CHIPGroupsClusterAddGroupResponseCallbackBridge::OnSuccessFn( void * context, const chip::app::Clusters::Groups::Commands::AddGroupResponse::DecodableType & data) { diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h index c056de01336ade..fcfd5825f302a2 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h @@ -59,6 +59,10 @@ typedef void (*CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallb void *, const chip::app::Clusters::GeneralCommissioning::Commands::CommissioningCompleteResponse::DecodableType &); typedef void (*CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallbackType)( void *, const chip::app::Clusters::GeneralCommissioning::Commands::SetRegulatoryConfigResponse::DecodableType &); +typedef void (*CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallbackType)( + void *, const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndicesResponse::DecodableType &); +typedef void (*CHIPGroupKeyManagementClusterKeySetReadResponseCallbackType)( + void *, const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadResponse::DecodableType &); typedef void (*CHIPGroupsClusterAddGroupResponseCallbackType)( void *, const chip::app::Clusters::Groups::Commands::AddGroupResponse::DecodableType &); typedef void (*CHIPGroupsClusterGetGroupMembershipResponseCallbackType)( @@ -2468,28 +2472,28 @@ class CHIPGeneralDiagnosticsAttributeListListAttributeCallbackSubscriptionBridge SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPGroupKeyManagementGroupsListAttributeCallbackBridge - : public CHIPCallbackBridge +class CHIPGroupKeyManagementGroupKeyMapListAttributeCallbackBridge + : public CHIPCallbackBridge { public: - CHIPGroupKeyManagementGroupsListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, - bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; + CHIPGroupKeyManagementGroupKeyMapListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; static void OnSuccessFn( void * context, - const chip::app::DataModel::DecodableList & + const chip::app::DataModel::DecodableList & value); }; -class CHIPGroupKeyManagementGroupsListAttributeCallbackSubscriptionBridge - : public CHIPGroupKeyManagementGroupsListAttributeCallbackBridge +class CHIPGroupKeyManagementGroupKeyMapListAttributeCallbackSubscriptionBridge + : public CHIPGroupKeyManagementGroupKeyMapListAttributeCallbackBridge { public: - CHIPGroupKeyManagementGroupsListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, - SubscriptionEstablishedHandler establishedHandler) : - CHIPGroupKeyManagementGroupsListAttributeCallbackBridge(queue, handler, action, true), + CHIPGroupKeyManagementGroupKeyMapListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPGroupKeyManagementGroupKeyMapListAttributeCallbackBridge(queue, handler, action, true), mEstablishedHandler(establishedHandler) {} @@ -2499,28 +2503,28 @@ class CHIPGroupKeyManagementGroupsListAttributeCallbackSubscriptionBridge SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPGroupKeyManagementGroupKeysListAttributeCallbackBridge - : public CHIPCallbackBridge +class CHIPGroupKeyManagementGroupTableListAttributeCallbackBridge + : public CHIPCallbackBridge { public: - CHIPGroupKeyManagementGroupKeysListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; + CHIPGroupKeyManagementGroupTableListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; static void OnSuccessFn( void * context, - const chip::app::DataModel::DecodableList & + const chip::app::DataModel::DecodableList & value); }; -class CHIPGroupKeyManagementGroupKeysListAttributeCallbackSubscriptionBridge - : public CHIPGroupKeyManagementGroupKeysListAttributeCallbackBridge +class CHIPGroupKeyManagementGroupTableListAttributeCallbackSubscriptionBridge + : public CHIPGroupKeyManagementGroupTableListAttributeCallbackBridge { public: - CHIPGroupKeyManagementGroupKeysListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, - SubscriptionEstablishedHandler establishedHandler) : - CHIPGroupKeyManagementGroupKeysListAttributeCallbackBridge(queue, handler, action, true), + CHIPGroupKeyManagementGroupTableListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPGroupKeyManagementGroupTableListAttributeCallbackBridge(queue, handler, action, true), mEstablishedHandler(establishedHandler) {} @@ -4234,6 +4238,33 @@ class CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallbackBridge const chip::app::Clusters::GeneralCommissioning::Commands::SetRegulatoryConfigResponse::DecodableType & data); }; +class CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallbackBridge + : public CHIPCallbackBridge +{ +public: + CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, + OnSuccessFn, keepAlive){}; + + static void + OnSuccessFn(void * context, + const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndicesResponse::DecodableType & data); +}; + +class CHIPGroupKeyManagementClusterKeySetReadResponseCallbackBridge + : public CHIPCallbackBridge +{ +public: + CHIPGroupKeyManagementClusterKeySetReadResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, + keepAlive){}; + + static void OnSuccessFn(void * context, + const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadResponse::DecodableType & data); +}; + class CHIPGroupsClusterAddGroupResponseCallbackBridge : public CHIPCallbackBridge { public: diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h index c225e7304ba992..7cea8a544e8ed1 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h @@ -1841,18 +1841,36 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPGroupKeyManagement : CHIPCluster -- (void)readAttributeGroupsWithCompletionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler; -- (void)subscribeAttributeGroupsWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler; +- (void)keySetReadWithParams:(CHIPGroupKeyManagementClusterKeySetReadParams *)params + completionHandler:(void (^)(CHIPGroupKeyManagementClusterKeySetReadResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)keySetReadAllIndicesWithParams:(CHIPGroupKeyManagementClusterKeySetReadAllIndicesParams *)params + completionHandler:(void (^)(CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)keySetRemoveWithParams:(CHIPGroupKeyManagementClusterKeySetRemoveParams *)params + completionHandler:(StatusCompletion)completionHandler; +- (void)keySetWriteWithParams:(CHIPGroupKeyManagementClusterKeySetWriteParams *)params + completionHandler:(StatusCompletion)completionHandler; -- (void)readAttributeGroupKeysWithCompletionHandler:(void (^)( - NSArray * _Nullable value, NSError * _Nullable error))completionHandler; -- (void)subscribeAttributeGroupKeysWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler; +- (void)readAttributeGroupKeyMapWithCompletionHandler:(void (^)( + NSArray * _Nullable value, NSError * _Nullable error))completionHandler; +- (void)subscribeAttributeGroupKeyMapWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler; + +- (void)readAttributeGroupTableWithCompletionHandler:(void (^)( + NSArray * _Nullable value, NSError * _Nullable error))completionHandler; +- (void)subscribeAttributeGroupTableWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler; + +- (void)readAttributeMaxGroupsPerFabricWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; + +- (void)readAttributeMaxGroupKeysPerFabricWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; - (void)readAttributeAttributeListWithCompletionHandler:(void (^)( NSArray * _Nullable value, NSError * _Nullable error))completionHandler; diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm index 472ebe3b851d1e..4662add387325b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm @@ -7713,65 +7713,188 @@ @implementation CHIPGroupKeyManagement return &_cppCluster; } -- (void)readAttributeGroupsWithCompletionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler +- (void)keySetReadWithParams:(CHIPGroupKeyManagementClusterKeySetReadParams *)params + completionHandler:(void (^)(CHIPGroupKeyManagementClusterKeySetReadResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler { - new CHIPGroupKeyManagementGroupsListAttributeCallbackBridge( + ListFreer listFreer; + GroupKeyManagement::Commands::KeySetRead::Type request; + request.groupKeySetID = params.groupKeySetID.unsignedShortValue; + + new CHIPGroupKeyManagementClusterKeySetReadResponseCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.InvokeCommand(request, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)keySetReadAllIndicesWithParams:(CHIPGroupKeyManagementClusterKeySetReadAllIndicesParams *)params + completionHandler:(void (^)(CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + ListFreer listFreer; + GroupKeyManagement::Commands::KeySetReadAllIndices::Type request; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (params.groupKeySetIDs.count != 0) { + auto * listHolder_0 = new ListHolder(params.groupKeySetIDs.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < params.groupKeySetIDs.count; ++i_0) { + if (![params.groupKeySetIDs[i_0] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return; + } + auto element_0 = (NSNumber *) params.groupKeySetIDs[i_0]; + listHolder_0->mList[i_0] = element_0.unsignedShortValue; + } + request.groupKeySetIDs = ListType_0(listHolder_0->mList, params.groupKeySetIDs.count); + } else { + request.groupKeySetIDs = ListType_0(); + } + } + + new CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallbackBridge( self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = GroupKeyManagement::Attributes::Groups::TypeInfo; - auto successFn = Callback::FromCancelable(success); + auto successFn + = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.InvokeCommand(request, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)keySetRemoveWithParams:(CHIPGroupKeyManagementClusterKeySetRemoveParams *)params + completionHandler:(StatusCompletion)completionHandler +{ + ListFreer listFreer; + GroupKeyManagement::Commands::KeySetRemove::Type request; + request.groupKeySetID = params.groupKeySetID.unsignedShortValue; + + new CHIPCommandSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.InvokeCommand(request, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)keySetWriteWithParams:(CHIPGroupKeyManagementClusterKeySetWriteParams *)params + completionHandler:(StatusCompletion)completionHandler +{ + ListFreer listFreer; + GroupKeyManagement::Commands::KeySetWrite::Type request; + request.groupKeySet.groupKeySetID = params.groupKeySet.groupKeySetID.unsignedShortValue; + request.groupKeySet.securityPolicy = static_cast>( + params.groupKeySet.securityPolicy.unsignedCharValue); + request.groupKeySet.epochKey0 = [self asByteSpan:params.groupKeySet.epochKey0]; + request.groupKeySet.epochStartTime0 = params.groupKeySet.epochStartTime0.unsignedLongLongValue; + request.groupKeySet.epochKey1 = [self asByteSpan:params.groupKeySet.epochKey1]; + request.groupKeySet.epochStartTime1 = params.groupKeySet.epochStartTime1.unsignedLongLongValue; + request.groupKeySet.epochKey2 = [self asByteSpan:params.groupKeySet.epochKey2]; + request.groupKeySet.epochStartTime2 = params.groupKeySet.epochStartTime2.unsignedLongLongValue; + + new CHIPCommandSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.InvokeCommand(request, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)readAttributeGroupKeyMapWithCompletionHandler:(void (^)( + NSArray * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPGroupKeyManagementGroupKeyMapListAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = GroupKeyManagement::Attributes::GroupKeyMap::TypeInfo; + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)subscribeAttributeGroupsWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +- (void)subscribeAttributeGroupKeyMapWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler { - new CHIPGroupKeyManagementGroupsListAttributeCallbackSubscriptionBridge( + new CHIPGroupKeyManagementGroupKeyMapListAttributeCallbackSubscriptionBridge( self.callbackQueue, reportHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = GroupKeyManagement::Attributes::Groups::TypeInfo; - auto successFn = Callback::FromCancelable(success); + using TypeInfo = GroupKeyManagement::Attributes::GroupKeyMap::TypeInfo; + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, minInterval, maxInterval, - CHIPGroupKeyManagementGroupsListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); + CHIPGroupKeyManagementGroupKeyMapListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); }, subscriptionEstablishedHandler); } -- (void)readAttributeGroupKeysWithCompletionHandler:(void (^)( - NSArray * _Nullable value, NSError * _Nullable error))completionHandler +- (void)readAttributeGroupTableWithCompletionHandler:(void (^)( + NSArray * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPGroupKeyManagementGroupKeysListAttributeCallbackBridge( + new CHIPGroupKeyManagementGroupTableListAttributeCallbackBridge( self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = GroupKeyManagement::Attributes::GroupKeys::TypeInfo; - auto successFn = Callback::FromCancelable(success); + using TypeInfo = GroupKeyManagement::Attributes::GroupTable::TypeInfo; + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)subscribeAttributeGroupKeysWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +- (void)subscribeAttributeGroupTableWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler { - new CHIPGroupKeyManagementGroupKeysListAttributeCallbackSubscriptionBridge( + new CHIPGroupKeyManagementGroupTableListAttributeCallbackSubscriptionBridge( self.callbackQueue, reportHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = GroupKeyManagement::Attributes::GroupKeys::TypeInfo; - auto successFn = Callback::FromCancelable(success); + using TypeInfo = GroupKeyManagement::Attributes::GroupTable::TypeInfo; + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, minInterval, maxInterval, - CHIPGroupKeyManagementGroupKeysListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); + CHIPGroupKeyManagementGroupTableListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); }, subscriptionEstablishedHandler); } +- (void)readAttributeMaxGroupsPerFabricWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new CHIPInt16uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = GroupKeyManagement::Attributes::MaxGroupsPerFabric::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)readAttributeMaxGroupKeysPerFabricWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new CHIPInt16uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = GroupKeyManagement::Attributes::MaxGroupKeysPerFabric::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)readAttributeAttributeListWithCompletionHandler:(void (^)( NSArray * _Nullable value, NSError * _Nullable error))completionHandler { diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.h index 10f3d76cc1fe3f..79b5e1a071ec1a 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.h @@ -825,6 +825,36 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)init; @end +@interface CHIPGroupKeyManagementClusterKeySetWriteParams : NSObject +@property (strong, nonatomic) CHIPGroupKeyManagementClusterGroupKeySet * _Nonnull groupKeySet; +- (instancetype)init; +@end + +@interface CHIPGroupKeyManagementClusterKeySetReadParams : NSObject +@property (strong, nonatomic) NSNumber * _Nonnull groupKeySetID; +- (instancetype)init; +@end + +@interface CHIPGroupKeyManagementClusterKeySetReadResponseParams : NSObject +@property (strong, nonatomic) CHIPGroupKeyManagementClusterGroupKeySet * _Nonnull groupKeySet; +- (instancetype)init; +@end + +@interface CHIPGroupKeyManagementClusterKeySetRemoveParams : NSObject +@property (strong, nonatomic) NSNumber * _Nonnull groupKeySetID; +- (instancetype)init; +@end + +@interface CHIPGroupKeyManagementClusterKeySetReadAllIndicesParams : NSObject +@property (strong, nonatomic) NSArray * _Nonnull groupKeySetIDs; +- (instancetype)init; +@end + +@interface CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseParams : NSObject +@property (strong, nonatomic) NSArray * _Nonnull groupKeySetIDs; +- (instancetype)init; +@end + @interface CHIPModeSelectClusterChangeToModeParams : NSObject @property (strong, nonatomic, getter=getNewMode) NSNumber * _Nonnull newMode; - (instancetype)init; diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.mm index f044a8902454eb..bda8aafd5ef651 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.mm @@ -1742,6 +1742,72 @@ - (instancetype)init } @end +@implementation CHIPGroupKeyManagementClusterKeySetWriteParams +- (instancetype)init +{ + if (self = [super init]) { + + _groupKeySet = [CHIPGroupKeyManagementClusterGroupKeySet new]; + } + return self; +} +@end + +@implementation CHIPGroupKeyManagementClusterKeySetReadParams +- (instancetype)init +{ + if (self = [super init]) { + + _groupKeySetID = @(0); + } + return self; +} +@end + +@implementation CHIPGroupKeyManagementClusterKeySetReadResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _groupKeySet = [CHIPGroupKeyManagementClusterGroupKeySet new]; + } + return self; +} +@end + +@implementation CHIPGroupKeyManagementClusterKeySetRemoveParams +- (instancetype)init +{ + if (self = [super init]) { + + _groupKeySetID = @(0); + } + return self; +} +@end + +@implementation CHIPGroupKeyManagementClusterKeySetReadAllIndicesParams +- (instancetype)init +{ + if (self = [super init]) { + + _groupKeySetIDs = [NSArray array]; + } + return self; +} +@end + +@implementation CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _groupKeySetIDs = [NSArray array]; + } + return self; +} +@end + @implementation CHIPModeSelectClusterChangeToModeParams - (instancetype)init { diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.h index d8e451be2ceb65..0fd985e9cc0dd7 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.h @@ -230,19 +230,30 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)init; @end +@interface CHIPGroupKeyManagementClusterGroupInfo : NSObject +@property (strong, nonatomic) NSNumber * _Nonnull fabricIndex; +@property (strong, nonatomic) NSNumber * _Nonnull groupId; +@property (strong, nonatomic) NSArray * _Nonnull endpoints; +@property (strong, nonatomic) NSString * _Nonnull groupName; +- (instancetype)init; +@end + @interface CHIPGroupKeyManagementClusterGroupKey : NSObject -@property (strong, nonatomic) NSNumber * _Nonnull vendorId; -@property (strong, nonatomic) NSNumber * _Nonnull groupKeyIndex; -@property (strong, nonatomic) NSData * _Nonnull groupKeyRoot; -@property (strong, nonatomic) NSNumber * _Nonnull groupKeyEpochStartTime; -@property (strong, nonatomic) NSNumber * _Nonnull groupKeySecurityPolicy; +@property (strong, nonatomic) NSNumber * _Nonnull fabricIndex; +@property (strong, nonatomic) NSNumber * _Nonnull groupId; +@property (strong, nonatomic) NSNumber * _Nonnull groupKeySetID; - (instancetype)init; @end -@interface CHIPGroupKeyManagementClusterGroupState : NSObject -@property (strong, nonatomic) NSNumber * _Nonnull vendorId; -@property (strong, nonatomic) NSNumber * _Nonnull vendorGroupId; -@property (strong, nonatomic) NSNumber * _Nonnull groupKeySetIndex; +@interface CHIPGroupKeyManagementClusterGroupKeySet : NSObject +@property (strong, nonatomic) NSNumber * _Nonnull groupKeySetID; +@property (strong, nonatomic) NSNumber * _Nonnull securityPolicy; +@property (strong, nonatomic) NSData * _Nonnull epochKey0; +@property (strong, nonatomic) NSNumber * _Nonnull epochStartTime0; +@property (strong, nonatomic) NSData * _Nonnull epochKey1; +@property (strong, nonatomic) NSNumber * _Nonnull epochStartTime1; +@property (strong, nonatomic) NSData * _Nonnull epochKey2; +@property (strong, nonatomic) NSNumber * _Nonnull epochStartTime2; - (instancetype)init; @end diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.mm index f29ed660ca64f4..683bb5b8204734 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.mm @@ -456,35 +456,58 @@ - (instancetype)init } @end -@implementation CHIPGroupKeyManagementClusterGroupKey +@implementation CHIPGroupKeyManagementClusterGroupInfo - (instancetype)init { if (self = [super init]) { - _vendorId = @(0); + _fabricIndex = @(0); + + _groupId = @(0); + + _endpoints = [NSArray array]; + + _groupName = @""; + } + return self; +} +@end - _groupKeyIndex = @(0); +@implementation CHIPGroupKeyManagementClusterGroupKey +- (instancetype)init +{ + if (self = [super init]) { - _groupKeyRoot = [NSData data]; + _fabricIndex = @(0); - _groupKeyEpochStartTime = @(0); + _groupId = @(0); - _groupKeySecurityPolicy = @(0); + _groupKeySetID = @(0); } return self; } @end -@implementation CHIPGroupKeyManagementClusterGroupState +@implementation CHIPGroupKeyManagementClusterGroupKeySet - (instancetype)init { if (self = [super init]) { - _vendorId = @(0); + _groupKeySetID = @(0); + + _securityPolicy = @(0); + + _epochKey0 = [NSData data]; + + _epochStartTime0 = @(0); + + _epochKey1 = [NSData data]; + + _epochStartTime1 = @(0); - _vendorGroupId = @(0); + _epochKey2 = [NSData data]; - _groupKeySetIndex = @(0); + _epochStartTime2 = @(0); } return self; } diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h index baa17a9c8e6e13..00a81841930b3c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h @@ -445,8 +445,11 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPTestGroupKeyManagement : CHIPGroupKeyManagement -- (void)writeAttributeGroupsWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGroupKeysWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeGroupKeyMapWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeGroupTableWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeMaxGroupsPerFabricWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeMaxGroupKeysPerFabricWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm index ea9c26f00015f2..c5af15f8019223 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm @@ -4494,7 +4494,7 @@ @implementation CHIPTestGroupKeyManagement return &_cppCluster; } -- (void)writeAttributeGroupsWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeGroupKeyMapWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -4503,7 +4503,7 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = GroupKeyManagement::Attributes::Groups::TypeInfo; + using TypeInfo = GroupKeyManagement::Attributes::GroupKeyMap::TypeInfo; TypeInfo::Type cppValue; { using ListType_0 = std::remove_reference_t; @@ -4515,14 +4515,14 @@ new CHIPDefaultSuccessCallbackBridge( } listFreer.add(listHolder_0); for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[CHIPGroupKeyManagementClusterGroupState class]]) { + if (![value[i_0] isKindOfClass:[CHIPGroupKeyManagementClusterGroupKey class]]) { // Wrong kind of value. return CHIP_ERROR_INVALID_ARGUMENT; } - auto element_0 = (CHIPGroupKeyManagementClusterGroupState *) value[i_0]; - listHolder_0->mList[i_0].vendorId = element_0.vendorId.unsignedShortValue; - listHolder_0->mList[i_0].vendorGroupId = element_0.vendorGroupId.unsignedShortValue; - listHolder_0->mList[i_0].groupKeySetIndex = element_0.groupKeySetIndex.unsignedShortValue; + auto element_0 = (CHIPGroupKeyManagementClusterGroupKey *) value[i_0]; + listHolder_0->mList[i_0].fabricIndex = element_0.fabricIndex.unsignedShortValue; + listHolder_0->mList[i_0].groupId = element_0.groupId.unsignedShortValue; + listHolder_0->mList[i_0].groupKeySetID = element_0.groupKeySetID.unsignedShortValue; } cppValue = ListType_0(listHolder_0->mList, value.count); } else { @@ -4535,7 +4535,7 @@ new CHIPDefaultSuccessCallbackBridge( }); } -- (void)writeAttributeGroupKeysWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeGroupTableWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -4544,7 +4544,7 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = GroupKeyManagement::Attributes::GroupKeys::TypeInfo; + using TypeInfo = GroupKeyManagement::Attributes::GroupTable::TypeInfo; TypeInfo::Type cppValue; { using ListType_0 = std::remove_reference_t; @@ -4556,18 +4556,36 @@ new CHIPDefaultSuccessCallbackBridge( } listFreer.add(listHolder_0); for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[CHIPGroupKeyManagementClusterGroupKey class]]) { + if (![value[i_0] isKindOfClass:[CHIPGroupKeyManagementClusterGroupInfo class]]) { // Wrong kind of value. return CHIP_ERROR_INVALID_ARGUMENT; } - auto element_0 = (CHIPGroupKeyManagementClusterGroupKey *) value[i_0]; - listHolder_0->mList[i_0].vendorId = element_0.vendorId.unsignedShortValue; - listHolder_0->mList[i_0].groupKeyIndex = element_0.groupKeyIndex.unsignedShortValue; - listHolder_0->mList[i_0].groupKeyRoot = [self asByteSpan:element_0.groupKeyRoot]; - listHolder_0->mList[i_0].groupKeyEpochStartTime = element_0.groupKeyEpochStartTime.unsignedLongLongValue; - listHolder_0->mList[i_0].groupKeySecurityPolicy - = static_castmList[i_0].groupKeySecurityPolicy)>>( - element_0.groupKeySecurityPolicy.unsignedCharValue); + auto element_0 = (CHIPGroupKeyManagementClusterGroupInfo *) value[i_0]; + listHolder_0->mList[i_0].fabricIndex = element_0.fabricIndex.unsignedShortValue; + listHolder_0->mList[i_0].groupId = element_0.groupId.unsignedShortValue; + { + using ListType_2 = std::remove_reference_tmList[i_0].endpoints)>; + using ListMemberType_2 = ListMemberTypeGetter::Type; + if (element_0.endpoints.count != 0) { + auto * listHolder_2 = new ListHolder(element_0.endpoints.count); + if (listHolder_2 == nullptr || listHolder_2->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_2); + for (size_t i_2 = 0; i_2 < element_0.endpoints.count; ++i_2) { + if (![element_0.endpoints[i_2] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_2 = (NSNumber *) element_0.endpoints[i_2]; + listHolder_2->mList[i_2] = element_2.unsignedShortValue; + } + listHolder_0->mList[i_0].endpoints = ListType_2(listHolder_2->mList, element_0.endpoints.count); + } else { + listHolder_0->mList[i_0].endpoints = ListType_2(); + } + } + listHolder_0->mList[i_0].groupName = [self asCharSpan:element_0.groupName]; } cppValue = ListType_0(listHolder_0->mList, value.count); } else { @@ -4580,6 +4598,43 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeMaxGroupsPerFabricWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = GroupKeyManagement::Attributes::MaxGroupsPerFabric::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeMaxGroupKeysPerFabricWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = GroupKeyManagement::Attributes::MaxGroupKeysPerFabric::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index be40032758063b..0770df6bf8898d 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -34837,74 +34837,7 @@ - (void)testSendClusterTestGroupsCluster_000006_GetGroupMembership [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestGroupsCluster_000007_AddGroup -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Add Group 2 (new)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPGroupsClusterAddGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:4369U]; - params.groupName = @"Group #2"; - [cluster addGroupWithParams:params - completionHandler:^(CHIPGroupsClusterAddGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Add Group 2 (new) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.status; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - { - id actualValue = values.groupId; - XCTAssertEqual([actualValue unsignedShortValue], 4369U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupsCluster_000008_ViewGroup -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 2 (new)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:4369U]; - [cluster viewGroupWithParams:params - completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"View Group 2 (new) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.status; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - { - id actualValue = values.groupId; - XCTAssertEqual([actualValue unsignedShortValue], 4369U); - } - { - id actualValue = values.groupName; - XCTAssertTrue([actualValue isEqualToString:@"Group #2"]); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupsCluster_000009_ViewGroup +- (void)testSendClusterTestGroupsCluster_000007_ViewGroup { XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 3 (not found)"]; @@ -34935,39 +34868,7 @@ - (void)testSendClusterTestGroupsCluster_000009_ViewGroup [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestGroupsCluster_000010_AddGroup -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Add Group 3 (new)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPGroupsClusterAddGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:32767U]; - params.groupName = @"Group #3"; - [cluster addGroupWithParams:params - completionHandler:^(CHIPGroupsClusterAddGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Add Group 3 (new) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.status; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - { - id actualValue = values.groupId; - XCTAssertEqual([actualValue unsignedShortValue], 32767U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupsCluster_000011_ViewGroup +- (void)testSendClusterTestGroupsCluster_000008_ViewGroup { XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 1 (existing)"]; @@ -35002,116 +34903,7 @@ - (void)testSendClusterTestGroupsCluster_000011_ViewGroup [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestGroupsCluster_000012_ViewGroup -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 2 (existing)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:4369U]; - [cluster viewGroupWithParams:params - completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"View Group 2 (existing) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.status; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - { - id actualValue = values.groupId; - XCTAssertEqual([actualValue unsignedShortValue], 4369U); - } - { - id actualValue = values.groupName; - XCTAssertTrue([actualValue isEqualToString:@"Group #2"]); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupsCluster_000013_GetGroupMembership -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Get Group Membership 2"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPGroupsClusterGetGroupMembershipParams alloc] init]; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [NSNumber numberWithUnsignedShort:2U]; - temp_0[1] = [NSNumber numberWithUnsignedShort:3U]; - temp_0[2] = [NSNumber numberWithUnsignedShort:32767U]; - params.groupList = temp_0; - } - [cluster getGroupMembershipWithParams:params - completionHandler:^( - CHIPGroupsClusterGetGroupMembershipResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Get Group Membership 2 Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.capacity; - XCTAssertEqual([actualValue unsignedCharValue], 255); - } - { - id actualValue = values.groupList; - XCTAssertEqual([actualValue count], 1); - XCTAssertEqual([actualValue[0] unsignedShortValue], 32767U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupsCluster_000014_ViewGroup -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 3 (new)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:32767U]; - [cluster viewGroupWithParams:params - completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"View Group 3 (new) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.status; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - { - id actualValue = values.groupId; - XCTAssertEqual([actualValue unsignedShortValue], 32767U); - } - { - id actualValue = values.groupName; - XCTAssertTrue([actualValue isEqualToString:@"Group #3"]); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupsCluster_000015_RemoveGroup +- (void)testSendClusterTestGroupsCluster_000009_RemoveGroup { XCTestExpectation * expectation = [self expectationWithDescription:@"Remove Group 0 (invalid)"]; @@ -35142,7 +34934,7 @@ - (void)testSendClusterTestGroupsCluster_000015_RemoveGroup [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestGroupsCluster_000016_RemoveGroup +- (void)testSendClusterTestGroupsCluster_000010_RemoveGroup { XCTestExpectation * expectation = [self expectationWithDescription:@"Remove Group 4 (not found)"]; @@ -35173,38 +34965,7 @@ - (void)testSendClusterTestGroupsCluster_000016_RemoveGroup [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestGroupsCluster_000017_RemoveGroup -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Remove Group 2 (existing)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPGroupsClusterRemoveGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:4369U]; - [cluster removeGroupWithParams:params - completionHandler:^(CHIPGroupsClusterRemoveGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Remove Group 2 (existing) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.status; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - { - id actualValue = values.groupId; - XCTAssertEqual([actualValue unsignedShortValue], 4369U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupsCluster_000018_ViewGroup +- (void)testSendClusterTestGroupsCluster_000011_ViewGroup { XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 1 (not removed)"]; @@ -35239,7 +35000,7 @@ - (void)testSendClusterTestGroupsCluster_000018_ViewGroup [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestGroupsCluster_000019_ViewGroup +- (void)testSendClusterTestGroupsCluster_000012_ViewGroup { XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 2 (removed)"]; @@ -35270,42 +35031,7 @@ - (void)testSendClusterTestGroupsCluster_000019_ViewGroup [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestGroupsCluster_000020_ViewGroup -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 3 (not removed)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:32767U]; - [cluster viewGroupWithParams:params - completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"View Group 3 (not removed) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.status; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - { - id actualValue = values.groupId; - XCTAssertEqual([actualValue unsignedShortValue], 32767U); - } - { - id actualValue = values.groupName; - XCTAssertTrue([actualValue isEqualToString:@"Group #3"]); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupsCluster_000021_GetGroupMembership +- (void)testSendClusterTestGroupsCluster_000013_GetGroupMembership { XCTestExpectation * expectation = [self expectationWithDescription:@"Get Group Membership 3"]; @@ -35345,7 +35071,7 @@ - (void)testSendClusterTestGroupsCluster_000021_GetGroupMembership [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestGroupsCluster_000022_RemoveAllGroups +- (void)testSendClusterTestGroupsCluster_000014_RemoveAllGroups { XCTestExpectation * expectation = [self expectationWithDescription:@"Remove All"]; @@ -35364,7 +35090,7 @@ - (void)testSendClusterTestGroupsCluster_000022_RemoveAllGroups [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestGroupsCluster_000023_ViewGroup +- (void)testSendClusterTestGroupsCluster_000015_ViewGroup { XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 1 (removed)"]; @@ -35395,7 +35121,7 @@ - (void)testSendClusterTestGroupsCluster_000023_ViewGroup [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestGroupsCluster_000024_ViewGroup +- (void)testSendClusterTestGroupsCluster_000016_ViewGroup { XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 2 (still removed)"]; @@ -35426,7 +35152,7 @@ - (void)testSendClusterTestGroupsCluster_000024_ViewGroup [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestGroupsCluster_000025_ViewGroup +- (void)testSendClusterTestGroupsCluster_000017_ViewGroup { XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 3 (removed)"]; @@ -35457,7 +35183,7 @@ - (void)testSendClusterTestGroupsCluster_000025_ViewGroup [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestGroupsCluster_000026_GetGroupMembership +- (void)testSendClusterTestGroupsCluster_000018_GetGroupMembership { XCTestExpectation * expectation = [self expectationWithDescription:@"Get Group Membership 4"]; @@ -35498,6 +35224,63 @@ - (void)testSendClusterTestGroupsCluster_000026_GetGroupMembership [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterTestGroupKeyManagementCluster_000000_WaitForCommissionee +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForCommissionee(expectation, queue); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestGroupKeyManagementCluster_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read maxGroupsPerFabric"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeMaxGroupsPerFabricWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read maxGroupsPerFabric Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedShortValue], 1U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestGroupKeyManagementCluster_000002_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read maxGroupKeysPerFabric"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeMaxGroupKeysPerFabricWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read maxGroupKeysPerFabric Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedShortValue], 1U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + - (void)testSendClusterTestIdentifyCluster_000000_WaitForCommissionee { XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; @@ -41239,7 +41022,57 @@ - (void)testSendClusterGeneralDiagnosticsReadAttributeClusterRevisionWithComplet [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterGroupKeyManagementReadAttributeGroupsWithCompletionHandler +- (void)testSendClusterGroupKeyManagementReadAttributeGroupKeyMapWithCompletionHandler +{ + dispatch_queue_t queue = dispatch_get_main_queue(); + + XCTestExpectation * connectedExpectation = + [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + WaitForCommissionee(connectedExpectation, queue); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; + + CHIPDevice * device = GetConnectedDevice(); + CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; + XCTAssertNotNil(cluster); + + XCTestExpectation * expectation = + [self expectationWithDescription:@"GroupKeyManagementReadAttributeGroupKeyMapWithCompletionHandler"]; + + [cluster readAttributeGroupKeyMapWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"GroupKeyManagement GroupKeyMap Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterGroupKeyManagementReadAttributeGroupTableWithCompletionHandler +{ + dispatch_queue_t queue = dispatch_get_main_queue(); + + XCTestExpectation * connectedExpectation = + [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + WaitForCommissionee(connectedExpectation, queue); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; + + CHIPDevice * device = GetConnectedDevice(); + CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; + XCTAssertNotNil(cluster); + + XCTestExpectation * expectation = + [self expectationWithDescription:@"GroupKeyManagementReadAttributeGroupTableWithCompletionHandler"]; + + [cluster readAttributeGroupTableWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"GroupKeyManagement GroupTable Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterGroupKeyManagementReadAttributeMaxGroupsPerFabricWithCompletionHandler { dispatch_queue_t queue = dispatch_get_main_queue(); @@ -41253,10 +41086,10 @@ - (void)testSendClusterGroupKeyManagementReadAttributeGroupsWithCompletionHandle XCTAssertNotNil(cluster); XCTestExpectation * expectation = - [self expectationWithDescription:@"GroupKeyManagementReadAttributeGroupsWithCompletionHandler"]; + [self expectationWithDescription:@"GroupKeyManagementReadAttributeMaxGroupsPerFabricWithCompletionHandler"]; - [cluster readAttributeGroupsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"GroupKeyManagement Groups Error: %@", err); + [cluster readAttributeMaxGroupsPerFabricWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"GroupKeyManagement MaxGroupsPerFabric Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; }]; @@ -41264,7 +41097,7 @@ - (void)testSendClusterGroupKeyManagementReadAttributeGroupsWithCompletionHandle [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterGroupKeyManagementReadAttributeGroupKeysWithCompletionHandler +- (void)testSendClusterGroupKeyManagementReadAttributeMaxGroupKeysPerFabricWithCompletionHandler { dispatch_queue_t queue = dispatch_get_main_queue(); @@ -41278,10 +41111,10 @@ - (void)testSendClusterGroupKeyManagementReadAttributeGroupKeysWithCompletionHan XCTAssertNotNil(cluster); XCTestExpectation * expectation = - [self expectationWithDescription:@"GroupKeyManagementReadAttributeGroupKeysWithCompletionHandler"]; + [self expectationWithDescription:@"GroupKeyManagementReadAttributeMaxGroupKeysPerFabricWithCompletionHandler"]; - [cluster readAttributeGroupKeysWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"GroupKeyManagement GroupKeys Error: %@", err); + [cluster readAttributeMaxGroupKeysPerFabricWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"GroupKeyManagement MaxGroupKeysPerFabric Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; }]; diff --git a/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp index a00849135e4baa..000f19366fdda4 100644 --- a/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp @@ -664,6 +664,74 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP } // namespace GeneralCommissioning +namespace GroupKeyManagement { + +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) +{ + // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV + // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. + // Any error value TLVUnpackError means we have received an illegal value. + // The following variables are used for all commands to save code size. + CHIP_ERROR TLVError = CHIP_NO_ERROR; + bool wasHandled = false; + { + switch (aCommandPath.mCommandId) + { + case Commands::KeySetRead::Id: { + Commands::KeySetRead::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) + { + wasHandled = emberAfGroupKeyManagementClusterKeySetReadCallback(apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::KeySetReadAllIndices::Id: { + Commands::KeySetReadAllIndices::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) + { + wasHandled = emberAfGroupKeyManagementClusterKeySetReadAllIndicesCallback(apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::KeySetRemove::Id: { + Commands::KeySetRemove::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) + { + wasHandled = emberAfGroupKeyManagementClusterKeySetRemoveCallback(apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::KeySetWrite::Id: { + Commands::KeySetWrite::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) + { + wasHandled = emberAfGroupKeyManagementClusterKeySetWriteCallback(apCommandObj, aCommandPath, commandData); + } + break; + } + default: { + // Unrecognized command ID, error status will apply. + apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCommand); + ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, + ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); + return; + } + } + } + + if (CHIP_NO_ERROR != TLVError || !wasHandled) + { + apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); + ChipLogProgress(Zcl, "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, TLVError.Format()); + } +} + +} // namespace GroupKeyManagement + namespace Groups { void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) @@ -1868,6 +1936,9 @@ void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, TLV: case Clusters::GeneralCommissioning::Id: Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; + case Clusters::GroupKeyManagement::Id: + Clusters::GroupKeyManagement::DispatchServerCommand(apCommandObj, aCommandPath, aReader); + break; case Clusters::Groups::Id: Clusters::Groups::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; diff --git a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h index ffea31ed9d0af9..ed9a383989188f 100644 --- a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h +++ b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h @@ -275,67 +275,33 @@ /* 628 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x03, \ \ - /* Endpoint: 0, Cluster: Group Key Management (server), big-endian */ \ - \ - /* 632 - groups, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 886 - group keys, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ /* Endpoint: 1, Cluster: On/Off (server), big-endian */ \ \ - /* 1140 - FeatureMap, */ \ + /* 632 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Power Source (server), big-endian */ \ \ - /* 1144 - BatteryVoltage, */ \ + /* 636 - BatteryVoltage, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1148 - BatteryTimeRemaining, */ \ + /* 640 - BatteryTimeRemaining, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1152 - ActiveBatteryFaults, */ \ + /* 644 - ActiveBatteryFaults, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1160 - FeatureMap, */ \ + /* 652 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Switch (server), big-endian */ \ \ - /* 1164 - FeatureMap, */ \ + /* 656 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Fixed Label (server), big-endian */ \ \ - /* 1168 - label list, */ \ + /* 660 - label list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -353,49 +319,49 @@ \ /* Endpoint: 1, Cluster: Mode Select (server), big-endian */ \ \ - /* 1422 - Description, */ \ + /* 914 - Description, */ \ 6, 'C', 'o', 'f', 'f', 'e', 'e', \ \ /* Endpoint: 1, Cluster: Door Lock (server), big-endian */ \ \ - /* 1429 - Language, */ \ + /* 921 - Language, */ \ 2, 'e', 'n', \ \ - /* 1432 - AutoRelockTime, */ \ + /* 924 - AutoRelockTime, */ \ 0x00, 0x00, 0x00, 0x60, \ \ /* Endpoint: 1, Cluster: Window Covering (server), big-endian */ \ \ - /* 1436 - FeatureMap, */ \ + /* 928 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Pump Configuration and Control (server), big-endian */ \ \ - /* 1440 - LifetimeRunningHours, */ \ + /* 932 - LifetimeRunningHours, */ \ 0x00, 0x00, 0x00, \ \ - /* 1443 - Power, */ \ + /* 935 - Power, */ \ 0x00, 0x00, 0x00, \ \ - /* 1446 - LifetimeEnergyConsumed, */ \ + /* 938 - LifetimeEnergyConsumed, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1450 - FeatureMap, */ \ + /* 942 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Thermostat (server), big-endian */ \ \ - /* 1454 - FeatureMap, */ \ + /* 946 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x0B, \ \ /* Endpoint: 1, Cluster: IAS Zone (server), big-endian */ \ \ - /* 1458 - IAS CIE address, */ \ + /* 950 - IAS CIE address, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Channel (server), big-endian */ \ \ - /* 1466 - channel list, */ \ + /* 958 - channel list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -413,7 +379,7 @@ \ /* Endpoint: 1, Cluster: Target Navigator (server), big-endian */ \ \ - /* 1720 - target navigator list, */ \ + /* 1212 - target navigator list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -431,24 +397,24 @@ \ /* Endpoint: 1, Cluster: Media Playback (server), big-endian */ \ \ - /* 1974 - start time, */ \ + /* 1466 - start time, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, \ \ - /* 1982 - duration, */ \ + /* 1474 - duration, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1990 - playback speed, */ \ + /* 1482 - playback speed, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1994 - seek range end, */ \ + /* 1486 - seek range end, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2002 - seek range start, */ \ + /* 1494 - seek range start, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Media Input (server), big-endian */ \ \ - /* 2010 - media input list, */ \ + /* 1502 - media input list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -466,7 +432,7 @@ \ /* Endpoint: 1, Cluster: Content Launcher (server), big-endian */ \ \ - /* 2264 - accept header list, */ \ + /* 1756 - accept header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -482,12 +448,12 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2518 - supported streaming protocols, */ \ + /* 2010 - supported streaming protocols, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Audio Output (server), big-endian */ \ \ - /* 2522 - audio output list, */ \ + /* 2014 - audio output list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -505,7 +471,7 @@ \ /* Endpoint: 1, Cluster: Application Launcher (server), big-endian */ \ \ - /* 2776 - application launcher list, */ \ + /* 2268 - application launcher list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -523,61 +489,61 @@ \ /* Endpoint: 1, Cluster: Test Cluster (server), big-endian */ \ \ - /* 3030 - bitmap32, */ \ + /* 2522 - bitmap32, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3034 - bitmap64, */ \ + /* 2526 - bitmap64, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3042 - int24u, */ \ + /* 2534 - int24u, */ \ 0x00, 0x00, 0x00, \ \ - /* 3045 - int32u, */ \ + /* 2537 - int32u, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3049 - int40u, */ \ + /* 2541 - int40u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3054 - int48u, */ \ + /* 2546 - int48u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3060 - int56u, */ \ + /* 2552 - int56u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3067 - int64u, */ \ + /* 2559 - int64u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3075 - int24s, */ \ + /* 2567 - int24s, */ \ 0x00, 0x00, 0x00, \ \ - /* 3078 - int32s, */ \ + /* 2570 - int32s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3082 - int40s, */ \ + /* 2574 - int40s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3087 - int48s, */ \ + /* 2579 - int48s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3093 - int56s, */ \ + /* 2585 - int56s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3100 - int64s, */ \ + /* 2592 - int64s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3108 - float_single, */ \ + /* 2600 - float_single, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3112 - float_double, */ \ + /* 2604 - float_double, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3120 - epoch_us, */ \ + /* 2612 - epoch_us, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3128 - epoch_s, */ \ + /* 2620 - epoch_s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3132 - list_long_octet_string, */ \ + /* 2624 - list_long_octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -632,65 +598,65 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4132 - nullable_bitmap32, */ \ + /* 3624 - nullable_bitmap32, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 4136 - nullable_bitmap64, */ \ + /* 3628 - nullable_bitmap64, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4144 - nullable_int24u, */ \ + /* 3636 - nullable_int24u, */ \ 0x00, 0x00, 0x00, \ \ - /* 4147 - nullable_int32u, */ \ + /* 3639 - nullable_int32u, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 4151 - nullable_int40u, */ \ + /* 3643 - nullable_int40u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4156 - nullable_int48u, */ \ + /* 3648 - nullable_int48u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4162 - nullable_int56u, */ \ + /* 3654 - nullable_int56u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4169 - nullable_int64u, */ \ + /* 3661 - nullable_int64u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4177 - nullable_int24s, */ \ + /* 3669 - nullable_int24s, */ \ 0x00, 0x00, 0x00, \ \ - /* 4180 - nullable_int32s, */ \ + /* 3672 - nullable_int32s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 4184 - nullable_int40s, */ \ + /* 3676 - nullable_int40s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4189 - nullable_int48s, */ \ + /* 3681 - nullable_int48s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4195 - nullable_int56s, */ \ + /* 3687 - nullable_int56s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4202 - nullable_int64s, */ \ + /* 3694 - nullable_int64s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4210 - nullable_float_single, */ \ + /* 3702 - nullable_float_single, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 4214 - nullable_float_double, */ \ + /* 3706 - nullable_float_double, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Electrical Measurement (server), big-endian */ \ \ - /* 4222 - measurement type, */ \ + /* 3714 - measurement type, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 4226 - total active power, */ \ + /* 3718 - total active power, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 2, Cluster: On/Off (server), big-endian */ \ \ - /* 4230 - FeatureMap, */ \ + /* 3722 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ } @@ -946,67 +912,33 @@ /* 628 - FeatureMap, */ \ 0x03, 0x00, 0x00, 0x00, \ \ - /* Endpoint: 0, Cluster: Group Key Management (server), little-endian */ \ - \ - /* 632 - groups, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 886 - group keys, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ /* Endpoint: 1, Cluster: On/Off (server), little-endian */ \ \ - /* 1140 - FeatureMap, */ \ + /* 632 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Power Source (server), little-endian */ \ \ - /* 1144 - BatteryVoltage, */ \ + /* 636 - BatteryVoltage, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1148 - BatteryTimeRemaining, */ \ + /* 640 - BatteryTimeRemaining, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1152 - ActiveBatteryFaults, */ \ + /* 644 - ActiveBatteryFaults, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1160 - FeatureMap, */ \ + /* 652 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Switch (server), little-endian */ \ \ - /* 1164 - FeatureMap, */ \ + /* 656 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Fixed Label (server), little-endian */ \ \ - /* 1168 - label list, */ \ + /* 660 - label list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1024,49 +956,49 @@ \ /* Endpoint: 1, Cluster: Mode Select (server), little-endian */ \ \ - /* 1422 - Description, */ \ + /* 914 - Description, */ \ 6, 'C', 'o', 'f', 'f', 'e', 'e', \ \ /* Endpoint: 1, Cluster: Door Lock (server), little-endian */ \ \ - /* 1429 - Language, */ \ + /* 921 - Language, */ \ 2, 'e', 'n', \ \ - /* 1432 - AutoRelockTime, */ \ + /* 924 - AutoRelockTime, */ \ 0x60, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Window Covering (server), little-endian */ \ \ - /* 1436 - FeatureMap, */ \ + /* 928 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Pump Configuration and Control (server), little-endian */ \ \ - /* 1440 - LifetimeRunningHours, */ \ + /* 932 - LifetimeRunningHours, */ \ 0x00, 0x00, 0x00, \ \ - /* 1443 - Power, */ \ + /* 935 - Power, */ \ 0x00, 0x00, 0x00, \ \ - /* 1446 - LifetimeEnergyConsumed, */ \ + /* 938 - LifetimeEnergyConsumed, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1450 - FeatureMap, */ \ + /* 942 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Thermostat (server), little-endian */ \ \ - /* 1454 - FeatureMap, */ \ + /* 946 - FeatureMap, */ \ 0x0B, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: IAS Zone (server), little-endian */ \ \ - /* 1458 - IAS CIE address, */ \ + /* 950 - IAS CIE address, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Channel (server), little-endian */ \ \ - /* 1466 - channel list, */ \ + /* 958 - channel list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1084,7 +1016,7 @@ \ /* Endpoint: 1, Cluster: Target Navigator (server), little-endian */ \ \ - /* 1720 - target navigator list, */ \ + /* 1212 - target navigator list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1102,24 +1034,24 @@ \ /* Endpoint: 1, Cluster: Media Playback (server), little-endian */ \ \ - /* 1974 - start time, */ \ + /* 1466 - start time, */ \ 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1982 - duration, */ \ + /* 1474 - duration, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1990 - playback speed, */ \ + /* 1482 - playback speed, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1994 - seek range end, */ \ + /* 1486 - seek range end, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2002 - seek range start, */ \ + /* 1494 - seek range start, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Media Input (server), little-endian */ \ \ - /* 2010 - media input list, */ \ + /* 1502 - media input list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1137,7 +1069,7 @@ \ /* Endpoint: 1, Cluster: Content Launcher (server), little-endian */ \ \ - /* 2264 - accept header list, */ \ + /* 1756 - accept header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1153,12 +1085,12 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2518 - supported streaming protocols, */ \ + /* 2010 - supported streaming protocols, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Audio Output (server), little-endian */ \ \ - /* 2522 - audio output list, */ \ + /* 2014 - audio output list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1176,7 +1108,7 @@ \ /* Endpoint: 1, Cluster: Application Launcher (server), little-endian */ \ \ - /* 2776 - application launcher list, */ \ + /* 2268 - application launcher list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1194,61 +1126,61 @@ \ /* Endpoint: 1, Cluster: Test Cluster (server), little-endian */ \ \ - /* 3030 - bitmap32, */ \ + /* 2522 - bitmap32, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3034 - bitmap64, */ \ + /* 2526 - bitmap64, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3042 - int24u, */ \ + /* 2534 - int24u, */ \ 0x00, 0x00, 0x00, \ \ - /* 3045 - int32u, */ \ + /* 2537 - int32u, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3049 - int40u, */ \ + /* 2541 - int40u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3054 - int48u, */ \ + /* 2546 - int48u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3060 - int56u, */ \ + /* 2552 - int56u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3067 - int64u, */ \ + /* 2559 - int64u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3075 - int24s, */ \ + /* 2567 - int24s, */ \ 0x00, 0x00, 0x00, \ \ - /* 3078 - int32s, */ \ + /* 2570 - int32s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3082 - int40s, */ \ + /* 2574 - int40s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3087 - int48s, */ \ + /* 2579 - int48s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3093 - int56s, */ \ + /* 2585 - int56s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3100 - int64s, */ \ + /* 2592 - int64s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3108 - float_single, */ \ + /* 2600 - float_single, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3112 - float_double, */ \ + /* 2604 - float_double, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3120 - epoch_us, */ \ + /* 2612 - epoch_us, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3128 - epoch_s, */ \ + /* 2620 - epoch_s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3132 - list_long_octet_string, */ \ + /* 2624 - list_long_octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1303,71 +1235,71 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4132 - nullable_bitmap32, */ \ + /* 3624 - nullable_bitmap32, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 4136 - nullable_bitmap64, */ \ + /* 3628 - nullable_bitmap64, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4144 - nullable_int24u, */ \ + /* 3636 - nullable_int24u, */ \ 0x00, 0x00, 0x00, \ \ - /* 4147 - nullable_int32u, */ \ + /* 3639 - nullable_int32u, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 4151 - nullable_int40u, */ \ + /* 3643 - nullable_int40u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4156 - nullable_int48u, */ \ + /* 3648 - nullable_int48u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4162 - nullable_int56u, */ \ + /* 3654 - nullable_int56u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4169 - nullable_int64u, */ \ + /* 3661 - nullable_int64u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4177 - nullable_int24s, */ \ + /* 3669 - nullable_int24s, */ \ 0x00, 0x00, 0x00, \ \ - /* 4180 - nullable_int32s, */ \ + /* 3672 - nullable_int32s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 4184 - nullable_int40s, */ \ + /* 3676 - nullable_int40s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4189 - nullable_int48s, */ \ + /* 3681 - nullable_int48s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4195 - nullable_int56s, */ \ + /* 3687 - nullable_int56s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4202 - nullable_int64s, */ \ + /* 3694 - nullable_int64s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4210 - nullable_float_single, */ \ + /* 3702 - nullable_float_single, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 4214 - nullable_float_double, */ \ + /* 3706 - nullable_float_double, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Electrical Measurement (server), little-endian */ \ \ - /* 4222 - measurement type, */ \ + /* 3714 - measurement type, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 4226 - total active power, */ \ + /* 3718 - total active power, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 2, Cluster: On/Off (server), little-endian */ \ \ - /* 4230 - FeatureMap, */ \ + /* 3722 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ } #endif // BIGENDIAN_CPU -#define GENERATED_DEFAULTS_COUNT (142) +#define GENERATED_DEFAULTS_COUNT (140) #define ZAP_TYPE(type) ZCL_##type##_ATTRIBUTE_TYPE #define ZAP_LONG_DEFAULTS_INDEX(index) \ @@ -1460,7 +1392,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 586 +#define GENERATED_ATTRIBUTE_COUNT 588 #define GENERATED_ATTRIBUTES \ { \ \ @@ -1686,9 +1618,12 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Group Key Management (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(632) }, /* groups */ \ - { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(886) }, /* group keys */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* groupKeyMap */ \ + { 0x0001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* groupTable */ \ + { 0x0002, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* maxGroupsPerFabric */ \ + { 0x0003, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ + ZAP_EMPTY_DEFAULT() }, /* maxGroupKeysPerFabric */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Fixed Label (server) */ \ { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* label list */ \ @@ -1729,7 +1664,7 @@ { 0x4001, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x0000) }, /* OnTime */ \ { 0x4002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x0000) }, /* OffWaitTime */ \ { 0x4003, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* StartUpOnOff */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1140) }, /* FeatureMap */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(632) }, /* FeatureMap */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(4) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: On/off Switch Configuration (server) */ \ @@ -1786,31 +1721,31 @@ { 0xFFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Power Source (server) */ \ - { 0x0000, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* Status */ \ - { 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* Order */ \ - { 0x0002, ZAP_TYPE(CHAR_STRING), 61, 0, ZAP_EMPTY_DEFAULT() }, /* Description */ \ - { 0x000B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1144) }, /* BatteryVoltage */ \ - { 0x000C, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BatteryPercentRemaining */ \ - { 0x000D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1148) }, /* BatteryTimeRemaining */ \ - { 0x000E, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BatteryChargeLevel */ \ - { 0x0012, ZAP_TYPE(ARRAY), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1152) }, /* ActiveBatteryFaults */ \ - { 0x001A, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BatteryChargeState */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1160) }, /* FeatureMap */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x0000, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* Status */ \ + { 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* Order */ \ + { 0x0002, ZAP_TYPE(CHAR_STRING), 61, 0, ZAP_EMPTY_DEFAULT() }, /* Description */ \ + { 0x000B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(636) }, /* BatteryVoltage */ \ + { 0x000C, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BatteryPercentRemaining */ \ + { 0x000D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(640) }, /* BatteryTimeRemaining */ \ + { 0x000E, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BatteryChargeLevel */ \ + { 0x0012, ZAP_TYPE(ARRAY), 8, 0, ZAP_LONG_DEFAULTS_INDEX(644) }, /* ActiveBatteryFaults */ \ + { 0x001A, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BatteryChargeState */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(652) }, /* FeatureMap */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Bridged Device Basic (server) */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Switch (server) */ \ - { 0x0000, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(2) }, /* number of positions */ \ - { 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* current position */ \ - { 0x0002, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(2) }, /* multi press max */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1164) }, /* FeatureMap */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x0000, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(2) }, /* number of positions */ \ + { 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* current position */ \ + { 0x0002, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(2) }, /* multi press max */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(656) }, /* FeatureMap */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Fixed Label (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1168) }, /* label list */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(660) }, /* label list */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: User Label (server) */ \ { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ @@ -1826,7 +1761,7 @@ { 0x0001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(0) }, /* SupportedModes */ \ { 0x0002, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* OnMode */ \ { 0x0003, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* StartUpMode */ \ - { 0x0004, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(1422) }, /* Description */ \ + { 0x0004, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(914) }, /* Description */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Door Lock (server) */ \ @@ -1839,8 +1774,8 @@ { 0x0017, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(6) }, /* MaxPINCodeLength */ \ { 0x0018, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(6) }, /* MinPINCodeLength */ \ { 0x001B, ZAP_TYPE(BITMAP8), 1, 0, ZAP_SIMPLE_DEFAULT(1) }, /* CredentialRulesSupport */ \ - { 0x0021, ZAP_TYPE(CHAR_STRING), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1429) }, /* Language */ \ - { 0x0023, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1432) }, /* AutoRelockTime */ \ + { 0x0021, ZAP_TYPE(CHAR_STRING), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(921) }, /* Language */ \ + { 0x0023, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(924) }, /* AutoRelockTime */ \ { 0x0024, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_MIN_MAX_DEFAULTS_INDEX(5) }, /* SoundVolume */ \ { 0x0025, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ @@ -1873,10 +1808,10 @@ { 0x0012, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* InstalledOpenLimitTilt */ \ { 0x0013, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFFFF) }, /* InstalledClosedLimitTilt */ \ { 0x0017, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(9) }, /* Mode */ \ - { 0x001A, ZAP_TYPE(BITMAP16), 2, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* SafetyStatus */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1436) }, /* FeatureMap */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(5) }, /* ClusterRevision */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(9) }, /* Mode */ \ + { 0x001A, ZAP_TYPE(BITMAP16), 2, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* SafetyStatus */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(928) }, /* FeatureMap */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(5) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Barrier Control (server) */ \ { 0x0001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* barrier moving state */ \ @@ -1905,17 +1840,17 @@ { 0x0013, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Capacity */ \ { 0x0014, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Speed */ \ { 0x0015, ZAP_TYPE(INT24U), 3, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(1440) }, /* LifetimeRunningHours */ \ - { 0x0016, ZAP_TYPE(INT24U), 3, 0, ZAP_LONG_DEFAULTS_INDEX(1443) }, /* Power */ \ + ZAP_LONG_DEFAULTS_INDEX(932) }, /* LifetimeRunningHours */ \ + { 0x0016, ZAP_TYPE(INT24U), 3, 0, ZAP_LONG_DEFAULTS_INDEX(935) }, /* Power */ \ { 0x0017, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(1446) }, /* LifetimeEnergyConsumed */ \ + ZAP_LONG_DEFAULTS_INDEX(938) }, /* LifetimeEnergyConsumed */ \ { 0x0020, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_MIN_MAX_DEFAULTS_INDEX(10) }, /* OperationMode */ \ { 0x0021, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(11) }, /* ControlMode */ \ - { 0x0022, ZAP_TYPE(BITMAP16), 2, 0, ZAP_EMPTY_DEFAULT() }, /* AlarmMask */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1450) }, /* FeatureMap */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(11) }, /* ControlMode */ \ + { 0x0022, ZAP_TYPE(BITMAP16), 2, 0, ZAP_EMPTY_DEFAULT() }, /* AlarmMask */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(942) }, /* FeatureMap */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Thermostat (server) */ \ { 0x0000, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* local temperature */ \ @@ -1940,12 +1875,12 @@ { 0x001B, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_MIN_MAX_DEFAULTS_INDEX(17) }, /* control sequence of operation */ \ { 0x001C, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(18) }, /* system mode */ \ - { 0x0020, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* start of week */ \ - { 0x0021, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(7) }, /* number of weekly transitions */ \ - { 0x0022, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(4) }, /* number of daily transitions */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1454) }, /* FeatureMap */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(18) }, /* system mode */ \ + { 0x0020, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* start of week */ \ + { 0x0021, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(7) }, /* number of weekly transitions */ \ + { 0x0022, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(4) }, /* number of daily transitions */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(946) }, /* FeatureMap */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Thermostat User Interface Configuration (server) */ \ { 0x0000, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ @@ -2062,37 +1997,37 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: IAS Zone (server) */ \ - { 0x0000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* zone state */ \ - { 0x0001, ZAP_TYPE(ENUM16), 2, 0, ZAP_EMPTY_DEFAULT() }, /* zone type */ \ - { 0x0002, ZAP_TYPE(BITMAP16), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* zone status */ \ - { 0x0010, ZAP_TYPE(NODE_ID), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1458) }, /* IAS CIE address */ \ - { 0x0011, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0xff) }, /* Zone ID */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* ClusterRevision */ \ + { 0x0000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* zone state */ \ + { 0x0001, ZAP_TYPE(ENUM16), 2, 0, ZAP_EMPTY_DEFAULT() }, /* zone type */ \ + { 0x0002, ZAP_TYPE(BITMAP16), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* zone status */ \ + { 0x0010, ZAP_TYPE(NODE_ID), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(950) }, /* IAS CIE address */ \ + { 0x0011, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0xff) }, /* Zone ID */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ { 0x0000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* wake on lan mac address */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Channel (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1466) }, /* channel list */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(958) }, /* channel list */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Target Navigator (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1720) }, /* target navigator list */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1212) }, /* target navigator list */ \ { 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* current navigator target */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Media Playback (server) */ \ { 0x0000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* playback state */ \ - { 0x0001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1974) }, /* start time */ \ - { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1982) }, /* duration */ \ - { 0x0004, ZAP_TYPE(SINGLE), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1990) }, /* playback speed */ \ - { 0x0005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1994) }, /* seek range end */ \ - { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(2002) }, /* seek range start */ \ + { 0x0001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1466) }, /* start time */ \ + { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1474) }, /* duration */ \ + { 0x0004, ZAP_TYPE(SINGLE), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1482) }, /* playback speed */ \ + { 0x0005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1486) }, /* seek range end */ \ + { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1494) }, /* seek range start */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Media Input (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2010) }, /* media input list */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1502) }, /* media input list */ \ { 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* current media input */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ @@ -2103,18 +2038,18 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Content Launcher (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2264) }, /* accept header list */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1756) }, /* accept header list */ \ { 0x0001, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(2518) }, /* supported streaming protocols */ \ + ZAP_LONG_DEFAULTS_INDEX(2010) }, /* supported streaming protocols */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Audio Output (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2522) }, /* audio output list */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2014) }, /* audio output list */ \ { 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* current audio output */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Application Launcher (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2776) }, /* application launcher list */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2268) }, /* application launcher list */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Application Basic (server) */ \ @@ -2133,28 +2068,28 @@ { 0x0000, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(false) }, /* boolean */ \ { 0x0001, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* bitmap8 */ \ { 0x0002, ZAP_TYPE(BITMAP16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* bitmap16 */ \ - { 0x0003, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3030) }, /* bitmap32 */ \ - { 0x0004, ZAP_TYPE(BITMAP64), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3034) }, /* bitmap64 */ \ + { 0x0003, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2522) }, /* bitmap32 */ \ + { 0x0004, ZAP_TYPE(BITMAP64), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2526) }, /* bitmap64 */ \ { 0x0005, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int8u */ \ { 0x0006, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int16u */ \ - { 0x0007, ZAP_TYPE(INT24U), 3, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3042) }, /* int24u */ \ - { 0x0008, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3045) }, /* int32u */ \ - { 0x0009, ZAP_TYPE(INT40U), 5, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3049) }, /* int40u */ \ - { 0x000A, ZAP_TYPE(INT48U), 6, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3054) }, /* int48u */ \ - { 0x000B, ZAP_TYPE(INT56U), 7, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3060) }, /* int56u */ \ - { 0x000C, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3067) }, /* int64u */ \ + { 0x0007, ZAP_TYPE(INT24U), 3, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2534) }, /* int24u */ \ + { 0x0008, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2537) }, /* int32u */ \ + { 0x0009, ZAP_TYPE(INT40U), 5, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2541) }, /* int40u */ \ + { 0x000A, ZAP_TYPE(INT48U), 6, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2546) }, /* int48u */ \ + { 0x000B, ZAP_TYPE(INT56U), 7, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2552) }, /* int56u */ \ + { 0x000C, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2559) }, /* int64u */ \ { 0x000D, ZAP_TYPE(INT8S), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int8s */ \ { 0x000E, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int16s */ \ - { 0x000F, ZAP_TYPE(INT24S), 3, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3075) }, /* int24s */ \ - { 0x0010, ZAP_TYPE(INT32S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3078) }, /* int32s */ \ - { 0x0011, ZAP_TYPE(INT40S), 5, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3082) }, /* int40s */ \ - { 0x0012, ZAP_TYPE(INT48S), 6, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3087) }, /* int48s */ \ - { 0x0013, ZAP_TYPE(INT56S), 7, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3093) }, /* int56s */ \ - { 0x0014, ZAP_TYPE(INT64S), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3100) }, /* int64s */ \ + { 0x000F, ZAP_TYPE(INT24S), 3, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2567) }, /* int24s */ \ + { 0x0010, ZAP_TYPE(INT32S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2570) }, /* int32s */ \ + { 0x0011, ZAP_TYPE(INT40S), 5, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2574) }, /* int40s */ \ + { 0x0012, ZAP_TYPE(INT48S), 6, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2579) }, /* int48s */ \ + { 0x0013, ZAP_TYPE(INT56S), 7, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2585) }, /* int56s */ \ + { 0x0014, ZAP_TYPE(INT64S), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2592) }, /* int64s */ \ { 0x0015, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* enum8 */ \ { 0x0016, ZAP_TYPE(ENUM16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* enum16 */ \ - { 0x0017, ZAP_TYPE(SINGLE), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3108) }, /* float_single */ \ - { 0x0018, ZAP_TYPE(DOUBLE), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3112) }, /* float_double */ \ + { 0x0017, ZAP_TYPE(SINGLE), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2600) }, /* float_single */ \ + { 0x0018, ZAP_TYPE(DOUBLE), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2604) }, /* float_double */ \ { 0x0019, ZAP_TYPE(OCTET_STRING), 11, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* octet_string */ \ { 0x001A, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_EMPTY_DEFAULT() }, /* list_int8u */ \ @@ -2167,8 +2102,8 @@ { 0x001E, ZAP_TYPE(CHAR_STRING), 11, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* char_string */ \ { 0x001F, ZAP_TYPE(LONG_CHAR_STRING), 1002, ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_EMPTY_DEFAULT() }, /* long_char_string */ \ - { 0x0020, ZAP_TYPE(EPOCH_US), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3120) }, /* epoch_us */ \ - { 0x0021, ZAP_TYPE(EPOCH_S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3128) }, /* epoch_s */ \ + { 0x0020, ZAP_TYPE(EPOCH_US), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2612) }, /* epoch_us */ \ + { 0x0021, ZAP_TYPE(EPOCH_S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2620) }, /* epoch_s */ \ { 0x0022, ZAP_TYPE(VENDOR_ID), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* vendor_id */ \ { 0x0023, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_EMPTY_DEFAULT() }, /* list_nullables_and_optionals_struct */ \ @@ -2183,7 +2118,7 @@ ZAP_MIN_MAX_DEFAULTS_INDEX(33) }, /* range_restricted_int16u */ \ { 0x0029, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_MIN_MAX_DEFAULTS_INDEX(34) }, /* range_restricted_int16s */ \ - { 0x002A, ZAP_TYPE(ARRAY), 1000, 0, ZAP_LONG_DEFAULTS_INDEX(3132) }, /* list_long_octet_string */ \ + { 0x002A, ZAP_TYPE(ARRAY), 1000, 0, ZAP_LONG_DEFAULTS_INDEX(2624) }, /* list_long_octet_string */ \ { 0x0030, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(MUST_USE_TIMED_WRITE), \ ZAP_EMPTY_DEFAULT() }, /* timed_write_boolean */ \ { 0x8000, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ @@ -2193,49 +2128,49 @@ { 0x8002, ZAP_TYPE(BITMAP16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_bitmap16 */ \ { 0x8003, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(4132) }, /* nullable_bitmap32 */ \ + ZAP_LONG_DEFAULTS_INDEX(3624) }, /* nullable_bitmap32 */ \ { 0x8004, ZAP_TYPE(BITMAP64), 8, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(4136) }, /* nullable_bitmap64 */ \ + ZAP_LONG_DEFAULTS_INDEX(3628) }, /* nullable_bitmap64 */ \ { 0x8005, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_int8u */ \ { 0x8006, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_int16u */ \ { 0x8007, ZAP_TYPE(INT24U), 3, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(4144) }, /* nullable_int24u */ \ + ZAP_LONG_DEFAULTS_INDEX(3636) }, /* nullable_int24u */ \ { 0x8008, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(4147) }, /* nullable_int32u */ \ + ZAP_LONG_DEFAULTS_INDEX(3639) }, /* nullable_int32u */ \ { 0x8009, ZAP_TYPE(INT40U), 5, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(4151) }, /* nullable_int40u */ \ + ZAP_LONG_DEFAULTS_INDEX(3643) }, /* nullable_int40u */ \ { 0x800A, ZAP_TYPE(INT48U), 6, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(4156) }, /* nullable_int48u */ \ + ZAP_LONG_DEFAULTS_INDEX(3648) }, /* nullable_int48u */ \ { 0x800B, ZAP_TYPE(INT56U), 7, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(4162) }, /* nullable_int56u */ \ + ZAP_LONG_DEFAULTS_INDEX(3654) }, /* nullable_int56u */ \ { 0x800C, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(4169) }, /* nullable_int64u */ \ + ZAP_LONG_DEFAULTS_INDEX(3661) }, /* nullable_int64u */ \ { 0x800D, ZAP_TYPE(INT8S), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_int8s */ \ { 0x800E, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_int16s */ \ { 0x800F, ZAP_TYPE(INT24S), 3, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(4177) }, /* nullable_int24s */ \ + ZAP_LONG_DEFAULTS_INDEX(3669) }, /* nullable_int24s */ \ { 0x8010, ZAP_TYPE(INT32S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(4180) }, /* nullable_int32s */ \ + ZAP_LONG_DEFAULTS_INDEX(3672) }, /* nullable_int32s */ \ { 0x8011, ZAP_TYPE(INT40S), 5, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(4184) }, /* nullable_int40s */ \ + ZAP_LONG_DEFAULTS_INDEX(3676) }, /* nullable_int40s */ \ { 0x8012, ZAP_TYPE(INT48S), 6, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(4189) }, /* nullable_int48s */ \ + ZAP_LONG_DEFAULTS_INDEX(3681) }, /* nullable_int48s */ \ { 0x8013, ZAP_TYPE(INT56S), 7, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(4195) }, /* nullable_int56s */ \ + ZAP_LONG_DEFAULTS_INDEX(3687) }, /* nullable_int56s */ \ { 0x8014, ZAP_TYPE(INT64S), 8, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(4202) }, /* nullable_int64s */ \ + ZAP_LONG_DEFAULTS_INDEX(3694) }, /* nullable_int64s */ \ { 0x8015, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_enum8 */ \ { 0x8016, ZAP_TYPE(ENUM16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_enum16 */ \ { 0x8017, ZAP_TYPE(SINGLE), 4, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(4210) }, /* nullable_float_single */ \ + ZAP_LONG_DEFAULTS_INDEX(3702) }, /* nullable_float_single */ \ { 0x8018, ZAP_TYPE(DOUBLE), 8, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(4214) }, /* nullable_float_double */ \ + ZAP_LONG_DEFAULTS_INDEX(3706) }, /* nullable_float_double */ \ { 0x8019, ZAP_TYPE(OCTET_STRING), 11, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_EMPTY_DEFAULT() }, /* nullable_octet_string */ \ { 0x801E, ZAP_TYPE(CHAR_STRING), 11, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ @@ -2260,8 +2195,8 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Electrical Measurement (server) */ \ - { 0x0000, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(4222) }, /* measurement type */ \ - { 0x0304, ZAP_TYPE(INT32S), 4, 0, ZAP_LONG_DEFAULTS_INDEX(4226) }, /* total active power */ \ + { 0x0000, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(3714) }, /* measurement type */ \ + { 0x0304, ZAP_TYPE(INT32S), 4, 0, ZAP_LONG_DEFAULTS_INDEX(3718) }, /* total active power */ \ { 0x0505, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xffff) }, /* rms voltage */ \ { 0x0506, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* rms voltage min */ \ { 0x0507, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* rms voltage max */ \ @@ -2283,7 +2218,7 @@ { 0x4001, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* OnTime */ \ { 0x4002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* OffWaitTime */ \ { 0x4003, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* StartUpOnOff */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(4230) }, /* FeatureMap */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(3722) }, /* FeatureMap */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(4) }, /* ClusterRevision */ \ \ /* Endpoint: 2, Cluster: Descriptor (server) */ \ @@ -2420,210 +2355,210 @@ 0x003E, ZAP_ATTRIBUTE_INDEX(166), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { \ - 0x003F, ZAP_ATTRIBUTE_INDEX(172), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x003F, ZAP_ATTRIBUTE_INDEX(172), 5, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Group Key Management (server) */ \ { \ - 0x0040, ZAP_ATTRIBUTE_INDEX(175), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0040, ZAP_ATTRIBUTE_INDEX(177), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Fixed Label (server) */ \ { \ - 0x0041, ZAP_ATTRIBUTE_INDEX(177), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0041, ZAP_ATTRIBUTE_INDEX(179), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: User Label (server) */ \ { \ - 0x0405, ZAP_ATTRIBUTE_INDEX(179), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0405, ZAP_ATTRIBUTE_INDEX(181), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Relative Humidity Measurement (server) */ \ { 0x0003, \ - ZAP_ATTRIBUTE_INDEX(183), \ + ZAP_ATTRIBUTE_INDEX(185), \ 3, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ chipFuncArrayIdentifyServer }, /* Endpoint: 1, Cluster: Identify (server) */ \ { 0x0004, \ - ZAP_ATTRIBUTE_INDEX(186), \ + ZAP_ATTRIBUTE_INDEX(188), \ 2, \ 3, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayGroupsServer }, /* Endpoint: 1, Cluster: Groups (server) */ \ { 0x0005, \ - ZAP_ATTRIBUTE_INDEX(188), \ + ZAP_ATTRIBUTE_INDEX(190), \ 6, \ 8, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayScenesServer }, /* Endpoint: 1, Cluster: Scenes (server) */ \ { 0x0006, \ - ZAP_ATTRIBUTE_INDEX(194), \ + ZAP_ATTRIBUTE_INDEX(196), \ 7, \ 13, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOnOffServer }, /* Endpoint: 1, Cluster: On/Off (server) */ \ { \ - 0x0007, ZAP_ATTRIBUTE_INDEX(201), 3, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0007, ZAP_ATTRIBUTE_INDEX(203), 3, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: On/off Switch Configuration (server) */ \ { 0x0008, \ - ZAP_ATTRIBUTE_INDEX(204), \ + ZAP_ATTRIBUTE_INDEX(206), \ 15, \ 23, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayLevelControlServer }, /* Endpoint: 1, Cluster: Level Control (server) */ \ { \ - 0x000F, ZAP_ATTRIBUTE_INDEX(219), 4, 5, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x000F, ZAP_ATTRIBUTE_INDEX(221), 4, 5, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Binary Input (Basic) (server) */ \ { \ - 0x001D, ZAP_ATTRIBUTE_INDEX(223), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x001D, ZAP_ATTRIBUTE_INDEX(225), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Descriptor (server) */ \ { \ - 0x001E, ZAP_ATTRIBUTE_INDEX(228), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x001E, ZAP_ATTRIBUTE_INDEX(230), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Binding (server) */ \ { \ - 0x0025, ZAP_ATTRIBUTE_INDEX(229), 4, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0025, ZAP_ATTRIBUTE_INDEX(231), 4, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Bridged Actions (server) */ \ { \ - 0x002F, ZAP_ATTRIBUTE_INDEX(233), 11, 88, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x002F, ZAP_ATTRIBUTE_INDEX(235), 11, 88, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Power Source (server) */ \ { \ - 0x0039, ZAP_ATTRIBUTE_INDEX(244), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0039, ZAP_ATTRIBUTE_INDEX(246), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Bridged Device Basic (server) */ \ { \ - 0x003B, ZAP_ATTRIBUTE_INDEX(245), 5, 9, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x003B, ZAP_ATTRIBUTE_INDEX(247), 5, 9, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Switch (server) */ \ { \ - 0x0040, ZAP_ATTRIBUTE_INDEX(250), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0040, ZAP_ATTRIBUTE_INDEX(252), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Fixed Label (server) */ \ { \ - 0x0041, ZAP_ATTRIBUTE_INDEX(252), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0041, ZAP_ATTRIBUTE_INDEX(254), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: User Label (server) */ \ { \ - 0x0045, ZAP_ATTRIBUTE_INDEX(254), 2, 3, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0045, ZAP_ATTRIBUTE_INDEX(256), 2, 3, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Boolean State (server) */ \ { \ - 0x0050, ZAP_ATTRIBUTE_INDEX(256), 6, 38, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0050, ZAP_ATTRIBUTE_INDEX(258), 6, 38, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Mode Select (server) */ \ { 0x0101, \ - ZAP_ATTRIBUTE_INDEX(262), \ + ZAP_ATTRIBUTE_INDEX(264), \ 19, \ 29, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ chipFuncArrayDoorLockServer }, /* Endpoint: 1, Cluster: Door Lock (server) */ \ { \ - 0x0102, ZAP_ATTRIBUTE_INDEX(281), 20, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0102, ZAP_ATTRIBUTE_INDEX(283), 20, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Window Covering (server) */ \ { \ - 0x0103, ZAP_ATTRIBUTE_INDEX(301), 5, 7, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0103, ZAP_ATTRIBUTE_INDEX(303), 5, 7, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Barrier Control (server) */ \ { \ 0x0200, \ - ZAP_ATTRIBUTE_INDEX(306), \ + ZAP_ATTRIBUTE_INDEX(308), \ 26, \ 54, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ chipFuncArrayPumpConfigurationAndControlServer \ }, /* Endpoint: 1, Cluster: Pump Configuration and Control (server) */ \ { 0x0201, \ - ZAP_ATTRIBUTE_INDEX(332), \ + ZAP_ATTRIBUTE_INDEX(334), \ 19, \ 34, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayThermostatServer }, /* Endpoint: 1, Cluster: Thermostat (server) */ \ { \ 0x0204, \ - ZAP_ATTRIBUTE_INDEX(351), \ + ZAP_ATTRIBUTE_INDEX(353), \ 4, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ chipFuncArrayThermostatUserInterfaceConfigurationServer \ }, /* Endpoint: 1, Cluster: Thermostat User Interface Configuration (server) */ \ { 0x0300, \ - ZAP_ATTRIBUTE_INDEX(355), \ + ZAP_ATTRIBUTE_INDEX(357), \ 53, \ 341, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayColorControlServer }, /* Endpoint: 1, Cluster: Color Control (server) */ \ { \ - 0x0400, ZAP_ATTRIBUTE_INDEX(408), 6, 11, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0400, ZAP_ATTRIBUTE_INDEX(410), 6, 11, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Illuminance Measurement (server) */ \ { \ - 0x0402, ZAP_ATTRIBUTE_INDEX(414), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0402, ZAP_ATTRIBUTE_INDEX(416), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ { \ - 0x0403, ZAP_ATTRIBUTE_INDEX(419), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0403, ZAP_ATTRIBUTE_INDEX(421), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Pressure Measurement (server) */ \ { \ - 0x0404, ZAP_ATTRIBUTE_INDEX(423), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0404, ZAP_ATTRIBUTE_INDEX(425), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Flow Measurement (server) */ \ { \ - 0x0405, ZAP_ATTRIBUTE_INDEX(428), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0405, ZAP_ATTRIBUTE_INDEX(430), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Relative Humidity Measurement (server) */ \ { 0x0406, \ - ZAP_ATTRIBUTE_INDEX(433), \ + ZAP_ATTRIBUTE_INDEX(435), \ 4, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOccupancySensingServer }, /* Endpoint: 1, Cluster: Occupancy Sensing (server) */ \ { 0x0500, \ - ZAP_ATTRIBUTE_INDEX(437), \ + ZAP_ATTRIBUTE_INDEX(439), \ 6, \ 16, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION) | \ ZAP_CLUSTER_MASK(MESSAGE_SENT_FUNCTION), \ chipFuncArrayIasZoneServer }, /* Endpoint: 1, Cluster: IAS Zone (server) */ \ { \ - 0x0503, ZAP_ATTRIBUTE_INDEX(443), 2, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0503, ZAP_ATTRIBUTE_INDEX(445), 2, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ { \ - 0x0504, ZAP_ATTRIBUTE_INDEX(445), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0504, ZAP_ATTRIBUTE_INDEX(447), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Channel (server) */ \ { \ - 0x0505, ZAP_ATTRIBUTE_INDEX(447), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0505, ZAP_ATTRIBUTE_INDEX(449), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Target Navigator (server) */ \ { \ - 0x0506, ZAP_ATTRIBUTE_INDEX(450), 7, 39, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0506, ZAP_ATTRIBUTE_INDEX(452), 7, 39, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Media Playback (server) */ \ { \ - 0x0507, ZAP_ATTRIBUTE_INDEX(457), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0507, ZAP_ATTRIBUTE_INDEX(459), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Media Input (server) */ \ { \ - 0x0508, ZAP_ATTRIBUTE_INDEX(460), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0508, ZAP_ATTRIBUTE_INDEX(462), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Low Power (server) */ \ { \ - 0x0509, ZAP_ATTRIBUTE_INDEX(461), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0509, ZAP_ATTRIBUTE_INDEX(463), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Keypad Input (server) */ \ { \ - 0x050A, ZAP_ATTRIBUTE_INDEX(462), 3, 260, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050A, ZAP_ATTRIBUTE_INDEX(464), 3, 260, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Content Launcher (server) */ \ { \ - 0x050B, ZAP_ATTRIBUTE_INDEX(465), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050B, ZAP_ATTRIBUTE_INDEX(467), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Audio Output (server) */ \ { \ - 0x050C, ZAP_ATTRIBUTE_INDEX(468), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050C, ZAP_ATTRIBUTE_INDEX(470), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Application Launcher (server) */ \ { \ - 0x050D, ZAP_ATTRIBUTE_INDEX(470), 7, 106, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050D, ZAP_ATTRIBUTE_INDEX(472), 7, 106, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Application Basic (server) */ \ { \ - 0x050E, ZAP_ATTRIBUTE_INDEX(477), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050E, ZAP_ATTRIBUTE_INDEX(479), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Account Login (server) */ \ { \ - 0x050F, ZAP_ATTRIBUTE_INDEX(478), 78, 3285, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050F, ZAP_ATTRIBUTE_INDEX(480), 78, 3285, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Test Cluster (server) */ \ { \ - 0x0B04, ZAP_ATTRIBUTE_INDEX(556), 12, 28, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0B04, ZAP_ATTRIBUTE_INDEX(558), 12, 28, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Electrical Measurement (server) */ \ { 0x0004, \ - ZAP_ATTRIBUTE_INDEX(568), \ + ZAP_ATTRIBUTE_INDEX(570), \ 2, \ 3, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayGroupsServer }, /* Endpoint: 2, Cluster: Groups (server) */ \ { 0x0006, \ - ZAP_ATTRIBUTE_INDEX(570), \ + ZAP_ATTRIBUTE_INDEX(572), \ 7, \ 13, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOnOffServer }, /* Endpoint: 2, Cluster: On/Off (server) */ \ { \ - 0x001D, ZAP_ATTRIBUTE_INDEX(577), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x001D, ZAP_ATTRIBUTE_INDEX(579), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 2, Cluster: Descriptor (server) */ \ { 0x0406, \ - ZAP_ATTRIBUTE_INDEX(582), \ + ZAP_ATTRIBUTE_INDEX(584), \ 4, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -2635,7 +2570,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 23, 1988 }, { ZAP_CLUSTER_INDEX(23), 45, 6078 }, { ZAP_CLUSTER_INDEX(68), 4, 21 }, \ + { ZAP_CLUSTER_INDEX(0), 23, 1480 }, { ZAP_CLUSTER_INDEX(23), 45, 6078 }, { ZAP_CLUSTER_INDEX(68), 4, 21 }, \ } // Largest attribute size is needed for various buffers @@ -2645,7 +2580,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (689) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (8087) +#define ATTRIBUTE_MAX_SIZE (7579) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (3) diff --git a/zzz_generated/app-common/app-common/zap-generated/af-structs.h b/zzz_generated/app-common/app-common/zap-generated/af-structs.h index 9a53c416ff8cff..e9b5a4b45140aa 100644 --- a/zzz_generated/app-common/app-common/zap-generated/af-structs.h +++ b/zzz_generated/app-common/app-common/zap-generated/af-structs.h @@ -264,23 +264,35 @@ typedef struct _FabricDescriptor chip::CharSpan Label; } FabricDescriptor; +// Struct for GroupInfo +typedef struct _GroupInfo +{ + uint16_t fabricIndex; + uint16_t groupId; + /* TYPE WARNING: array array defaults to */ uint8_t * endpoints; + chip::CharSpan groupName; +} GroupInfo; + // Struct for GroupKey typedef struct _GroupKey { - uint16_t VendorId; - uint16_t GroupKeyIndex; - chip::ByteSpan GroupKeyRoot; - uint64_t GroupKeyEpochStartTime; - uint8_t GroupKeySecurityPolicy; + uint16_t fabricIndex; + uint16_t groupId; + uint16_t groupKeySetID; } GroupKey; -// Struct for GroupState -typedef struct _GroupState -{ - uint16_t VendorId; - uint16_t VendorGroupId; - uint16_t GroupKeySetIndex; -} GroupState; +// Struct for GroupKeySet +typedef struct _GroupKeySet +{ + uint16_t groupKeySetID; + uint8_t securityPolicy; + chip::ByteSpan epochKey0; + uint64_t epochStartTime0; + chip::ByteSpan epochKey1; + uint64_t epochStartTime1; + chip::ByteSpan epochKey2; + uint64_t epochStartTime2; +} GroupKeySet; // Struct for IasAceZoneStatusResult typedef struct _IasAceZoneStatusResult diff --git a/zzz_generated/app-common/app-common/zap-generated/attribute-id.h b/zzz_generated/app-common/app-common/zap-generated/attribute-id.h index 54185ded04fe9e..f7527dc3b39c80 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attribute-id.h +++ b/zzz_generated/app-common/app-common/zap-generated/attribute-id.h @@ -600,8 +600,10 @@ // Client attributes // Server attributes -#define ZCL_GROUPS_ATTRIBUTE_ID (0x0000) -#define ZCL_GROUPKEYS_ATTRIBUTE_ID (0x0001) +#define ZCL_GROUP_KEY_MAP_ATTRIBUTE_ID (0x0000) +#define ZCL_GROUP_TABLE_ATTRIBUTE_ID (0x0001) +#define ZCL_MAX_GROUPS_PER_FABRIC_ATTRIBUTE_ID (0x0002) +#define ZCL_MAX_GROUP_KEYS_PER_FABRIC_ATTRIBUTE_ID (0x0003) // Attribute ids for cluster: Fixed Label diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp index e4659fa3262346..b236f6c20361f2 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp @@ -11547,6 +11547,64 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) namespace GroupKeyManagement { namespace Attributes { +namespace MaxGroupsPerFabric { + +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) +{ + NumericAttributeTraits::StorageType temp; + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::GroupKeyManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = NumericAttributeTraits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) +{ + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::GroupKeyManagement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace MaxGroupsPerFabric + +namespace MaxGroupKeysPerFabric { + +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) +{ + NumericAttributeTraits::StorageType temp; + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::GroupKeyManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = NumericAttributeTraits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) +{ + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::GroupKeyManagement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace MaxGroupKeysPerFabric + namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index 9484af5ea246b7..7689238c2b271c 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h @@ -2193,6 +2193,16 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); namespace GroupKeyManagement { namespace Attributes { +namespace MaxGroupsPerFabric { +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); +} // namespace MaxGroupsPerFabric + +namespace MaxGroupKeysPerFabric { +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); +} // namespace MaxGroupKeysPerFabric + namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // bitmap32 EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h index a4609fd3a5ef19..5f3edc834bb15f 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -14124,6 +14124,42 @@ bool emberAfOperationalCredentialsClusterAddTrustedRootCertificateCallback( bool emberAfOperationalCredentialsClusterRemoveTrustedRootCertificateCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::OperationalCredentials::Commands::RemoveTrustedRootCertificate::DecodableType & commandData); +/** + * @brief Group Key Management Cluster KeySetWrite Command callback (from client) + */ +bool emberAfGroupKeyManagementClusterKeySetWriteCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::DecodableType & commandData); +/** + * @brief Group Key Management Cluster KeySetRead Command callback (from client) + */ +bool emberAfGroupKeyManagementClusterKeySetReadCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::GroupKeyManagement::Commands::KeySetRead::DecodableType & commandData); +/** + * @brief Group Key Management Cluster KeySetReadResponse Command callback (from server) + */ +bool emberAfGroupKeyManagementClusterKeySetReadResponseCallback( + chip::EndpointId endpoint, chip::app::CommandSender * commandObj, + chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySet::DecodableType groupKeySet); +/** + * @brief Group Key Management Cluster KeySetRemove Command callback (from client) + */ +bool emberAfGroupKeyManagementClusterKeySetRemoveCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::GroupKeyManagement::Commands::KeySetRemove::DecodableType & commandData); +/** + * @brief Group Key Management Cluster KeySetReadAllIndices Command callback (from client) + */ +bool emberAfGroupKeyManagementClusterKeySetReadAllIndicesCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndices::DecodableType & commandData); +/** + * @brief Group Key Management Cluster KeySetReadAllIndicesResponse Command callback (from server) + */ +bool emberAfGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback( + chip::EndpointId endpoint, chip::app::CommandSender * commandObj, + /* TYPE WARNING: array array defaults to */ uint8_t * groupKeySetIDs); /** * @brief Mode Select Cluster ChangeToMode Command callback (from client) */ 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 273a248180a573..884c2de49e2ad0 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 @@ -10160,18 +10160,15 @@ namespace Events { } // namespace OperationalCredentials namespace GroupKeyManagement { namespace Structs { -namespace GroupKey { +namespace GroupInfo { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kVendorId)), vendorId)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupKeyIndex)), groupKeyIndex)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupKeyRoot)), groupKeyRoot)); - ReturnErrorOnFailure( - DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupKeyEpochStartTime)), groupKeyEpochStartTime)); - ReturnErrorOnFailure( - DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupKeySecurityPolicy)), groupKeySecurityPolicy)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kFabricIndex)), fabricIndex)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupId)), groupId)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kEndpoints)), endpoints)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupName)), groupName)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -10188,20 +10185,61 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kVendorId): - ReturnErrorOnFailure(DataModel::Decode(reader, vendorId)); + case to_underlying(Fields::kFabricIndex): + ReturnErrorOnFailure(DataModel::Decode(reader, fabricIndex)); break; - case to_underlying(Fields::kGroupKeyIndex): - ReturnErrorOnFailure(DataModel::Decode(reader, groupKeyIndex)); + case to_underlying(Fields::kGroupId): + ReturnErrorOnFailure(DataModel::Decode(reader, groupId)); break; - case to_underlying(Fields::kGroupKeyRoot): - ReturnErrorOnFailure(DataModel::Decode(reader, groupKeyRoot)); + case to_underlying(Fields::kEndpoints): + ReturnErrorOnFailure(DataModel::Decode(reader, endpoints)); break; - case to_underlying(Fields::kGroupKeyEpochStartTime): - ReturnErrorOnFailure(DataModel::Decode(reader, groupKeyEpochStartTime)); + case to_underlying(Fields::kGroupName): + ReturnErrorOnFailure(DataModel::Decode(reader, groupName)); break; - case to_underlying(Fields::kGroupKeySecurityPolicy): - ReturnErrorOnFailure(DataModel::Decode(reader, groupKeySecurityPolicy)); + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} + +} // namespace GroupInfo +namespace GroupKey { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kFabricIndex)), fabricIndex)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupId)), groupId)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupKeySetID)), groupKeySetID)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + err = reader.EnterContainer(outer); + ReturnErrorOnFailure(err); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kFabricIndex): + ReturnErrorOnFailure(DataModel::Decode(reader, fabricIndex)); + break; + case to_underlying(Fields::kGroupId): + ReturnErrorOnFailure(DataModel::Decode(reader, groupId)); + break; + case to_underlying(Fields::kGroupKeySetID): + ReturnErrorOnFailure(DataModel::Decode(reader, groupKeySetID)); break; default: break; @@ -10214,14 +10252,19 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } } // namespace GroupKey -namespace GroupState { +namespace GroupKeySet { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kVendorId)), vendorId)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kVendorGroupId)), vendorGroupId)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupKeySetIndex)), groupKeySetIndex)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupKeySetID)), groupKeySetID)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSecurityPolicy)), securityPolicy)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kEpochKey0)), epochKey0)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kEpochStartTime0)), epochStartTime0)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kEpochKey1)), epochKey1)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kEpochStartTime1)), epochStartTime1)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kEpochKey2)), epochKey2)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kEpochStartTime2)), epochStartTime2)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -10238,14 +10281,29 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kVendorId): - ReturnErrorOnFailure(DataModel::Decode(reader, vendorId)); + case to_underlying(Fields::kGroupKeySetID): + ReturnErrorOnFailure(DataModel::Decode(reader, groupKeySetID)); + break; + case to_underlying(Fields::kSecurityPolicy): + ReturnErrorOnFailure(DataModel::Decode(reader, securityPolicy)); break; - case to_underlying(Fields::kVendorGroupId): - ReturnErrorOnFailure(DataModel::Decode(reader, vendorGroupId)); + case to_underlying(Fields::kEpochKey0): + ReturnErrorOnFailure(DataModel::Decode(reader, epochKey0)); break; - case to_underlying(Fields::kGroupKeySetIndex): - ReturnErrorOnFailure(DataModel::Decode(reader, groupKeySetIndex)); + case to_underlying(Fields::kEpochStartTime0): + ReturnErrorOnFailure(DataModel::Decode(reader, epochStartTime0)); + break; + case to_underlying(Fields::kEpochKey1): + ReturnErrorOnFailure(DataModel::Decode(reader, epochKey1)); + break; + case to_underlying(Fields::kEpochStartTime1): + ReturnErrorOnFailure(DataModel::Decode(reader, epochStartTime1)); + break; + case to_underlying(Fields::kEpochKey2): + ReturnErrorOnFailure(DataModel::Decode(reader, epochKey2)); + break; + case to_underlying(Fields::kEpochStartTime2): + ReturnErrorOnFailure(DataModel::Decode(reader, epochStartTime2)); break; default: break; @@ -10257,10 +10315,214 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) return CHIP_NO_ERROR; } -} // namespace GroupState +} // namespace GroupKeySet } // namespace Structs namespace Commands { +namespace KeySetWrite { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupKeySet)), groupKeySet)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kGroupKeySet): + ReturnErrorOnFailure(DataModel::Decode(reader, groupKeySet)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace KeySetWrite. +namespace KeySetRead { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupKeySetID)), groupKeySetID)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kGroupKeySetID): + ReturnErrorOnFailure(DataModel::Decode(reader, groupKeySetID)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace KeySetRead. +namespace KeySetReadResponse { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupKeySet)), groupKeySet)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kGroupKeySet): + ReturnErrorOnFailure(DataModel::Decode(reader, groupKeySet)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace KeySetReadResponse. +namespace KeySetRemove { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupKeySetID)), groupKeySetID)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kGroupKeySetID): + ReturnErrorOnFailure(DataModel::Decode(reader, groupKeySetID)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace KeySetRemove. +namespace KeySetReadAllIndices { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupKeySetIDs)), groupKeySetIDs)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kGroupKeySetIDs): + ReturnErrorOnFailure(DataModel::Decode(reader, groupKeySetIDs)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace KeySetReadAllIndices. +namespace KeySetReadAllIndicesResponse { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupKeySetIDs)), groupKeySetIDs)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kGroupKeySetIDs): + ReturnErrorOnFailure(DataModel::Decode(reader, groupKeySetIDs)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace KeySetReadAllIndicesResponse. } // namespace Commands namespace Attributes { @@ -10268,11 +10530,17 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre { switch (path.mAttributeId) { - case Attributes::Groups::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, groups)); + case Attributes::GroupKeyMap::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, groupKeyMap)); + break; + case Attributes::GroupTable::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, groupTable)); + break; + case Attributes::MaxGroupsPerFabric::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, maxGroupsPerFabric)); break; - case Attributes::GroupKeys::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, groupKeys)); + case Attributes::MaxGroupKeysPerFabric::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, maxGroupKeysPerFabric)); break; case Attributes::AttributeList::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); 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 0fab6898fedfb5..a8a926a3afcf5a 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 @@ -14891,24 +14891,51 @@ enum class GroupKeySecurityPolicy : uint8_t }; namespace Structs { +namespace GroupInfo { +enum class Fields +{ + kFabricIndex = 0, + kGroupId = 1, + kEndpoints = 2, + kGroupName = 3, +}; + +struct Type +{ +public: + uint16_t fabricIndex; + uint16_t groupId; + DataModel::List endpoints; + chip::CharSpan groupName; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; +}; + +struct DecodableType +{ +public: + uint16_t fabricIndex; + uint16_t groupId; + DataModel::DecodableList endpoints; + chip::CharSpan groupName; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; + +} // namespace GroupInfo namespace GroupKey { enum class Fields { - kVendorId = 1, - kGroupKeyIndex = 2, - kGroupKeyRoot = 3, - kGroupKeyEpochStartTime = 4, - kGroupKeySecurityPolicy = 5, + kFabricIndex = 0, + kGroupId = 1, + kGroupKeySetID = 2, }; struct Type { public: - uint16_t vendorId; - uint16_t groupKeyIndex; - chip::ByteSpan groupKeyRoot; - uint64_t groupKeyEpochStartTime; - GroupKeySecurityPolicy groupKeySecurityPolicy; + uint16_t fabricIndex; + uint16_t groupId; + uint16_t groupKeySetID; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -14917,20 +14944,30 @@ struct Type using DecodableType = Type; } // namespace GroupKey -namespace GroupState { +namespace GroupKeySet { enum class Fields { - kVendorId = 1, - kVendorGroupId = 2, - kGroupKeySetIndex = 3, + kGroupKeySetID = 0, + kSecurityPolicy = 1, + kEpochKey0 = 2, + kEpochStartTime0 = 3, + kEpochKey1 = 4, + kEpochStartTime1 = 5, + kEpochKey2 = 6, + kEpochStartTime2 = 7, }; struct Type { public: - uint16_t vendorId; - uint16_t vendorGroupId; - uint16_t groupKeySetIndex; + uint16_t groupKeySetID; + GroupKeySecurityPolicy securityPolicy; + chip::ByteSpan epochKey0; + uint64_t epochStartTime0; + chip::ByteSpan epochKey1; + uint64_t epochStartTime1; + chip::ByteSpan epochKey2; + uint64_t epochStartTime2; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -14938,39 +14975,293 @@ struct Type using DecodableType = Type; -} // namespace GroupState +} // namespace GroupKeySet } // namespace Structs +namespace Commands { +// Forward-declarations so we can reference these later. + +namespace KeySetWrite { +struct Type; +struct DecodableType; +} // namespace KeySetWrite + +namespace KeySetRead { +struct Type; +struct DecodableType; +} // namespace KeySetRead + +namespace KeySetReadResponse { +struct Type; +struct DecodableType; +} // namespace KeySetReadResponse + +namespace KeySetRemove { +struct Type; +struct DecodableType; +} // namespace KeySetRemove + +namespace KeySetReadAllIndices { +struct Type; +struct DecodableType; +} // namespace KeySetReadAllIndices + +namespace KeySetReadAllIndicesResponse { +struct Type; +struct DecodableType; +} // namespace KeySetReadAllIndicesResponse + +} // namespace Commands + +namespace Commands { +namespace KeySetWrite { +enum class Fields +{ + kGroupKeySet = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::KeySetWrite::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::GroupKeyManagement::Id; } + + Structs::GroupKeySet::Type groupKeySet; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::KeySetWrite::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::GroupKeyManagement::Id; } + + Structs::GroupKeySet::DecodableType groupKeySet; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace KeySetWrite +namespace KeySetRead { +enum class Fields +{ + kGroupKeySetID = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::KeySetRead::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::GroupKeyManagement::Id; } + + uint16_t groupKeySetID; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + + using ResponseType = Clusters::GroupKeyManagement::Commands::KeySetReadResponse::DecodableType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::KeySetRead::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::GroupKeyManagement::Id; } + + uint16_t groupKeySetID; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace KeySetRead +namespace KeySetReadResponse { +enum class Fields +{ + kGroupKeySet = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::KeySetReadResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::GroupKeyManagement::Id; } + + Structs::GroupKeySet::Type groupKeySet; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::KeySetReadResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::GroupKeyManagement::Id; } + + Structs::GroupKeySet::DecodableType groupKeySet; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace KeySetReadResponse +namespace KeySetRemove { +enum class Fields +{ + kGroupKeySetID = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::KeySetRemove::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::GroupKeyManagement::Id; } + + uint16_t groupKeySetID; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::KeySetRemove::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::GroupKeyManagement::Id; } + + uint16_t groupKeySetID; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace KeySetRemove +namespace KeySetReadAllIndices { +enum class Fields +{ + kGroupKeySetIDs = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::KeySetReadAllIndices::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::GroupKeyManagement::Id; } + + DataModel::List groupKeySetIDs; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + + using ResponseType = Clusters::GroupKeyManagement::Commands::KeySetReadAllIndicesResponse::DecodableType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::KeySetReadAllIndices::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::GroupKeyManagement::Id; } + + DataModel::DecodableList groupKeySetIDs; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace KeySetReadAllIndices +namespace KeySetReadAllIndicesResponse { +enum class Fields +{ + kGroupKeySetIDs = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::KeySetReadAllIndicesResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::GroupKeyManagement::Id; } + + DataModel::List groupKeySetIDs; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::KeySetReadAllIndicesResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::GroupKeyManagement::Id; } + + DataModel::DecodableList groupKeySetIDs; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace KeySetReadAllIndicesResponse +} // namespace Commands + namespace Attributes { -namespace Groups { +namespace GroupKeyMap { struct TypeInfo { - using Type = chip::app::DataModel::List; + using Type = chip::app::DataModel::List; using DecodableType = - chip::app::DataModel::DecodableList; + chip::app::DataModel::DecodableList; using DecodableArgType = - const chip::app::DataModel::DecodableList &; + const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::GroupKeyManagement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::Groups::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::GroupKeyMap::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; -} // namespace Groups -namespace GroupKeys { +} // namespace GroupKeyMap +namespace GroupTable { struct TypeInfo { - using Type = chip::app::DataModel::List; + using Type = chip::app::DataModel::List; using DecodableType = - chip::app::DataModel::DecodableList; + chip::app::DataModel::DecodableList; using DecodableArgType = - const chip::app::DataModel::DecodableList &; + const chip::app::DataModel::DecodableList &; + + static constexpr ClusterId GetClusterId() { return Clusters::GroupKeyManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::GroupTable::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace GroupTable +namespace MaxGroupsPerFabric { +struct TypeInfo +{ + using Type = uint16_t; + using DecodableType = uint16_t; + using DecodableArgType = uint16_t; + + static constexpr ClusterId GetClusterId() { return Clusters::GroupKeyManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::MaxGroupsPerFabric::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace MaxGroupsPerFabric +namespace MaxGroupKeysPerFabric { +struct TypeInfo +{ + using Type = uint16_t; + using DecodableType = uint16_t; + using DecodableArgType = uint16_t; static constexpr ClusterId GetClusterId() { return Clusters::GroupKeyManagement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::GroupKeys::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::MaxGroupKeysPerFabric::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; -} // namespace GroupKeys +} // namespace MaxGroupKeysPerFabric namespace AttributeList { struct TypeInfo { @@ -15016,8 +15307,10 @@ struct TypeInfo CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); - Attributes::Groups::TypeInfo::DecodableType groups; - Attributes::GroupKeys::TypeInfo::DecodableType groupKeys; + Attributes::GroupKeyMap::TypeInfo::DecodableType groupKeyMap; + Attributes::GroupTable::TypeInfo::DecodableType groupTable; + Attributes::MaxGroupsPerFabric::TypeInfo::DecodableType maxGroupsPerFabric; + Attributes::MaxGroupKeysPerFabric::TypeInfo::DecodableType maxGroupKeysPerFabric; Attributes::AttributeList::TypeInfo::DecodableType attributeList; Attributes::FeatureMap::TypeInfo::DecodableType featureMap; Attributes::ClusterRevision::TypeInfo::DecodableType clusterRevision; diff --git a/zzz_generated/app-common/app-common/zap-generated/command-id.h b/zzz_generated/app-common/app-common/zap-generated/command-id.h index f401dffe72c0a6..5d7519e1d2e79c 100644 --- a/zzz_generated/app-common/app-common/zap-generated/command-id.h +++ b/zzz_generated/app-common/app-common/zap-generated/command-id.h @@ -229,6 +229,14 @@ #define ZCL_ADD_TRUSTED_ROOT_CERTIFICATE_COMMAND_ID (0x0B) #define ZCL_REMOVE_TRUSTED_ROOT_CERTIFICATE_COMMAND_ID (0x0C) +// Commands for cluster: Group Key Management +#define ZCL_KEY_SET_WRITE_COMMAND_ID (0x00) +#define ZCL_KEY_SET_READ_COMMAND_ID (0x01) +#define ZCL_KEY_SET_READ_RESPONSE_COMMAND_ID (0x02) +#define ZCL_KEY_SET_REMOVE_COMMAND_ID (0x03) +#define ZCL_KEY_SET_READ_ALL_INDICES_COMMAND_ID (0x04) +#define ZCL_KEY_SET_READ_ALL_INDICES_RESPONSE_COMMAND_ID (0x05) + // Commands for cluster: Mode Select #define ZCL_CHANGE_TO_MODE_COMMAND_ID (0x00) diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h index 2c38c9934cd108..83aed2424fd91a 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h @@ -2078,13 +2078,21 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; namespace GroupKeyManagement { namespace Attributes { -namespace Groups { +namespace GroupKeyMap { static constexpr AttributeId Id = 0x00000000; -} // namespace Groups +} // namespace GroupKeyMap -namespace GroupKeys { +namespace GroupTable { static constexpr AttributeId Id = 0x00000001; -} // namespace GroupKeys +} // namespace GroupTable + +namespace MaxGroupsPerFabric { +static constexpr AttributeId Id = 0x00000002; +} // namespace MaxGroupsPerFabric + +namespace MaxGroupKeysPerFabric { +static constexpr AttributeId Id = 0x00000003; +} // namespace MaxGroupKeysPerFabric namespace AttributeList { static constexpr AttributeId Id = Globals::Attributes::AttributeList::Id; diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h index 857f9a96d14c7a..14e1f0956cdb20 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h @@ -767,6 +767,36 @@ static constexpr CommandId Id = 0x0000000C; } // namespace Commands } // namespace OperationalCredentials +namespace GroupKeyManagement { +namespace Commands { + +namespace KeySetWrite { +static constexpr CommandId Id = 0x00000000; +} // namespace KeySetWrite + +namespace KeySetRead { +static constexpr CommandId Id = 0x00000001; +} // namespace KeySetRead + +namespace KeySetReadResponse { +static constexpr CommandId Id = 0x00000002; +} // namespace KeySetReadResponse + +namespace KeySetRemove { +static constexpr CommandId Id = 0x00000003; +} // namespace KeySetRemove + +namespace KeySetReadAllIndices { +static constexpr CommandId Id = 0x00000004; +} // namespace KeySetReadAllIndices + +namespace KeySetReadAllIndicesResponse { +static constexpr CommandId Id = 0x00000005; +} // namespace KeySetReadAllIndicesResponse + +} // namespace Commands +} // namespace GroupKeyManagement + namespace ModeSelect { namespace Commands { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index fae76a6d3c0d48..65d27f9fd1e237 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -86,10 +86,12 @@ CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType & value); CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::OperationalCredentials::Structs::NOCStruct::DecodableType & value); +CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::GroupKeyManagement::Structs::GroupInfo::DecodableType & value); CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::GroupKeyManagement::Structs::GroupKey::DecodableType & value); CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::GroupKeyManagement::Structs::GroupState::DecodableType & value); + const chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySet::DecodableType & value); CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::FixedLabel::Structs::LabelStruct::DecodableType & value); CHIP_ERROR LogValue(const char * label, size_t indent, @@ -1370,48 +1372,69 @@ CHIP_ERROR LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::GroupKeyManagement::Structs::GroupKey::DecodableType & value) + const chip::app::Clusters::GroupKeyManagement::Structs::GroupInfo::DecodableType & value) { ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); { - CHIP_ERROR err = LogValue("VendorId", indent + 1, value.vendorId); + CHIP_ERROR err = LogValue("FabricIndex", indent + 1, value.fabricIndex); if (err != CHIP_NO_ERROR) { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'VendorId'", IndentStr(indent + 1).c_str()); + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'FabricIndex'", IndentStr(indent + 1).c_str()); return err; } } { - CHIP_ERROR err = LogValue("GroupKeyIndex", indent + 1, value.groupKeyIndex); + CHIP_ERROR err = LogValue("GroupId", indent + 1, value.groupId); if (err != CHIP_NO_ERROR) { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'GroupKeyIndex'", IndentStr(indent + 1).c_str()); + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'GroupId'", IndentStr(indent + 1).c_str()); return err; } } { - CHIP_ERROR err = LogValue("GroupKeyRoot", indent + 1, value.groupKeyRoot); + CHIP_ERROR err = LogValue("Endpoints", indent + 1, value.endpoints); if (err != CHIP_NO_ERROR) { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'GroupKeyRoot'", IndentStr(indent + 1).c_str()); + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Endpoints'", IndentStr(indent + 1).c_str()); return err; } } { - CHIP_ERROR err = LogValue("GroupKeyEpochStartTime", indent + 1, value.groupKeyEpochStartTime); + CHIP_ERROR err = LogValue("GroupName", indent + 1, value.groupName); if (err != CHIP_NO_ERROR) { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'GroupKeyEpochStartTime'", - IndentStr(indent + 1).c_str()); + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'GroupName'", IndentStr(indent + 1).c_str()); + return err; + } + } + ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); + return CHIP_NO_ERROR; +} +CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::GroupKeyManagement::Structs::GroupKey::DecodableType & value) +{ + ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); + { + CHIP_ERROR err = LogValue("FabricIndex", indent + 1, value.fabricIndex); + if (err != CHIP_NO_ERROR) + { + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'FabricIndex'", IndentStr(indent + 1).c_str()); return err; } } { - CHIP_ERROR err = LogValue("GroupKeySecurityPolicy", indent + 1, value.groupKeySecurityPolicy); + CHIP_ERROR err = LogValue("GroupId", indent + 1, value.groupId); if (err != CHIP_NO_ERROR) { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'GroupKeySecurityPolicy'", - IndentStr(indent + 1).c_str()); + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'GroupId'", IndentStr(indent + 1).c_str()); + return err; + } + } + { + CHIP_ERROR err = LogValue("GroupKeySetID", indent + 1, value.groupKeySetID); + if (err != CHIP_NO_ERROR) + { + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'GroupKeySetID'", IndentStr(indent + 1).c_str()); return err; } } @@ -1419,30 +1442,73 @@ CHIP_ERROR LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::GroupKeyManagement::Structs::GroupState::DecodableType & value) + const chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySet::DecodableType & value) { ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); { - CHIP_ERROR err = LogValue("VendorId", indent + 1, value.vendorId); + CHIP_ERROR err = LogValue("GroupKeySetID", indent + 1, value.groupKeySetID); if (err != CHIP_NO_ERROR) { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'VendorId'", IndentStr(indent + 1).c_str()); + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'GroupKeySetID'", IndentStr(indent + 1).c_str()); + return err; + } + } + { + CHIP_ERROR err = LogValue("SecurityPolicy", indent + 1, value.securityPolicy); + if (err != CHIP_NO_ERROR) + { + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'SecurityPolicy'", + IndentStr(indent + 1).c_str()); return err; } } { - CHIP_ERROR err = LogValue("VendorGroupId", indent + 1, value.vendorGroupId); + CHIP_ERROR err = LogValue("EpochKey0", indent + 1, value.epochKey0); if (err != CHIP_NO_ERROR) { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'VendorGroupId'", IndentStr(indent + 1).c_str()); + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'EpochKey0'", IndentStr(indent + 1).c_str()); return err; } } { - CHIP_ERROR err = LogValue("GroupKeySetIndex", indent + 1, value.groupKeySetIndex); + CHIP_ERROR err = LogValue("EpochStartTime0", indent + 1, value.epochStartTime0); if (err != CHIP_NO_ERROR) { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'GroupKeySetIndex'", + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'EpochStartTime0'", + IndentStr(indent + 1).c_str()); + return err; + } + } + { + CHIP_ERROR err = LogValue("EpochKey1", indent + 1, value.epochKey1); + if (err != CHIP_NO_ERROR) + { + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'EpochKey1'", IndentStr(indent + 1).c_str()); + return err; + } + } + { + CHIP_ERROR err = LogValue("EpochStartTime1", indent + 1, value.epochStartTime1); + if (err != CHIP_NO_ERROR) + { + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'EpochStartTime1'", + IndentStr(indent + 1).c_str()); + return err; + } + } + { + CHIP_ERROR err = LogValue("EpochKey2", indent + 1, value.epochKey2); + if (err != CHIP_NO_ERROR) + { + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'EpochKey2'", IndentStr(indent + 1).c_str()); + return err; + } + } + { + CHIP_ERROR err = LogValue("EpochStartTime2", indent + 1, value.epochStartTime2); + if (err != CHIP_NO_ERROR) + { + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'EpochStartTime2'", IndentStr(indent + 1).c_str()); return err; } @@ -2697,6 +2763,34 @@ static void OnGeneralCommissioningSetRegulatoryConfigResponseSuccess( command->SetCommandExitStatus(err); }; +static void OnGroupKeyManagementKeySetReadAllIndicesResponseSuccess( + void * context, const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndicesResponse::DecodableType & data) +{ + ChipLogProgress(Zcl, "Received KeySetReadAllIndicesResponse:"); + CHIP_ERROR err = CHIP_NO_ERROR; + if (err == CHIP_NO_ERROR) + { + err = LogValue("groupKeySetIDs", 1, data.groupKeySetIDs); + } + + ModelCommand * command = static_cast(context); + command->SetCommandExitStatus(err); +}; + +static void OnGroupKeyManagementKeySetReadResponseSuccess( + void * context, const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadResponse::DecodableType & data) +{ + ChipLogProgress(Zcl, "Received KeySetReadResponse:"); + CHIP_ERROR err = CHIP_NO_ERROR; + if (err == CHIP_NO_ERROR) + { + err = LogValue("groupKeySet", 1, data.groupKeySet); + } + + ModelCommand * command = static_cast(context); + command->SetCommandExitStatus(err); +}; + static void OnGroupsAddGroupResponseSuccess(void * context, const chip::app::Clusters::Groups::Commands::AddGroupResponse::DecodableType & data) { @@ -19370,27 +19464,129 @@ class ReportGeneralDiagnosticsClusterRevision : public ModelCommand | Cluster GroupKeyManagement | 0x003F | |------------------------------------------------------------------------------| | Commands: | | +| * KeySetRead | 0x01 | +| * KeySetReadAllIndices | 0x04 | +| * KeySetRemove | 0x03 | +| * KeySetWrite | 0x00 | |------------------------------------------------------------------------------| | Attributes: | | -| * Groups | 0x0000 | -| * GroupKeys | 0x0001 | +| * GroupKeyMap | 0x0000 | +| * GroupTable | 0x0001 | +| * MaxGroupsPerFabric | 0x0002 | +| * MaxGroupKeysPerFabric | 0x0003 | | * AttributeList | 0xFFFB | | * ClusterRevision | 0xFFFD | \*----------------------------------------------------------------------------*/ /* - * Attribute Groups + * Command KeySetRead + */ +class GroupKeyManagementKeySetRead : public ModelCommand +{ +public: + GroupKeyManagementKeySetRead() : ModelCommand("key-set-read") + { + AddArgument("GroupKeySetID", 0, UINT16_MAX, &mRequest.groupKeySetID); + ModelCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003F) command (0x00000001) on endpoint %" PRIu8, endpointId); + + return chip::Controller::InvokeCommand(device, this, OnGroupKeyManagementKeySetReadResponseSuccess, OnDefaultFailure, + endpointId, mRequest, mTimedInteractionTimeoutMs); + } + +private: + chip::app::Clusters::GroupKeyManagement::Commands::KeySetRead::Type mRequest; +}; + +/* + * Command KeySetReadAllIndices */ -class ReadGroupKeyManagementGroups : public ModelCommand +class GroupKeyManagementKeySetReadAllIndices : public ModelCommand { public: - ReadGroupKeyManagementGroups() : ModelCommand("read") + GroupKeyManagementKeySetReadAllIndices() : ModelCommand("key-set-read-all-indices") { - AddArgument("attr-name", "groups"); + // groupKeySetIDs Array parsing is not supported yet ModelCommand::AddArguments(); } - ~ReadGroupKeyManagementGroups() {} + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003F) command (0x00000004) on endpoint %" PRIu8, endpointId); + + return chip::Controller::InvokeCommand(device, this, OnGroupKeyManagementKeySetReadAllIndicesResponseSuccess, + OnDefaultFailure, endpointId, mRequest, mTimedInteractionTimeoutMs); + } + +private: + chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndices::Type mRequest; +}; + +/* + * Command KeySetRemove + */ +class GroupKeyManagementKeySetRemove : public ModelCommand +{ +public: + GroupKeyManagementKeySetRemove() : ModelCommand("key-set-remove") + { + AddArgument("GroupKeySetID", 0, UINT16_MAX, &mRequest.groupKeySetID); + ModelCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003F) command (0x00000003) on endpoint %" PRIu8, endpointId); + + return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, + mTimedInteractionTimeoutMs); + } + +private: + chip::app::Clusters::GroupKeyManagement::Commands::KeySetRemove::Type mRequest; +}; + +/* + * Command KeySetWrite + */ +class GroupKeyManagementKeySetWrite : public ModelCommand +{ +public: + GroupKeyManagementKeySetWrite() : ModelCommand("key-set-write") + { + // groupKeySet Struct parsing is not supported yet + ModelCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003F) command (0x00000000) on endpoint %" PRIu8, endpointId); + + return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, + mTimedInteractionTimeoutMs); + } + +private: + chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type mRequest; +}; + +/* + * Attribute GroupKeyMap + */ +class ReadGroupKeyManagementGroupKeyMap : public ModelCommand +{ +public: + ReadGroupKeyManagementGroupKeyMap() : ModelCommand("read") + { + AddArgument("attr-name", "group-key-map"); + ModelCommand::AddArguments(); + } + + ~ReadGroupKeyManagementGroupKeyMap() {} CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { @@ -19398,32 +19594,32 @@ class ReadGroupKeyManagementGroups : public ModelCommand chip::Controller::GroupKeyManagementCluster cluster; cluster.Associate(device, endpointId); - return cluster.ReadAttribute( + return cluster.ReadAttribute( this, OnAttributeResponse, OnDefaultFailure); } static void OnAttributeResponse( void * context, - const chip::app::DataModel::DecodableList & + const chip::app::DataModel::DecodableList & value) { - OnGeneralAttributeResponse(context, "GroupKeyManagement.Groups response", value); + OnGeneralAttributeResponse(context, "GroupKeyManagement.GroupKeyMap response", value); } }; -class ReportGroupKeyManagementGroups : public ModelCommand +class ReportGroupKeyManagementGroupKeyMap : public ModelCommand { public: - ReportGroupKeyManagementGroups() : ModelCommand("report") + ReportGroupKeyManagementGroupKeyMap() : ModelCommand("report") { - AddArgument("attr-name", "groups"); + AddArgument("attr-name", "group-key-map"); AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); AddArgument("wait", 0, 1, &mWait); ModelCommand::AddArguments(); } - ~ReportGroupKeyManagementGroups() {} + ~ReportGroupKeyManagementGroupKeyMap() {} CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { @@ -19433,7 +19629,7 @@ class ReportGroupKeyManagementGroups : public ModelCommand cluster.Associate(device, endpointId); auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( + return cluster.SubscribeAttribute( this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); } @@ -19444,10 +19640,10 @@ class ReportGroupKeyManagementGroups : public ModelCommand static void OnValueReport( void * context, - const chip::app::DataModel::DecodableList & + const chip::app::DataModel::DecodableList & value) { - LogValue("GroupKeyManagement.Groups report", 0, value); + LogValue("GroupKeyManagement.GroupKeyMap report", 0, value); } private: @@ -19457,18 +19653,18 @@ class ReportGroupKeyManagementGroups : public ModelCommand }; /* - * Attribute GroupKeys + * Attribute GroupTable */ -class ReadGroupKeyManagementGroupKeys : public ModelCommand +class ReadGroupKeyManagementGroupTable : public ModelCommand { public: - ReadGroupKeyManagementGroupKeys() : ModelCommand("read") + ReadGroupKeyManagementGroupTable() : ModelCommand("read") { - AddArgument("attr-name", "group-keys"); + AddArgument("attr-name", "group-table"); ModelCommand::AddArguments(); } - ~ReadGroupKeyManagementGroupKeys() {} + ~ReadGroupKeyManagementGroupTable() {} CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { @@ -19476,32 +19672,32 @@ class ReadGroupKeyManagementGroupKeys : public ModelCommand chip::Controller::GroupKeyManagementCluster cluster; cluster.Associate(device, endpointId); - return cluster.ReadAttribute( + return cluster.ReadAttribute( this, OnAttributeResponse, OnDefaultFailure); } static void OnAttributeResponse( void * context, - const chip::app::DataModel::DecodableList & + const chip::app::DataModel::DecodableList & value) { - OnGeneralAttributeResponse(context, "GroupKeyManagement.GroupKeys response", value); + OnGeneralAttributeResponse(context, "GroupKeyManagement.GroupTable response", value); } }; -class ReportGroupKeyManagementGroupKeys : public ModelCommand +class ReportGroupKeyManagementGroupTable : public ModelCommand { public: - ReportGroupKeyManagementGroupKeys() : ModelCommand("report") + ReportGroupKeyManagementGroupTable() : ModelCommand("report") { - AddArgument("attr-name", "group-keys"); + AddArgument("attr-name", "group-table"); AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); AddArgument("wait", 0, 1, &mWait); ModelCommand::AddArguments(); } - ~ReportGroupKeyManagementGroupKeys() {} + ~ReportGroupKeyManagementGroupTable() {} CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { @@ -19511,7 +19707,7 @@ class ReportGroupKeyManagementGroupKeys : public ModelCommand cluster.Associate(device, endpointId); auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( + return cluster.SubscribeAttribute( this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); } @@ -19522,10 +19718,10 @@ class ReportGroupKeyManagementGroupKeys : public ModelCommand static void OnValueReport( void * context, - const chip::app::DataModel::DecodableList & + const chip::app::DataModel::DecodableList & value) { - LogValue("GroupKeyManagement.GroupKeys report", 0, value); + LogValue("GroupKeyManagement.GroupTable report", 0, value); } private: @@ -19534,6 +19730,66 @@ class ReportGroupKeyManagementGroupKeys : public ModelCommand bool mWait; }; +/* + * Attribute MaxGroupsPerFabric + */ +class ReadGroupKeyManagementMaxGroupsPerFabric : public ModelCommand +{ +public: + ReadGroupKeyManagementMaxGroupsPerFabric() : ModelCommand("read") + { + AddArgument("attr-name", "max-groups-per-fabric"); + ModelCommand::AddArguments(); + } + + ~ReadGroupKeyManagementMaxGroupsPerFabric() {} + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x003F) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::GroupKeyManagementCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttribute( + this, OnAttributeResponse, OnDefaultFailure); + } + + static void OnAttributeResponse(void * context, uint16_t value) + { + OnGeneralAttributeResponse(context, "GroupKeyManagement.MaxGroupsPerFabric response", value); + } +}; + +/* + * Attribute MaxGroupKeysPerFabric + */ +class ReadGroupKeyManagementMaxGroupKeysPerFabric : public ModelCommand +{ +public: + ReadGroupKeyManagementMaxGroupKeysPerFabric() : ModelCommand("read") + { + AddArgument("attr-name", "max-group-keys-per-fabric"); + ModelCommand::AddArguments(); + } + + ~ReadGroupKeyManagementMaxGroupKeysPerFabric() {} + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x003F) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::GroupKeyManagementCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttribute( + this, OnAttributeResponse, OnDefaultFailure); + } + + static void OnAttributeResponse(void * context, uint16_t value) + { + OnGeneralAttributeResponse(context, "GroupKeyManagement.MaxGroupKeysPerFabric response", value); + } +}; + /* * Attribute AttributeList */ @@ -51453,11 +51709,17 @@ void registerClusterGroupKeyManagement(Commands & commands) const char * clusterName = "GroupKeyManagement"; commands_list clusterCommands = { - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // }; commands.Register(clusterName, clusterCommands); diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index abf88640f1d1da..37105dafba1766 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -147,6 +147,7 @@ class TestList : public Command printf("TestBasicInformation\n"); printf("TestIdentifyCluster\n"); printf("TestGroupsCluster\n"); + printf("TestGroupKeyManagementCluster\n"); printf("TestOperationalCredentialsCluster\n"); printf("TestModeSelectCluster\n"); printf("TestGroupMessaging\n"); @@ -55619,84 +55620,52 @@ class TestGroupsCluster : public TestCommand err = TestGetGroupMembership1All_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Add Group 2 (new)\n"); - err = TestAddGroup2New_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : View Group 3 (not found)\n"); + err = TestViewGroup3NotFound_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : View Group 2 (new)\n"); - err = TestViewGroup2New_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : View Group 1 (existing)\n"); + err = TestViewGroup1Existing_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : View Group 3 (not found)\n"); - err = TestViewGroup3NotFound_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Remove Group 0 (invalid)\n"); + err = TestRemoveGroup0Invalid_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Add Group 3 (new)\n"); - err = TestAddGroup3New_10(); + ChipLogProgress(chipTool, " ***** Test Step 10 : Remove Group 4 (not found)\n"); + err = TestRemoveGroup4NotFound_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : View Group 1 (existing)\n"); - err = TestViewGroup1Existing_11(); + ChipLogProgress(chipTool, " ***** Test Step 11 : View Group 1 (not removed)\n"); + err = TestViewGroup1NotRemoved_11(); break; case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : View Group 2 (existing)\n"); - err = TestViewGroup2Existing_12(); + ChipLogProgress(chipTool, " ***** Test Step 12 : View Group 2 (removed)\n"); + err = TestViewGroup2Removed_12(); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Get Group Membership 2\n"); - err = TestGetGroupMembership2_13(); + ChipLogProgress(chipTool, " ***** Test Step 13 : Get Group Membership 3\n"); + err = TestGetGroupMembership3_13(); break; case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : View Group 3 (new)\n"); - err = TestViewGroup3New_14(); + ChipLogProgress(chipTool, " ***** Test Step 14 : Remove All\n"); + err = TestRemoveAll_14(); break; case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Remove Group 0 (invalid)\n"); - err = TestRemoveGroup0Invalid_15(); + ChipLogProgress(chipTool, " ***** Test Step 15 : View Group 1 (removed)\n"); + err = TestViewGroup1Removed_15(); break; case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Remove Group 4 (not found)\n"); - err = TestRemoveGroup4NotFound_16(); + ChipLogProgress(chipTool, " ***** Test Step 16 : View Group 2 (still removed)\n"); + err = TestViewGroup2StillRemoved_16(); break; case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Remove Group 2 (existing)\n"); - err = TestRemoveGroup2Existing_17(); + ChipLogProgress(chipTool, " ***** Test Step 17 : View Group 3 (removed)\n"); + err = TestViewGroup3Removed_17(); break; case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : View Group 1 (not removed)\n"); - err = TestViewGroup1NotRemoved_18(); - break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : View Group 2 (removed)\n"); - err = TestViewGroup2Removed_19(); - break; - case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : View Group 3 (not removed)\n"); - err = TestViewGroup3NotRemoved_20(); - break; - case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : Get Group Membership 3\n"); - err = TestGetGroupMembership3_21(); - break; - case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : Remove All\n"); - err = TestRemoveAll_22(); - break; - case 23: - ChipLogProgress(chipTool, " ***** Test Step 23 : View Group 1 (removed)\n"); - err = TestViewGroup1Removed_23(); - break; - case 24: - ChipLogProgress(chipTool, " ***** Test Step 24 : View Group 2 (still removed)\n"); - err = TestViewGroup2StillRemoved_24(); - break; - case 25: - ChipLogProgress(chipTool, " ***** Test Step 25 : View Group 3 (removed)\n"); - err = TestViewGroup3Removed_25(); - break; - case 26: - ChipLogProgress(chipTool, " ***** Test Step 26 : Get Group Membership 4\n"); - err = TestGetGroupMembership4_26(); + ChipLogProgress(chipTool, " ***** Test Step 18 : Get Group Membership 4\n"); + err = TestGetGroupMembership4_18(); break; } @@ -55709,7 +55678,7 @@ class TestGroupsCluster : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 27; + const uint16_t mTestCount = 19; // // Tests methods @@ -55914,17 +55883,16 @@ class TestGroupsCluster : public TestCommand NextTest(); } - CHIP_ERROR TestAddGroup2New_7() + CHIP_ERROR TestViewGroup3NotFound_7() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::AddGroup::Type; + using RequestType = chip::app::Clusters::Groups::Commands::ViewGroup::Type; RequestType request; - request.groupId = 4369U; - request.groupName = chip::Span("Group #2garbage: not in length on purpose", 8); + request.groupId = 32767U; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_7(data.status, data.groupId); + (static_cast(context))->OnSuccessResponse_7(data.status, data.groupId, data.groupName); }; auto failure = [](void * context, EmberAfStatus status) { @@ -55937,22 +55905,22 @@ class TestGroupsCluster : public TestCommand void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_7(uint8_t status, uint16_t groupId) + void OnSuccessResponse_7(uint8_t status, uint16_t groupId, chip::CharSpan groupName) { - VerifyOrReturn(CheckValue("status", status, 0)); + VerifyOrReturn(CheckValue("status", status, 139)); - VerifyOrReturn(CheckValue("groupId", groupId, 4369U)); + VerifyOrReturn(CheckValue("groupId", groupId, 32767U)); NextTest(); } - CHIP_ERROR TestViewGroup2New_8() + CHIP_ERROR TestViewGroup1Existing_8() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; using RequestType = chip::app::Clusters::Groups::Commands::ViewGroup::Type; RequestType request; - request.groupId = 4369U; + request.groupId = 1U; auto success = [](void * context, const typename RequestType::ResponseType & data) { (static_cast(context))->OnSuccessResponse_8(data.status, data.groupId, data.groupName); @@ -55972,23 +55940,23 @@ class TestGroupsCluster : public TestCommand { VerifyOrReturn(CheckValue("status", status, 0)); - VerifyOrReturn(CheckValue("groupId", groupId, 4369U)); + VerifyOrReturn(CheckValue("groupId", groupId, 1U)); - VerifyOrReturn(CheckValueAsString("groupName", groupName, chip::CharSpan("Group #2", 8))); + VerifyOrReturn(CheckValueAsString("groupName", groupName, chip::CharSpan("Group #1", 8))); NextTest(); } - CHIP_ERROR TestViewGroup3NotFound_9() + CHIP_ERROR TestRemoveGroup0Invalid_9() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::ViewGroup::Type; + using RequestType = chip::app::Clusters::Groups::Commands::RemoveGroup::Type; RequestType request; - request.groupId = 32767U; + request.groupId = 0U; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_9(data.status, data.groupId, data.groupName); + (static_cast(context))->OnSuccessResponse_9(data.status, data.groupId); }; auto failure = [](void * context, EmberAfStatus status) { @@ -56001,23 +55969,22 @@ class TestGroupsCluster : public TestCommand void OnFailureResponse_9(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_9(uint8_t status, uint16_t groupId, chip::CharSpan groupName) + void OnSuccessResponse_9(uint8_t status, uint16_t groupId) { - VerifyOrReturn(CheckValue("status", status, 139)); + VerifyOrReturn(CheckValue("status", status, 135)); - VerifyOrReturn(CheckValue("groupId", groupId, 32767U)); + VerifyOrReturn(CheckValue("groupId", groupId, 0U)); NextTest(); } - CHIP_ERROR TestAddGroup3New_10() + CHIP_ERROR TestRemoveGroup4NotFound_10() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::AddGroup::Type; + using RequestType = chip::app::Clusters::Groups::Commands::RemoveGroup::Type; RequestType request; - request.groupId = 32767U; - request.groupName = chip::Span("Group #3garbage: not in length on purpose", 8); + request.groupId = 4U; auto success = [](void * context, const typename RequestType::ResponseType & data) { (static_cast(context))->OnSuccessResponse_10(data.status, data.groupId); @@ -56035,14 +56002,14 @@ class TestGroupsCluster : public TestCommand void OnSuccessResponse_10(uint8_t status, uint16_t groupId) { - VerifyOrReturn(CheckValue("status", status, 0)); + VerifyOrReturn(CheckValue("status", status, 139)); - VerifyOrReturn(CheckValue("groupId", groupId, 32767U)); + VerifyOrReturn(CheckValue("groupId", groupId, 4U)); NextTest(); } - CHIP_ERROR TestViewGroup1Existing_11() + CHIP_ERROR TestViewGroup1NotRemoved_11() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; using RequestType = chip::app::Clusters::Groups::Commands::ViewGroup::Type; @@ -56075,7 +56042,7 @@ class TestGroupsCluster : public TestCommand NextTest(); } - CHIP_ERROR TestViewGroup2Existing_12() + CHIP_ERROR TestViewGroup2Removed_12() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; using RequestType = chip::app::Clusters::Groups::Commands::ViewGroup::Type; @@ -56099,26 +56066,25 @@ class TestGroupsCluster : public TestCommand void OnSuccessResponse_12(uint8_t status, uint16_t groupId, chip::CharSpan groupName) { - VerifyOrReturn(CheckValue("status", status, 0)); + VerifyOrReturn(CheckValue("status", status, 139)); VerifyOrReturn(CheckValue("groupId", groupId, 4369U)); - VerifyOrReturn(CheckValueAsString("groupName", groupName, chip::CharSpan("Group #2", 8))); - NextTest(); } - CHIP_ERROR TestGetGroupMembership2_13() + CHIP_ERROR TestGetGroupMembership3_13() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; using RequestType = chip::app::Clusters::Groups::Commands::GetGroupMembership::Type; RequestType request; - uint16_t groupListList[3]; - groupListList[0] = 2U; - groupListList[1] = 3U; - groupListList[2] = 32767U; + uint16_t groupListList[4]; + groupListList[0] = 1U; + groupListList[1] = 2U; + groupListList[2] = 4369U; + groupListList[3] = 3U; request.groupList = groupListList; auto success = [](void * context, const typename RequestType::ResponseType & data) { @@ -56141,22 +56107,21 @@ class TestGroupsCluster : public TestCommand auto iter = groupList.begin(); VerifyOrReturn(CheckNextListItemDecodes("groupList", iter, 0)); - VerifyOrReturn(CheckValue("groupList[0]", iter.GetValue(), 32767U)); + VerifyOrReturn(CheckValue("groupList[0]", iter.GetValue(), 1U)); VerifyOrReturn(CheckNoMoreListItems("groupList", iter, 1)); NextTest(); } - CHIP_ERROR TestViewGroup3New_14() + CHIP_ERROR TestRemoveAll_14() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::ViewGroup::Type; + using RequestType = chip::app::Clusters::Groups::Commands::RemoveAllGroups::Type; RequestType request; - request.groupId = 32767U; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_14(data.status, data.groupId, data.groupName); + (static_cast(context))->OnSuccessResponse_14(); }; auto failure = [](void * context, EmberAfStatus status) { @@ -56169,27 +56134,18 @@ class TestGroupsCluster : public TestCommand void OnFailureResponse_14(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_14(uint8_t status, uint16_t groupId, chip::CharSpan groupName) - { - VerifyOrReturn(CheckValue("status", status, 0)); - - VerifyOrReturn(CheckValue("groupId", groupId, 32767U)); - - VerifyOrReturn(CheckValueAsString("groupName", groupName, chip::CharSpan("Group #3", 8))); - - NextTest(); - } + void OnSuccessResponse_14() { NextTest(); } - CHIP_ERROR TestRemoveGroup0Invalid_15() + CHIP_ERROR TestViewGroup1Removed_15() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::RemoveGroup::Type; + using RequestType = chip::app::Clusters::Groups::Commands::ViewGroup::Type; RequestType request; - request.groupId = 0U; + request.groupId = 1U; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_15(data.status, data.groupId); + (static_cast(context))->OnSuccessResponse_15(data.status, data.groupId, data.groupName); }; auto failure = [](void * context, EmberAfStatus status) { @@ -56202,111 +56158,16 @@ class TestGroupsCluster : public TestCommand void OnFailureResponse_15(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_15(uint8_t status, uint16_t groupId) - { - VerifyOrReturn(CheckValue("status", status, 135)); - - VerifyOrReturn(CheckValue("groupId", groupId, 0U)); - - NextTest(); - } - - CHIP_ERROR TestRemoveGroup4NotFound_16() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::RemoveGroup::Type; - - RequestType request; - request.groupId = 4U; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_16(data.status, data.groupId); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_16(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_16(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_16(uint8_t status, uint16_t groupId) + void OnSuccessResponse_15(uint8_t status, uint16_t groupId, chip::CharSpan groupName) { VerifyOrReturn(CheckValue("status", status, 139)); - VerifyOrReturn(CheckValue("groupId", groupId, 4U)); - - NextTest(); - } - - CHIP_ERROR TestRemoveGroup2Existing_17() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::RemoveGroup::Type; - - RequestType request; - request.groupId = 4369U; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_17(data.status, data.groupId); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_17(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_17(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_17(uint8_t status, uint16_t groupId) - { - VerifyOrReturn(CheckValue("status", status, 0)); - - VerifyOrReturn(CheckValue("groupId", groupId, 4369U)); - - NextTest(); - } - - CHIP_ERROR TestViewGroup1NotRemoved_18() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::ViewGroup::Type; - - RequestType request; - request.groupId = 1U; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_18(data.status, data.groupId, data.groupName); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_18(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_18(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_18(uint8_t status, uint16_t groupId, chip::CharSpan groupName) - { - VerifyOrReturn(CheckValue("status", status, 0)); - VerifyOrReturn(CheckValue("groupId", groupId, 1U)); - VerifyOrReturn(CheckValueAsString("groupName", groupName, chip::CharSpan("Group #1", 8))); - NextTest(); } - CHIP_ERROR TestViewGroup2Removed_19() + CHIP_ERROR TestViewGroup2StillRemoved_16() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; using RequestType = chip::app::Clusters::Groups::Commands::ViewGroup::Type; @@ -56315,20 +56176,20 @@ class TestGroupsCluster : public TestCommand request.groupId = 4369U; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_19(data.status, data.groupId, data.groupName); + (static_cast(context))->OnSuccessResponse_16(data.status, data.groupId, data.groupName); }; auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_19(status); + (static_cast(context))->OnFailureResponse_16(status); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_19(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_16(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_19(uint8_t status, uint16_t groupId, chip::CharSpan groupName) + void OnSuccessResponse_16(uint8_t status, uint16_t groupId, chip::CharSpan groupName) { VerifyOrReturn(CheckValue("status", status, 139)); @@ -56337,7 +56198,7 @@ class TestGroupsCluster : public TestCommand NextTest(); } - CHIP_ERROR TestViewGroup3NotRemoved_20() + CHIP_ERROR TestViewGroup3Removed_17() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; using RequestType = chip::app::Clusters::Groups::Commands::ViewGroup::Type; @@ -56346,221 +56207,191 @@ class TestGroupsCluster : public TestCommand request.groupId = 32767U; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_20(data.status, data.groupId, data.groupName); + (static_cast(context))->OnSuccessResponse_17(data.status, data.groupId, data.groupName); }; auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_20(status); + (static_cast(context))->OnFailureResponse_17(status); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_20(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_17(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_20(uint8_t status, uint16_t groupId, chip::CharSpan groupName) + void OnSuccessResponse_17(uint8_t status, uint16_t groupId, chip::CharSpan groupName) { - VerifyOrReturn(CheckValue("status", status, 0)); + VerifyOrReturn(CheckValue("status", status, 139)); VerifyOrReturn(CheckValue("groupId", groupId, 32767U)); - VerifyOrReturn(CheckValueAsString("groupName", groupName, chip::CharSpan("Group #3", 8))); - NextTest(); } - CHIP_ERROR TestGetGroupMembership3_21() + CHIP_ERROR TestGetGroupMembership4_18() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; using RequestType = chip::app::Clusters::Groups::Commands::GetGroupMembership::Type; RequestType request; - uint16_t groupListList[4]; + uint16_t groupListList[5]; groupListList[0] = 1U; groupListList[1] = 2U; groupListList[2] = 4369U; groupListList[3] = 3U; + groupListList[4] = 32767U; request.groupList = groupListList; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_21(data.capacity, data.groupList); + (static_cast(context))->OnSuccessResponse_18(data.capacity, data.groupList); }; auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_21(status); + (static_cast(context))->OnFailureResponse_18(status); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_21(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_18(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_21(uint8_t capacity, const chip::app::DataModel::DecodableList & groupList) + void OnSuccessResponse_18(uint8_t capacity, const chip::app::DataModel::DecodableList & groupList) { VerifyOrReturn(CheckValue("capacity", capacity, 255)); auto iter = groupList.begin(); - VerifyOrReturn(CheckNextListItemDecodes("groupList", iter, 0)); - VerifyOrReturn(CheckValue("groupList[0]", iter.GetValue(), 1U)); - VerifyOrReturn(CheckNoMoreListItems("groupList", iter, 1)); + VerifyOrReturn(CheckNoMoreListItems("groupList", iter, 0)); NextTest(); } +}; - CHIP_ERROR TestRemoveAll_22() +class TestGroupKeyManagementCluster : public TestCommand +{ +public: + TestGroupKeyManagementCluster() : TestCommand("TestGroupKeyManagementCluster"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::RemoveAllGroups::Type; + CHIP_ERROR err = CHIP_NO_ERROR; - RequestType request; + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: TestGroupKeyManagementCluster\n"); + } - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_22(); - }; + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: TestGroupKeyManagementCluster\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_22(status); - }; + Wait(); - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read maxGroupsPerFabric\n"); + err = TestReadMaxGroupsPerFabric_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read maxGroupKeysPerFabric\n"); + err = TestReadMaxGroupKeysPerFabric_2(); + break; + } - void OnFailureResponse_22(EmberAfStatus status) { ThrowFailureResponse(); } + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } - void OnSuccessResponse_22() { NextTest(); } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 3; - CHIP_ERROR TestViewGroup1Removed_23() + static void OnFailureCallback_1(void * context, EmberAfStatus status) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::ViewGroup::Type; - - RequestType request; - request.groupId = 1U; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_23(data.status, data.groupId, data.groupName); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_23(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; + (static_cast(context))->OnFailureResponse_1(status); } - void OnFailureResponse_23(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_23(uint8_t status, uint16_t groupId, chip::CharSpan groupName) + static void OnSuccessCallback_1(void * context, uint16_t maxGroupsPerFabric) { - VerifyOrReturn(CheckValue("status", status, 139)); - - VerifyOrReturn(CheckValue("groupId", groupId, 1U)); - - NextTest(); + (static_cast(context))->OnSuccessResponse_1(maxGroupsPerFabric); } - CHIP_ERROR TestViewGroup2StillRemoved_24() + static void OnFailureCallback_2(void * context, EmberAfStatus status) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::ViewGroup::Type; - - RequestType request; - request.groupId = 4369U; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_24(data.status, data.groupId, data.groupName); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_24(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; + (static_cast(context))->OnFailureResponse_2(status); } - void OnFailureResponse_24(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_24(uint8_t status, uint16_t groupId, chip::CharSpan groupName) + static void OnSuccessCallback_2(void * context, uint16_t maxGroupKeysPerFabric) { - VerifyOrReturn(CheckValue("status", status, 139)); + (static_cast(context))->OnSuccessResponse_2(maxGroupKeysPerFabric); + } - VerifyOrReturn(CheckValue("groupId", groupId, 4369U)); + // + // Tests methods + // - NextTest(); + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(); } - CHIP_ERROR TestViewGroup3Removed_25() + CHIP_ERROR TestReadMaxGroupsPerFabric_1() { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::ViewGroup::Type; - - RequestType request; - request.groupId = 32767U; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_25(data.status, data.groupId, data.groupName); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_25(status); - }; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; + chip::Controller::GroupKeyManagementClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_1, OnFailureCallback_1)); return CHIP_NO_ERROR; } - void OnFailureResponse_25(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_25(uint8_t status, uint16_t groupId, chip::CharSpan groupName) + void OnSuccessResponse_1(uint16_t maxGroupsPerFabric) { - VerifyOrReturn(CheckValue("status", status, 139)); - - VerifyOrReturn(CheckValue("groupId", groupId, 32767U)); + VerifyOrReturn(CheckValue("maxGroupsPerFabric", maxGroupsPerFabric, 1U)); NextTest(); } - CHIP_ERROR TestGetGroupMembership4_26() + CHIP_ERROR TestReadMaxGroupKeysPerFabric_2() { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::GetGroupMembership::Type; - - RequestType request; - - uint16_t groupListList[5]; - groupListList[0] = 1U; - groupListList[1] = 2U; - groupListList[2] = 4369U; - groupListList[3] = 3U; - groupListList[4] = 32767U; - request.groupList = groupListList; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_26(data.capacity, data.groupList); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_26(status); - }; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; + chip::Controller::GroupKeyManagementClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2)); return CHIP_NO_ERROR; } - void OnFailureResponse_26(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_26(uint8_t capacity, const chip::app::DataModel::DecodableList & groupList) + void OnSuccessResponse_2(uint16_t maxGroupKeysPerFabric) { - VerifyOrReturn(CheckValue("capacity", capacity, 255)); - - auto iter = groupList.begin(); - VerifyOrReturn(CheckNoMoreListItems("groupList", iter, 0)); + VerifyOrReturn(CheckValue("maxGroupKeysPerFabric", maxGroupKeysPerFabric, 1U)); NextTest(); } @@ -57898,6 +57729,7 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.cpp b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.cpp index 2e9d8d2ba96da4..51d399b05a44e8 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.cpp +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.cpp @@ -1045,10 +1045,10 @@ void GeneralDiagnosticsClusterAttributeListListAttributeFilter(TLV::TLVReader * cb->mCall(cb->mContext, list); } -void GroupKeyManagementClusterGroupsListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) +void GroupKeyManagementClusterGroupKeyMapListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) { - chip::app::DataModel::DecodableList list; + chip::app::DataModel::DecodableList list; CHIP_ERROR err = Decode(*tlvData, list); if (err != CHIP_NO_ERROR) { @@ -1061,15 +1061,15 @@ void GroupKeyManagementClusterGroupsListAttributeFilter(TLV::TLVReader * tlvData return; } - Callback::Callback * cb = - Callback::Callback::FromCancelable(onSuccessCallback); + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); cb->mCall(cb->mContext, list); } -void GroupKeyManagementClusterGroupKeysListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) +void GroupKeyManagementClusterGroupTableListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) { - chip::app::DataModel::DecodableList list; + chip::app::DataModel::DecodableList list; CHIP_ERROR err = Decode(*tlvData, list); if (err != CHIP_NO_ERROR) { @@ -1082,8 +1082,8 @@ void GroupKeyManagementClusterGroupKeysListAttributeFilter(TLV::TLVReader * tlvD return; } - Callback::Callback * cb = - Callback::Callback::FromCancelable(onSuccessCallback); + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); cb->mCall(cb->mContext, list); } @@ -2453,6 +2453,35 @@ bool emberAfGeneralCommissioningClusterSetRegulatoryConfigResponseCallback(Endpo return true; } +bool emberAfGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback( + EndpointId endpoint, app::CommandSender * commandObj, /* TYPE WARNING: array array defaults to */ uint8_t * groupKeySetIDs) +{ + ChipLogProgress(Zcl, "KeySetReadAllIndicesResponse:"); + ChipLogProgress(Zcl, " groupKeySetIDs: %p", groupKeySetIDs); + + GET_CLUSTER_RESPONSE_CALLBACKS("GroupKeyManagementClusterKeySetReadAllIndicesResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, groupKeySetIDs); + return true; +} + +bool emberAfGroupKeyManagementClusterKeySetReadResponseCallback( + EndpointId endpoint, app::CommandSender * commandObj, + chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySet::DecodableType groupKeySet) +{ + ChipLogProgress(Zcl, "KeySetReadResponse:"); + ChipLogProgress(Zcl, " groupKeySet: Not sure how to log struct GroupKeySet"); + + GET_CLUSTER_RESPONSE_CALLBACKS("GroupKeyManagementClusterKeySetReadResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, GroupKeySet()); + return true; +} + bool emberAfGroupsClusterAddGroupResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint8_t status, uint16_t groupId) { diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h index c7620fc2e98ab8..089cbd0b1b8c73 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h @@ -60,6 +60,9 @@ typedef void (*GeneralCommissioningClusterCommissioningCompleteResponseCallback) chip::CharSpan debugText); typedef void (*GeneralCommissioningClusterSetRegulatoryConfigResponseCallback)(void * context, uint8_t errorCode, chip::CharSpan debugText); +typedef void (*GroupKeyManagementClusterKeySetReadAllIndicesResponseCallback)( + void * context, /* TYPE WARNING: array array defaults to */ uint8_t * groupKeySetIDs); +typedef void (*GroupKeyManagementClusterKeySetReadResponseCallback)(void * context, GroupKeySet groupKeySet); typedef void (*GroupsClusterAddGroupResponseCallback)(void * context, uint8_t status, uint16_t groupId); typedef void (*GroupsClusterGetGroupMembershipResponseCallback)(void * context, uint8_t capacity, /* TYPE WARNING: array array defaults to */ uint8_t * groupList); @@ -339,17 +342,18 @@ void GeneralDiagnosticsClusterAttributeListListAttributeFilter(chip::TLV::TLVRea chip::Callback::Cancelable * onFailureCallback); typedef void (*GeneralDiagnosticsAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -void GroupKeyManagementClusterGroupsListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, - chip::Callback::Cancelable * onFailureCallback); -typedef void (*GroupKeyManagementGroupsListAttributeCallback)( - void * context, - const chip::app::DataModel::DecodableList & data); -void GroupKeyManagementClusterGroupKeysListAttributeFilter(chip::TLV::TLVReader * data, - chip::Callback::Cancelable * onSuccessCallback, - chip::Callback::Cancelable * onFailureCallback); -typedef void (*GroupKeyManagementGroupKeysListAttributeCallback)( +void GroupKeyManagementClusterGroupKeyMapListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*GroupKeyManagementGroupKeyMapListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); +void GroupKeyManagementClusterGroupTableListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*GroupKeyManagementGroupTableListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & data); void GroupKeyManagementClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, chip::Callback::Cancelable * onFailureCallback); diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.cpp b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.cpp index 9ec6e07c5e802c..0283851fb15355 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.cpp +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.cpp @@ -3072,6 +3072,187 @@ CHIP_ERROR GeneralCommissioningCluster::SetRegulatoryConfig(Callback::Cancelable // GeneralDiagnostics Cluster Commands // GroupKeyManagement Cluster Commands +CHIP_ERROR GroupKeyManagementCluster::KeySetRead(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t groupKeySetID) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, GroupKeyManagement::Commands::KeySetRead::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // groupKeySetID: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), groupKeySetID)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +CHIP_ERROR GroupKeyManagementCluster::KeySetReadAllIndices(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint16_t groupKeySetIDs) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + GroupKeyManagement::Commands::KeySetReadAllIndices::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // groupKeySetIDs: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), groupKeySetIDs)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +CHIP_ERROR GroupKeyManagementCluster::KeySetRemove(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint16_t groupKeySetID) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, GroupKeyManagement::Commands::KeySetRemove::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // groupKeySetID: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), groupKeySetID)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +CHIP_ERROR GroupKeyManagementCluster::KeySetWrite(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint16_t groupKeySetID, + uint8_t securityPolicy, chip::ByteSpan epochKey0, uint64_t epochStartTime0, + chip::ByteSpan epochKey1, uint64_t epochStartTime1, chip::ByteSpan epochKey2, + uint64_t epochStartTime2) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, GroupKeyManagement::Commands::KeySetWrite::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // groupKeySetID: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), groupKeySetID)); + // securityPolicy: groupKeySecurityPolicy + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), securityPolicy)); + // epochKey0: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), epochKey0)); + // epochStartTime0: int64u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), epochStartTime0)); + // epochKey1: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), epochKey1)); + // epochStartTime1: int64u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), epochStartTime1)); + // epochKey2: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), epochKey2)); + // epochStartTime2: int64u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), epochStartTime2)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} // Groups Cluster Commands CHIP_ERROR GroupsCluster::AddGroup(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h index 9deb174f1d33fb..fbf96bf18c5d53 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h @@ -372,6 +372,17 @@ class DLL_EXPORT GroupKeyManagementCluster : public ClusterBase public: GroupKeyManagementCluster() : ClusterBase(app::Clusters::GroupKeyManagement::Id) {} ~GroupKeyManagementCluster() {} + + // Cluster Commands + CHIP_ERROR KeySetRead(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t groupKeySetID); + CHIP_ERROR KeySetReadAllIndices(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t groupKeySetIDs); + CHIP_ERROR KeySetRemove(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t groupKeySetID); + CHIP_ERROR KeySetWrite(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t groupKeySetID, uint8_t securityPolicy, chip::ByteSpan epochKey0, uint64_t epochStartTime0, + chip::ByteSpan epochKey1, uint64_t epochStartTime1, chip::ByteSpan epochKey2, uint64_t epochStartTime2); }; class DLL_EXPORT GroupsCluster : public ClusterBase diff --git a/zzz_generated/controller-clusters/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/controller-clusters/zap-generated/IMClusterCommandHandler.cpp index 23d9730fcf9790..6cd45a048b4ea6 100644 --- a/zzz_generated/controller-clusters/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/controller-clusters/zap-generated/IMClusterCommandHandler.cpp @@ -1236,6 +1236,164 @@ void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPa } // namespace GeneralCommissioning +namespace GroupKeyManagement { + +void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) +{ + // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV + // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. + // Any error value TLVUnpackError means we have received an illegal value. + // The following variables are used for all commands to save code size. + CHIP_ERROR TLVError = CHIP_NO_ERROR; + CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; + uint32_t validArgumentCount = 0; + uint32_t expectArgumentCount = 0; + uint32_t currentDecodeTagId = 0; + bool wasHandled = false; + { + switch (aCommandPath.mCommandId) + { + case Commands::KeySetReadAllIndicesResponse::Id: { + expectArgumentCount = 1; + /* TYPE WARNING: array array defaults to */ uint8_t * groupKeySetIDs; + bool argExists[1]; + + memset(argExists, 0, sizeof argExists); + + while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) + { + // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. + // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. + if (!TLV::IsContextTag(aDataTlv.GetTag())) + { + continue; + } + currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); + if (currentDecodeTagId < 1) + { + if (argExists[currentDecodeTagId]) + { + ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); + TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; + break; + } + else + { + argExists[currentDecodeTagId] = true; + validArgumentCount++; + } + } + switch (currentDecodeTagId) + { + case 0: + // Just for compatibility, we will add array type support in IM later. + TLVUnpackError = aDataTlv.GetDataPtr(const_cast(groupKeySetIDs)); + break; + default: + // Unsupported tag, ignore it. + ChipLogProgress(Zcl, "Unknown TLV tag during processing."); + break; + } + if (CHIP_NO_ERROR != TLVUnpackError) + { + break; + } + } + + if (CHIP_END_OF_TLV == TLVError) + { + // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. + TLVError = CHIP_NO_ERROR; + } + + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) + { + wasHandled = emberAfGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback(aCommandPath.mEndpointId, + apCommandObj, groupKeySetIDs); + } + break; + } + case Commands::KeySetReadResponse::Id: { + expectArgumentCount = 1; + chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySet::DecodableType groupKeySet; + bool argExists[1]; + + memset(argExists, 0, sizeof argExists); + + while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) + { + // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. + // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. + if (!TLV::IsContextTag(aDataTlv.GetTag())) + { + continue; + } + currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); + if (currentDecodeTagId < 1) + { + if (argExists[currentDecodeTagId]) + { + ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); + TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; + break; + } + else + { + argExists[currentDecodeTagId] = true; + validArgumentCount++; + } + } + switch (currentDecodeTagId) + { + case 0: + // Not supported, just error out. + TLVUnpackError = CHIP_ERROR_UNEXPECTED_TLV_ELEMENT; + break; + default: + // Unsupported tag, ignore it. + ChipLogProgress(Zcl, "Unknown TLV tag during processing."); + break; + } + if (CHIP_NO_ERROR != TLVUnpackError) + { + break; + } + } + + if (CHIP_END_OF_TLV == TLVError) + { + // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. + TLVError = CHIP_NO_ERROR; + } + + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) + { + wasHandled = + emberAfGroupKeyManagementClusterKeySetReadResponseCallback(aCommandPath.mEndpointId, apCommandObj, groupKeySet); + } + break; + } + default: { + return; + } + } + } + + if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) + { + ChipLogProgress(Zcl, + "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT + ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, + validArgumentCount, expectArgumentCount, TLVError.Format(), TLVUnpackError.Format(), currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); + } +} + +} // namespace GroupKeyManagement + namespace Groups { void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) @@ -4392,6 +4550,9 @@ void DispatchSingleClusterResponseCommand(const ConcreteCommandPath & aCommandPa case Clusters::GeneralCommissioning::Id: Clusters::GeneralCommissioning::DispatchClientCommand(apCommandObj, aCommandPath, aReader); break; + case Clusters::GroupKeyManagement::Id: + Clusters::GroupKeyManagement::DispatchClientCommand(apCommandObj, aCommandPath, aReader); + break; case Clusters::Groups::Id: Clusters::Groups::DispatchClientCommand(apCommandObj, aCommandPath, aReader); break; diff --git a/zzz_generated/thermostat/zap-generated/endpoint_config.h b/zzz_generated/thermostat/zap-generated/endpoint_config.h index 797102c9b1d66a..d1719853c2409a 100644 --- a/zzz_generated/thermostat/zap-generated/endpoint_config.h +++ b/zzz_generated/thermostat/zap-generated/endpoint_config.h @@ -277,7 +277,7 @@ \ /* Endpoint: 0, Cluster: Group Key Management (server), big-endian */ \ \ - /* 632 - groups, */ \ + /* 632 - groupKeyMap, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -293,7 +293,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 886 - group keys, */ \ + /* 886 - groupTable, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -574,7 +574,7 @@ \ /* Endpoint: 0, Cluster: Group Key Management (server), little-endian */ \ \ - /* 632 - groups, */ \ + /* 632 - groupKeyMap, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -590,7 +590,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 886 - group keys, */ \ + /* 886 - groupTable, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -869,8 +869,8 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Group Key Management (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(632) }, /* groups */ \ - { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(886) }, /* group keys */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(632) }, /* groupKeyMap */ \ + { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(886) }, /* groupTable */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Fixed Label (server) */ \ diff --git a/zzz_generated/tv-app/zap-generated/endpoint_config.h b/zzz_generated/tv-app/zap-generated/endpoint_config.h index c9e15e901fb2b3..2232cc2fc28ca8 100644 --- a/zzz_generated/tv-app/zap-generated/endpoint_config.h +++ b/zzz_generated/tv-app/zap-generated/endpoint_config.h @@ -279,7 +279,7 @@ \ /* Endpoint: 0, Cluster: Group Key Management (server), big-endian */ \ \ - /* 619 - groups, */ \ + /* 619 - groupKeyMap, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -295,7 +295,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 873 - group keys, */ \ + /* 873 - groupTable, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -738,7 +738,7 @@ \ /* Endpoint: 0, Cluster: Group Key Management (server), little-endian */ \ \ - /* 619 - groups, */ \ + /* 619 - groupKeyMap, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -754,7 +754,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 873 - group keys, */ \ + /* 873 - groupTable, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1184,8 +1184,8 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Group Key Management (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(619) }, /* groups */ \ - { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(873) }, /* group keys */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(619) }, /* groupKeyMap */ \ + { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(873) }, /* groupTable */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Fixed Label (server) */ \ diff --git a/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h b/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h index b8793bbe39968d..098619b66074ed 100644 --- a/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h +++ b/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h @@ -277,7 +277,7 @@ \ /* Endpoint: 0, Cluster: Group Key Management (server), big-endian */ \ \ - /* 632 - groups, */ \ + /* 632 - groupKeyMap, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -293,7 +293,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 886 - group keys, */ \ + /* 886 - groupTable, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -776,7 +776,7 @@ \ /* Endpoint: 0, Cluster: Group Key Management (server), little-endian */ \ \ - /* 632 - groups, */ \ + /* 632 - groupKeyMap, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -792,7 +792,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 886 - group keys, */ \ + /* 886 - groupTable, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1286,8 +1286,8 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Group Key Management (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(632) }, /* groups */ \ - { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(886) }, /* group keys */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(632) }, /* groupKeyMap */ \ + { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(886) }, /* groupTable */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Fixed Label (server) */ \