From 696e9642ba42dd3afabf80851dd423e0b06f8dc2 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Sat, 12 Feb 2022 05:10:07 -0500 Subject: [PATCH] Fix responses for UpdateFabricLabel to match the spec. (#15122) * Fix responses for UpdateFabricLabel to match the spec. 1. Send a NOCResponse instead of a status response, like the spec says. 2. Implement the "check for fabric label collision" bit from the spec. 3. Update the name of the "Fabrics" attribute to match the spec. 4. Add a test for UpdateFabricLabel and reading the Fabrics attribute both before and after updating the label. Fixes https://github.com/project-chip/connectedhomeip/issues/15114 * Fix handling of chip_tests_variables_has inside #each. It looks like #each breaks the .parent chain that chip_tests_variables_has relies on. Just manually hook that up. --- .../all-clusters-app.matter | 2 +- .../bridge-common/bridge-app.matter | 2 +- .../partials/test_cluster_command_value.zapt | 2 +- .../partials/test_cluster_value_equals.zapt | 2 +- .../door-lock-common/door-lock-app.matter | 2 +- .../light-switch-app.matter | 2 +- .../lighting-common/lighting-app.matter | 2 +- examples/lock-app/lock-common/lock-app.matter | 2 +- .../log-source-common/log-source-app.matter | 2 +- .../ota-provider-app.matter | 2 +- .../ota-requestor-app.matter | 2 +- .../placeholder/linux/apps/app1/config.matter | 4 +- .../placeholder/linux/apps/app2/config.matter | 4 +- examples/pump-app/pump-common/pump-app.matter | 2 +- .../pump-controller-app.matter | 2 +- .../esp32/main/temperature-measurement.matter | 2 +- .../thermostat-common/thermostat.matter | 2 +- examples/tv-app/tv-common/tv-app.matter | 4 +- .../tv-casting-common/tv-casting-app.matter | 2 +- examples/window-app/common/window-app.matter | 2 +- .../operational-credentials-server.cpp | 28 ++- .../TestOperationalCredentialsCluster.yaml | 76 ++++++-- .../suites/certification/Test_TC_DM_2_2.yaml | 2 +- .../chip/operational-credentials-cluster.xml | 2 +- .../data_model/controller-clusters.matter | 2 +- .../CHIPAttributeTLVValueDecoder.cpp | 4 +- .../java/zap-generated/CHIPCallbackTypes.h | 4 +- .../java/zap-generated/CHIPClusters-JNI.cpp | 20 +-- .../java/zap-generated/CHIPReadCallbacks.cpp | 14 +- .../java/zap-generated/CHIPReadCallbacks.h | 14 +- .../chip/devicecontroller/ChipClusters.java | 23 ++- .../devicecontroller/ClusterInfoMapping.java | 4 +- .../devicecontroller/ClusterReadMapping.java | 14 +- .../python/chip/clusters/CHIPClusters.py | 2 +- .../python/chip/clusters/Objects.py | 6 +- .../Fabric/FabricUIViewController.m | 13 +- .../templates/partials/check_test_value.zapt | 2 +- .../CHIP/templates/partials/test_value.zapt | 2 +- .../CHIPAttributeTLVValueDecoder.mm | 4 +- .../CHIP/zap-generated/CHIPCallbackBridge.mm | 6 +- .../CHIPCallbackBridge_internal.h | 23 ++- .../CHIP/zap-generated/CHIPClustersObjc.h | 11 +- .../CHIP/zap-generated/CHIPClustersObjc.mm | 25 ++- .../CHIP/zap-generated/CHIPTestClustersObjc.h | 2 +- .../zap-generated/CHIPTestClustersObjc.mm | 4 +- .../Framework/CHIPTests/CHIPClustersTests.m | 98 +++++++++++ .../zap-generated/endpoint_config.h | 2 +- .../zap-generated/cluster-objects.cpp | 4 +- .../zap-generated/cluster-objects.h | 8 +- .../app-common/zap-generated/ids/Attributes.h | 4 +- .../zap-generated/endpoint_config.h | 2 +- .../zap-generated/cluster/Commands.h | 6 +- .../cluster/logging/DataModelLogger.cpp | 4 +- .../chip-tool/zap-generated/test/Commands.h | 162 ++++++++++++++++-- .../zap-generated/CHIPClientCallbacks.h | 8 +- .../zap-generated/endpoint_config.h | 2 +- .../zap-generated/endpoint_config.h | 2 +- .../zap-generated/endpoint_config.h | 2 +- .../lock-app/zap-generated/endpoint_config.h | 2 +- .../zap-generated/endpoint_config.h | 2 +- .../zap-generated/endpoint_config.h | 2 +- .../zap-generated/endpoint_config.h | 2 +- .../app1/zap-generated/CHIPClientCallbacks.h | 8 +- .../app1/zap-generated/endpoint_config.h | 2 +- .../app2/zap-generated/CHIPClientCallbacks.h | 8 +- .../app2/zap-generated/endpoint_config.h | 2 +- .../pump-app/zap-generated/endpoint_config.h | 2 +- .../zap-generated/endpoint_config.h | 2 +- .../zap-generated/endpoint_config.h | 2 +- .../zap-generated/endpoint_config.h | 2 +- .../zap-generated/CHIPClientCallbacks.h | 8 +- .../tv-app/zap-generated/endpoint_config.h | 2 +- .../zap-generated/endpoint_config.h | 2 +- .../zap-generated/endpoint_config.h | 2 +- 74 files changed, 504 insertions(+), 203 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 5440a7888be6d1..be72718bca7520 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -2361,7 +2361,7 @@ server cluster OperationalCredentials = 62 { } readonly attribute NOCStruct NOCs[] = 0; - readonly attribute FabricDescriptor fabricsList[] = 1; + readonly attribute FabricDescriptor fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; diff --git a/examples/bridge-app/bridge-common/bridge-app.matter b/examples/bridge-app/bridge-common/bridge-app.matter index 0e193968693f6f..8f68cde4982de5 100644 --- a/examples/bridge-app/bridge-common/bridge-app.matter +++ b/examples/bridge-app/bridge-common/bridge-app.matter @@ -701,7 +701,7 @@ server cluster OperationalCredentials = 62 { } readonly attribute NOCStruct NOCs[] = 0; - readonly attribute FabricDescriptor fabricsList[] = 1; + readonly attribute FabricDescriptor fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; diff --git a/examples/chip-tool/templates/partials/test_cluster_command_value.zapt b/examples/chip-tool/templates/partials/test_cluster_command_value.zapt index 5cbf0d57c3915c..1dcdea46e9b6a3 100644 --- a/examples/chip-tool/templates/partials/test_cluster_command_value.zapt +++ b/examples/chip-tool/templates/partials/test_cluster_command_value.zapt @@ -18,7 +18,7 @@ auto-free setup, so we could guarantee no name collisions. }} {{zapTypeToEncodableClusterObjectType type ns=ns forceNotList=true forceNotNullable=true forceNotOptional=true}} {{asLowerCamelCase label}}List_{{depth}}[{{definedValue.length}}]; {{#each definedValue}} - {{>commandValue ns=../ns container=(concat (asLowerCamelCase ../label) "List_" ../depth "[" @index "]") definedValue=. type=../type depth=(incrementDepth ../depth)}} + {{>commandValue ns=../ns container=(concat (asLowerCamelCase ../label) "List_" ../depth "[" @index "]") definedValue=. type=../type depth=(incrementDepth ../depth) parent=../parent}} {{/each}} {{container}} = {{asLowerCamelCase label}}List_{{depth}}; {{else}} diff --git a/examples/chip-tool/templates/partials/test_cluster_value_equals.zapt b/examples/chip-tool/templates/partials/test_cluster_value_equals.zapt index 9018d3dfbc063f..74ef700d7ad8ca 100644 --- a/examples/chip-tool/templates/partials/test_cluster_value_equals.zapt +++ b/examples/chip-tool/templates/partials/test_cluster_value_equals.zapt @@ -25,7 +25,7 @@ auto iter_{{depth}} = {{actual}}.begin(); {{#each expected}} VerifyOrReturn(CheckNextListItemDecodes("{{../label}}", iter_{{../depth}}, {{@index}})); - {{>valueEquals label=(concat ../label "[" @index "]") actual=(concat "iter_" ../depth ".GetValue()") expected=this isArray=false type=../type chipType=../chipType depth=(incrementDepth depth)}} + {{>valueEquals label=(concat ../label "[" @index "]") actual=(concat "iter_" ../depth ".GetValue()") expected=this isArray=false type=../type chipType=../chipType depth=(incrementDepth depth) parent=../parent}} {{/each}} VerifyOrReturn(CheckNoMoreListItems("{{label}}", iter_{{depth}}, {{expected.length}})); } diff --git a/examples/door-lock-app/door-lock-common/door-lock-app.matter b/examples/door-lock-app/door-lock-common/door-lock-app.matter index a3e77d3301139d..7ce5dfeb53f5d3 100644 --- a/examples/door-lock-app/door-lock-common/door-lock-app.matter +++ b/examples/door-lock-app/door-lock-common/door-lock-app.matter @@ -1064,7 +1064,7 @@ server cluster OperationalCredentials = 62 { } readonly attribute NOCStruct NOCs[] = 0; - readonly attribute FabricDescriptor fabricsList[] = 1; + readonly attribute FabricDescriptor fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.matter b/examples/light-switch-app/light-switch-common/light-switch-app.matter index d9b000cb6c415e..6688952ebff55b 100644 --- a/examples/light-switch-app/light-switch-common/light-switch-app.matter +++ b/examples/light-switch-app/light-switch-common/light-switch-app.matter @@ -1052,7 +1052,7 @@ server cluster OperationalCredentials = 62 { } readonly attribute NOCStruct NOCs[] = 0; - readonly attribute FabricDescriptor fabricsList[] = 1; + readonly attribute FabricDescriptor fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index 04e392ee5d5dcc..ecf574c08648e5 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -1274,7 +1274,7 @@ server cluster OperationalCredentials = 62 { } readonly attribute NOCStruct NOCs[] = 0; - readonly attribute FabricDescriptor fabricsList[] = 1; + readonly attribute FabricDescriptor fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; diff --git a/examples/lock-app/lock-common/lock-app.matter b/examples/lock-app/lock-common/lock-app.matter index 5c79fd71dba9f8..c87e8e2e8fa722 100644 --- a/examples/lock-app/lock-common/lock-app.matter +++ b/examples/lock-app/lock-common/lock-app.matter @@ -693,7 +693,7 @@ server cluster OperationalCredentials = 62 { } readonly attribute NOCStruct NOCs[] = 0; - readonly attribute FabricDescriptor fabricsList[] = 1; + readonly attribute FabricDescriptor fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; diff --git a/examples/log-source-app/log-source-common/log-source-app.matter b/examples/log-source-app/log-source-common/log-source-app.matter index 678ca94d2f4870..70077781f0985e 100644 --- a/examples/log-source-app/log-source-common/log-source-app.matter +++ b/examples/log-source-app/log-source-common/log-source-app.matter @@ -311,7 +311,7 @@ server cluster OperationalCredentials = 62 { CHAR_STRING<32> label = 5; } - readonly attribute FabricDescriptor fabricsList[] = 1; + readonly attribute FabricDescriptor fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; diff --git a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter index b97e4b7df1eb59..6864157a871274 100644 --- a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter +++ b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter @@ -456,7 +456,7 @@ server cluster OperationalCredentials = 62 { } readonly attribute NOCStruct NOCs[] = 0; - readonly attribute FabricDescriptor fabricsList[] = 1; + readonly attribute FabricDescriptor fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; diff --git a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter index 1f5cd69f7fd62c..d91506ccbff0f7 100644 --- a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter +++ b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter @@ -463,7 +463,7 @@ server cluster OperationalCredentials = 62 { } readonly attribute NOCStruct NOCs[] = 0; - readonly attribute FabricDescriptor fabricsList[] = 1; + readonly attribute FabricDescriptor fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index 1271deb8867684..5071be40955c9a 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -586,7 +586,7 @@ client cluster OperationalCredentials = 62 { CHAR_STRING<32> label = 5; } - readonly attribute FabricDescriptor fabricsList[] = 1; + readonly attribute FabricDescriptor fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; @@ -668,7 +668,7 @@ server cluster OperationalCredentials = 62 { CHAR_STRING<32> label = 5; } - readonly attribute FabricDescriptor fabricsList[] = 1; + readonly attribute FabricDescriptor fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 1271deb8867684..5071be40955c9a 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -586,7 +586,7 @@ client cluster OperationalCredentials = 62 { CHAR_STRING<32> label = 5; } - readonly attribute FabricDescriptor fabricsList[] = 1; + readonly attribute FabricDescriptor fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; @@ -668,7 +668,7 @@ server cluster OperationalCredentials = 62 { CHAR_STRING<32> label = 5; } - readonly attribute FabricDescriptor fabricsList[] = 1; + readonly attribute FabricDescriptor fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; diff --git a/examples/pump-app/pump-common/pump-app.matter b/examples/pump-app/pump-common/pump-app.matter index 39d005084fda65..93cdd68055c570 100644 --- a/examples/pump-app/pump-common/pump-app.matter +++ b/examples/pump-app/pump-common/pump-app.matter @@ -612,7 +612,7 @@ server cluster OperationalCredentials = 62 { } readonly attribute NOCStruct NOCs[] = 0; - readonly attribute FabricDescriptor fabricsList[] = 1; + readonly attribute FabricDescriptor fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; diff --git a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter index a24df029c9c7aa..f1027c455467a5 100644 --- a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter +++ b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter @@ -632,7 +632,7 @@ server cluster OperationalCredentials = 62 { } readonly attribute NOCStruct NOCs[] = 0; - readonly attribute FabricDescriptor fabricsList[] = 1; + readonly attribute FabricDescriptor fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; diff --git a/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter b/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter index 85a44bb92e5390..fb58bd2c421054 100644 --- a/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter +++ b/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter @@ -518,7 +518,7 @@ server cluster OperationalCredentials = 62 { } readonly attribute NOCStruct NOCs[] = 0; - readonly attribute FabricDescriptor fabricsList[] = 1; + readonly attribute FabricDescriptor fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; diff --git a/examples/thermostat/thermostat-common/thermostat.matter b/examples/thermostat/thermostat-common/thermostat.matter index 00be3d38afa461..0227b57b869358 100644 --- a/examples/thermostat/thermostat-common/thermostat.matter +++ b/examples/thermostat/thermostat-common/thermostat.matter @@ -767,7 +767,7 @@ server cluster OperationalCredentials = 62 { } readonly attribute NOCStruct NOCs[] = 0; - readonly attribute FabricDescriptor fabricsList[] = 1; + readonly attribute FabricDescriptor fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter index bb3a64be5c17de..601b92409eaf5d 100644 --- a/examples/tv-app/tv-common/tv-app.matter +++ b/examples/tv-app/tv-common/tv-app.matter @@ -1463,7 +1463,7 @@ client cluster OperationalCredentials = 62 { } readonly attribute NOCStruct NOCs[] = 0; - readonly attribute FabricDescriptor fabricsList[] = 1; + readonly attribute FabricDescriptor fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; @@ -1561,7 +1561,7 @@ server cluster OperationalCredentials = 62 { } readonly attribute NOCStruct NOCs[] = 0; - readonly attribute FabricDescriptor fabricsList[] = 1; + readonly attribute FabricDescriptor fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; diff --git a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter index 45d33ed9c5f605..2a5e9a5fa478a5 100644 --- a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter +++ b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter @@ -2152,7 +2152,7 @@ server cluster OperationalCredentials = 62 { } readonly attribute NOCStruct NOCs[] = 0; - readonly attribute FabricDescriptor fabricsList[] = 1; + readonly attribute FabricDescriptor fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; diff --git a/examples/window-app/common/window-app.matter b/examples/window-app/common/window-app.matter index bc7cee800d0431..f3944793f2dfb1 100644 --- a/examples/window-app/common/window-app.matter +++ b/examples/window-app/common/window-app.matter @@ -539,7 +539,7 @@ server cluster OperationalCredentials = 62 { } readonly attribute NOCStruct NOCs[] = 0; - readonly attribute FabricDescriptor fabricsList[] = 1; + readonly attribute FabricDescriptor fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; diff --git a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp index 1556068fbf4066..2f6b9c6e9ad4cf 100644 --- a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp +++ b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp @@ -60,6 +60,7 @@ namespace { CHIP_ERROR SendNOCResponse(app::CommandHandler * commandObj, const ConcreteCommandPath & path, OperationalCertStatus status, uint8_t index, const CharSpan & debug_text); +OperationalCertStatus ConvertToNOCResponseStatus(CHIP_ERROR err); constexpr uint8_t kDACCertificate = 1; constexpr uint8_t kPAICertificate = 2; @@ -209,7 +210,7 @@ CHIP_ERROR OperationalCredentialsAttrAccess::Read(const ConcreteReadAttributePat case Attributes::CommissionedFabrics::Id: { return ReadCommissionedFabrics(aPath.mEndpointId, aEncoder); } - case Attributes::FabricsList::Id: { + case Attributes::Fabrics::Id: { return ReadFabricsList(aPath.mEndpointId, aEncoder); } case Attributes::TrustedRootCertificates::Id: { @@ -270,7 +271,7 @@ void fabricListChanged() // Currently, we only manage FabricsList attribute in endpoint 0, OperationalCredentials cluster is always required to be on // EP0. - MatterReportingAttributeChangeCallback(0, OperationalCredentials::Id, OperationalCredentials::Attributes::FabricsList::Id); + MatterReportingAttributeChangeCallback(0, OperationalCredentials::Id, OperationalCredentials::Attributes::Fabrics::Id); MatterReportingAttributeChangeCallback(0, OperationalCredentials::Id, OperationalCredentials::Attributes::CommissionedFabrics::Id); } @@ -419,28 +420,39 @@ bool emberAfOperationalCredentialsClusterUpdateFabricLabelCallback(app::CommandH const app::ConcreteCommandPath & commandPath, const Commands::UpdateFabricLabel::DecodableType & commandData) { - auto & Label = commandData.label; + auto & Label = commandData.label; + auto ourFabricIndex = commandObj->GetAccessingFabricIndex(); emberAfPrintln(EMBER_AF_PRINT_DEBUG, "OpCreds: UpdateFabricLabel"); - EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS; + for (auto & fabricInfo : Server::GetInstance().GetFabricTable()) + { + if (fabricInfo.GetFabricLabel().data_equal(Label) && fabricInfo.GetFabricIndex() != ourFabricIndex) + { + ChipLogError(Zcl, "Fabric label already in use"); + SendNOCResponse(commandObj, commandPath, OperationalCertStatus::kLabelConflict, ourFabricIndex, CharSpan()); + return true; + } + } + CHIP_ERROR err; // Fetch current fabric FabricInfo * fabric = RetrieveCurrentFabric(commandObj); - VerifyOrExit(fabric != nullptr, status = EMBER_ZCL_STATUS_FAILURE); + VerifyOrExit(fabric != nullptr, err = CHIP_ERROR_INVALID_FABRIC_ID); // Set Label on fabric err = fabric->SetFabricLabel(Label); - VerifyOrExit(err == CHIP_NO_ERROR, status = EMBER_ZCL_STATUS_FAILURE); + SuccessOrExit(err); // Persist updated fabric err = Server::GetInstance().GetFabricTable().Store(fabric->GetFabricIndex()); - VerifyOrExit(err == CHIP_NO_ERROR, status = EMBER_ZCL_STATUS_FAILURE); + SuccessOrExit(err); exit: fabricListChanged(); - emberAfSendImmediateDefaultResponse(status); + + SendNOCResponse(commandObj, commandPath, ConvertToNOCResponseStatus(err), ourFabricIndex, CharSpan()); return true; } diff --git a/src/app/tests/suites/TestOperationalCredentialsCluster.yaml b/src/app/tests/suites/TestOperationalCredentialsCluster.yaml index abbb09b5b0597a..12a0ee83a486b2 100644 --- a/src/app/tests/suites/TestOperationalCredentialsCluster.yaml +++ b/src/app/tests/suites/TestOperationalCredentialsCluster.yaml @@ -48,31 +48,85 @@ tests: command: "readAttribute" attribute: "CurrentFabricIndex" response: + saveAs: ourFabricIndex constraints: type: uint8 # 0 is not a valid value, but past that we have no idea what the # other side will claim here. minValue: 1 - # This test is currently disabled as it breaks on Darwin. - # The test removes the current fabric, and Darwin test runner reuses - # the same pairing to run all the tests. Due to that, all subsequent - # tests fail. - - label: "Remove fabric" - disabled: true + - label: "Remove nonexistent fabric" command: "RemoveFabric" arguments: values: - name: "FabricIndex" - value: 1 + value: 243 # Pretty unlikely to have that here! + response: + values: + - name: "StatusCode" + value: 11 # InvalidFabricIndex - - label: "Remove nonexistent fabric" - command: "RemoveFabric" + - label: "Read fabric list before setting label" + command: "readAttribute" + attribute: "Fabrics" + response: + value: [ + { + "FabricIndex": ourFabricIndex, + # Don't know what values to expect for the other bits here + "Label": "", + }, + ] + + - label: "Set the fabric label" + command: "UpdateFabricLabel" arguments: values: + - name: "Label" + value: "Batcave" + response: + values: + - name: "StatusCode" + value: 0 # Ok - name: "FabricIndex" - value: 243 # Pretty unlikely to have that here! + value: ourFabricIndex + + - label: "Read fabric list after setting label" + command: "readAttribute" + attribute: "Fabrics" + response: + value: [ + { + "FabricIndex": ourFabricIndex, + # Don't know what values to expect for the other bits here + "Label": "Batcave", + }, + ] + + # TODO: Once we can commission the device onto a second fabric + # here, try setting the fabric label from there to the same value + # and ensure it fails. + - label: "Set the fabric label" + disabled: true + command: "UpdateFabricLabel" + identity: beta + arguments: + values: + - name: "Label" + value: "Batcave" response: values: - name: "StatusCode" - value: 11 # InvalidFabricIndex + value: 10 # LabelConflict + + # This test is currently disabled as it breaks on Darwin. + # The test removes the current fabric, and Darwin test runner reuses + # the same pairing to run all the tests. Due to that, all subsequent + # tests fail. + - label: "Remove fabric" + disabled: true + command: "RemoveFabric" + arguments: + values: + - name: "FabricIndex" + value: 1 diff --git a/src/app/tests/suites/certification/Test_TC_DM_2_2.yaml b/src/app/tests/suites/certification/Test_TC_DM_2_2.yaml index 794a06f06f8890..625417b1fad81d 100644 --- a/src/app/tests/suites/certification/Test_TC_DM_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_DM_2_2.yaml @@ -53,7 +53,7 @@ tests: - label: "Query fabrics list" command: "readAttribute" - attribute: "fabrics list" + attribute: "Fabrics" response: value: [ { diff --git a/src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml index e94f3267a0b213..4e4357e3576707 100644 --- a/src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml @@ -56,7 +56,7 @@ limitations under the License. This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. NOCs - fabrics list + Fabrics SupportedFabrics CommissionedFabrics TrustedRootCertificates diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index e3053e9d2773ee..2b5d3e4552afd3 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -2738,7 +2738,7 @@ client cluster OperationalCredentials = 62 { } readonly attribute NOCStruct NOCs[] = 0; - readonly attribute FabricDescriptor fabricsList[] = 1; + readonly attribute FabricDescriptor fabrics[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index 26d17aa46772e1..d227950e7fe3b7 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -8924,8 +8924,8 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } return value; } - case Attributes::FabricsList::Id: { - using TypeInfo = Attributes::FabricsList::TypeInfo; + case Attributes::Fabrics::Id: { + using TypeInfo = Attributes::Fabrics::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) diff --git a/src/controller/java/zap-generated/CHIPCallbackTypes.h b/src/controller/java/zap-generated/CHIPCallbackTypes.h index 77924fc27e5fc7..ec1fa89f785965 100644 --- a/src/controller/java/zap-generated/CHIPCallbackTypes.h +++ b/src/controller/java/zap-generated/CHIPCallbackTypes.h @@ -953,8 +953,8 @@ typedef void (*CHIPOperationalCredentialsClusterNOCResponseCallbackType)( typedef void (*CHIPOperationalCredentialsClusterNOCsAttributeCallbackType)( void *, const chip::app::Clusters::OperationalCredentials::Attributes::NOCs::TypeInfo::DecodableType &); -typedef void (*CHIPOperationalCredentialsClusterFabricsListAttributeCallbackType)( - void *, const chip::app::Clusters::OperationalCredentials::Attributes::FabricsList::TypeInfo::DecodableType &); +typedef void (*CHIPOperationalCredentialsClusterFabricsAttributeCallbackType)( + void *, const chip::app::Clusters::OperationalCredentials::Attributes::Fabrics::TypeInfo::DecodableType &); typedef void (*CHIPOperationalCredentialsClusterSupportedFabricsAttributeCallbackType)( void *, chip::app::Clusters::OperationalCredentials::Attributes::SupportedFabrics::TypeInfo::DecodableArgType); typedef void (*CHIPOperationalCredentialsClusterCommissionedFabricsAttributeCallbackType)( diff --git a/src/controller/java/zap-generated/CHIPClusters-JNI.cpp b/src/controller/java/zap-generated/CHIPClusters-JNI.cpp index 461f549ee086d7..9678f6521aec12 100644 --- a/src/controller/java/zap-generated/CHIPClusters-JNI.cpp +++ b/src/controller/java/zap-generated/CHIPClusters-JNI.cpp @@ -23793,14 +23793,14 @@ JNI_METHOD(void, OperationalCredentialsCluster, subscribeNOCsAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OperationalCredentialsCluster, subscribeFabricsListAttribute) +JNI_METHOD(void, OperationalCredentialsCluster, subscribeFabricsAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -23817,14 +23817,14 @@ JNI_METHOD(void, OperationalCredentialsCluster, subscribeFabricsListAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::OperationalCredentials::Attributes::FabricsList::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( + using TypeInfo = chip::app::Clusters::OperationalCredentials::Attributes::Fabrics::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute( - onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), - static_cast(maxInterval), CHIPOperationalCredentialsFabricsListAttributeCallback::OnSubscriptionEstablished); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPOperationalCredentialsFabricsAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index 29cc057ebf4d67..ed55609bfaef63 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -13094,9 +13094,9 @@ void CHIPOperationalCredentialsNOCsAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPOperationalCredentialsFabricsListAttributeCallback::CHIPOperationalCredentialsFabricsListAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPOperationalCredentialsFabricsAttributeCallback::CHIPOperationalCredentialsFabricsAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -13113,7 +13113,7 @@ CHIPOperationalCredentialsFabricsListAttributeCallback::CHIPOperationalCredentia } } -CHIPOperationalCredentialsFabricsListAttributeCallback::~CHIPOperationalCredentialsFabricsListAttributeCallback() +CHIPOperationalCredentialsFabricsAttributeCallback::~CHIPOperationalCredentialsFabricsAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -13124,7 +13124,7 @@ CHIPOperationalCredentialsFabricsListAttributeCallback::~CHIPOperationalCredenti env->DeleteGlobalRef(javaCallbackRef); } -void CHIPOperationalCredentialsFabricsListAttributeCallback::CallbackFn( +void CHIPOperationalCredentialsFabricsAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList< chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> & list) @@ -13136,8 +13136,8 @@ void CHIPOperationalCredentialsFabricsListAttributeCallback::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; diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.h b/src/controller/java/zap-generated/CHIPReadCallbacks.h index 006e8e20c49810..81ded4ddfaf18d 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.h +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.h @@ -5439,20 +5439,20 @@ class CHIPOperationalCredentialsNOCsAttributeCallback bool keepAlive; }; -class CHIPOperationalCredentialsFabricsListAttributeCallback - : public chip::Callback::Callback +class CHIPOperationalCredentialsFabricsAttributeCallback + : public chip::Callback::Callback { public: - CHIPOperationalCredentialsFabricsListAttributeCallback(jobject javaCallback, bool keepAlive = false); + CHIPOperationalCredentialsFabricsAttributeCallback(jobject javaCallback, bool keepAlive = false); - ~CHIPOperationalCredentialsFabricsListAttributeCallback(); + ~CHIPOperationalCredentialsFabricsAttributeCallback(); - static void maybeDestroy(CHIPOperationalCredentialsFabricsListAttributeCallback * callback) + static void maybeDestroy(CHIPOperationalCredentialsFabricsAttributeCallback * callback) { if (!callback->keepAlive) { callback->Cancel(); - chip::Platform::Delete(callback); + chip::Platform::Delete(callback); } } @@ -5462,7 +5462,7 @@ class CHIPOperationalCredentialsFabricsListAttributeCallback 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 15bf2425642d3c..e1202054c57868 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -12825,7 +12825,7 @@ public interface NOCsAttributeCallback { default void onSubscriptionEstablished() {} } - public interface FabricsListAttributeCallback { + public interface FabricsAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); @@ -12882,13 +12882,13 @@ public void subscribeNOCsAttribute( subscribeNOCsAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readFabricsListAttribute(FabricsListAttributeCallback callback) { - readFabricsListAttribute(chipClusterPtr, callback); + public void readFabricsAttribute(FabricsAttributeCallback callback) { + readFabricsAttribute(chipClusterPtr, callback); } - public void subscribeFabricsListAttribute( - FabricsListAttributeCallback callback, int minInterval, int maxInterval) { - subscribeFabricsListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void subscribeFabricsAttribute( + FabricsAttributeCallback callback, int minInterval, int maxInterval) { + subscribeFabricsAttribute(chipClusterPtr, callback, minInterval, maxInterval); } public void readSupportedFabricsAttribute(IntegerAttributeCallback callback) { @@ -12973,14 +12973,11 @@ public void subscribeClusterRevisionAttribute( private native void subscribeNOCsAttribute( long chipClusterPtr, NOCsAttributeCallback callback, int minInterval, int maxInterval); - private native void readFabricsListAttribute( - long chipClusterPtr, FabricsListAttributeCallback callback); + private native void readFabricsAttribute( + long chipClusterPtr, FabricsAttributeCallback callback); - private native void subscribeFabricsListAttribute( - long chipClusterPtr, - FabricsListAttributeCallback callback, - int minInterval, - int maxInterval); + private native void subscribeFabricsAttribute( + long chipClusterPtr, FabricsAttributeCallback callback, int minInterval, int maxInterval); private native void readSupportedFabricsAttribute( long chipClusterPtr, IntegerAttributeCallback callback); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java index 51a4cd9294a840..e4bf136b84be5d 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java @@ -4727,8 +4727,8 @@ public void onError(Exception ex) { } } - public static class DelegatedOperationalCredentialsClusterFabricsListAttributeCallback - implements ChipClusters.OperationalCredentialsCluster.FabricsListAttributeCallback, + public static class DelegatedOperationalCredentialsClusterFabricsAttributeCallback + implements ChipClusters.OperationalCredentialsCluster.FabricsAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java index 23d6177ea8e592..10b645ad5847ca 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java @@ -5843,22 +5843,22 @@ public Map> getReadAttributeMap() { readOperationalCredentialsNOCsCommandParams); readOperationalCredentialsInteractionInfo.put( "readNOCsAttribute", readOperationalCredentialsNOCsAttributeInteractionInfo); - Map readOperationalCredentialsFabricsListCommandParams = + Map readOperationalCredentialsFabricsCommandParams = new LinkedHashMap(); - InteractionInfo readOperationalCredentialsFabricsListAttributeInteractionInfo = + InteractionInfo readOperationalCredentialsFabricsAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OperationalCredentialsCluster) cluster) - .readFabricsListAttribute( - (ChipClusters.OperationalCredentialsCluster.FabricsListAttributeCallback) + .readFabricsAttribute( + (ChipClusters.OperationalCredentialsCluster.FabricsAttributeCallback) callback); }, () -> new ClusterInfoMapping - .DelegatedOperationalCredentialsClusterFabricsListAttributeCallback(), - readOperationalCredentialsFabricsListCommandParams); + .DelegatedOperationalCredentialsClusterFabricsAttributeCallback(), + readOperationalCredentialsFabricsCommandParams); readOperationalCredentialsInteractionInfo.put( - "readFabricsListAttribute", readOperationalCredentialsFabricsListAttributeInteractionInfo); + "readFabricsAttribute", readOperationalCredentialsFabricsAttributeInteractionInfo); Map readOperationalCredentialsSupportedFabricsCommandParams = new LinkedHashMap(); InteractionInfo readOperationalCredentialsSupportedFabricsAttributeInteractionInfo = diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 603bedbe82b3a8..1bdd6dec7367e3 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -4008,7 +4008,7 @@ class ChipClusters: "reportable": True, }, 0x00000001: { - "attributeName": "FabricsList", + "attributeName": "Fabrics", "attributeId": 0x00000001, "type": "", "reportable": True, diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 06fc5ed33a85c5..7c7a07a72f5ba8 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -14043,7 +14043,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ ClusterObjectFieldDescriptor(Label="NOCs", Tag=0x00000000, Type=typing.List[OperationalCredentials.Structs.NOCStruct]), - ClusterObjectFieldDescriptor(Label="fabricsList", Tag=0x00000001, Type=typing.List[OperationalCredentials.Structs.FabricDescriptor]), + ClusterObjectFieldDescriptor(Label="fabrics", Tag=0x00000001, Type=typing.List[OperationalCredentials.Structs.FabricDescriptor]), ClusterObjectFieldDescriptor(Label="supportedFabrics", Tag=0x00000002, Type=uint), ClusterObjectFieldDescriptor(Label="commissionedFabrics", Tag=0x00000003, Type=uint), ClusterObjectFieldDescriptor(Label="trustedRootCertificates", Tag=0x00000004, Type=typing.List[bytes]), @@ -14056,7 +14056,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ]) NOCs: 'typing.List[OperationalCredentials.Structs.NOCStruct]' = None - fabricsList: 'typing.List[OperationalCredentials.Structs.FabricDescriptor]' = None + fabrics: 'typing.List[OperationalCredentials.Structs.FabricDescriptor]' = None supportedFabrics: 'uint' = None commissionedFabrics: 'uint' = None trustedRootCertificates: 'typing.List[bytes]' = None @@ -14353,7 +14353,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'typing.List[OperationalCredentials.Structs.NOCStruct]' = field(default_factory=lambda: []) @dataclass - class FabricsList(ClusterAttributeDescriptor): + class Fabrics(ClusterAttributeDescriptor): @ChipUtility.classproperty def cluster_id(cls) -> int: return 0x003E diff --git a/src/darwin/CHIPTool/CHIPTool/View Controllers/Fabric/FabricUIViewController.m b/src/darwin/CHIPTool/CHIPTool/View Controllers/Fabric/FabricUIViewController.m index 67dfa668a1dea4..3b32193c8477d2 100644 --- a/src/darwin/CHIPTool/CHIPTool/View Controllers/Fabric/FabricUIViewController.m +++ b/src/darwin/CHIPTool/CHIPTool/View Controllers/Fabric/FabricUIViewController.m @@ -230,7 +230,9 @@ - (void)fetchCommissionedFabricsNumber if (chipDevice) { CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:chipDevice endpoint:0 queue:dispatch_get_main_queue()]; - [self updateResult:[NSString stringWithFormat:@"readAttributeFabricsList command sent."] isError:NO]; + [self + updateResult:[NSString stringWithFormat:@"readAttributeCommissionedFabricsWithCompletionHandler command sent."] + isError:NO]; [cluster readAttributeCommissionedFabricsWithCompletionHandler:^( NSNumber * _Nullable commissionedFabrics, NSError * _Nullable error) { if (error) { @@ -268,17 +270,16 @@ - (void)fetchFabricsList if (chipDevice) { CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:chipDevice endpoint:0 queue:dispatch_get_main_queue()]; - [self updateResult:[NSString stringWithFormat:@"readAttributeFabricsList command sent."] isError:NO]; - [cluster readAttributeFabricsListWithCompletionHandler:^( - NSArray * _Nullable fabricsList, NSError * _Nullable error) { + [self updateResult:[NSString stringWithFormat:@"readAttributeFabrics command sent."] isError:NO]; + [cluster readAttributeFabricsWithCompletionHandler:^(NSArray * _Nullable fabricsList, NSError * _Nullable error) { if (error) { dispatch_async(dispatch_get_main_queue(), ^{ - [self updateResult:[NSString stringWithFormat:@"readAttributeFabricsList command failed: %@.", error] + [self updateResult:[NSString stringWithFormat:@"readAttributeFabrics command failed: %@.", error] isError:YES]; }); } else { dispatch_async(dispatch_get_main_queue(), ^{ - [self updateResult:[NSString stringWithFormat:@"Command readAttributeFabricsList command succeeded."] + [self updateResult:[NSString stringWithFormat:@"Command readAttributeFabrics command succeeded."] isError:NO]; }); } diff --git a/src/darwin/Framework/CHIP/templates/partials/check_test_value.zapt b/src/darwin/Framework/CHIP/templates/partials/check_test_value.zapt index 2460f9404a5627..e8eb5ac4b59b40 100644 --- a/src/darwin/Framework/CHIP/templates/partials/check_test_value.zapt +++ b/src/darwin/Framework/CHIP/templates/partials/check_test_value.zapt @@ -21,7 +21,7 @@ {{else if isArray}} XCTAssertEqual([{{actual}} count], {{expected.length}}); {{#each expected}} - {{>check_test_value actual=(concat ../actual "[" @index "]") expected=this cluster=../cluster isArray=false type=../type}} + {{>check_test_value actual=(concat ../actual "[" @index "]") expected=this cluster=../cluster isArray=false type=../type parent=../parent}} {{/each}} {{else}} {{#if_is_struct type}} diff --git a/src/darwin/Framework/CHIP/templates/partials/test_value.zapt b/src/darwin/Framework/CHIP/templates/partials/test_value.zapt index 54bc6a62846de2..faa2dd58876162 100644 --- a/src/darwin/Framework/CHIP/templates/partials/test_value.zapt +++ b/src/darwin/Framework/CHIP/templates/partials/test_value.zapt @@ -11,7 +11,7 @@ { NSMutableArray * temp_{{depth}} = [[NSMutableArray alloc] init]; {{#each definedValue}} - {{>test_value target=(concat "temp_" ../depth "[" @index "]") definedValue=this cluster=../cluster depth=(incrementDepth ../depth) type=../type isArray=false}} + {{>test_value target=(concat "temp_" ../depth "[" @index "]") definedValue=this cluster=../cluster depth=(incrementDepth ../depth) type=../type isArray=false parent=../parent}} {{/each}} {{target}} = temp_{{depth}}; } diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm index 2ff28eb89b4c20..61aa5ff19afa09 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm @@ -7462,8 +7462,8 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader value = array_0; return value; } - case Attributes::FabricsList::Id: { - using TypeInfo = Attributes::FabricsList::TypeInfo; + case Attributes::Fabrics::Id: { + using TypeInfo = Attributes::Fabrics::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm index 04ef83cd0b70f7..cb447693c75331 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm @@ -6895,7 +6895,7 @@ } } -void CHIPOperationalCredentialsFabricsListListAttributeCallbackBridge::OnSuccessFn(void * context, +void CHIPOperationalCredentialsFabricsListAttributeCallbackBridge::OnSuccessFn(void * context, const chip::app::DataModel::DecodableList< chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> & value) { @@ -6927,9 +6927,9 @@ DispatchSuccess(context, objCValue); }; -void CHIPOperationalCredentialsFabricsListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +void CHIPOperationalCredentialsFabricsListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h index a71d0a51bfc96b..16cd15d01e73ee 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h @@ -5668,28 +5668,27 @@ class CHIPOperationalCredentialsNOCsListAttributeCallbackSubscriptionBridge SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPOperationalCredentialsFabricsListListAttributeCallbackBridge - : public CHIPCallbackBridge +class CHIPOperationalCredentialsFabricsListAttributeCallbackBridge + : public CHIPCallbackBridge { public: - CHIPOperationalCredentialsFabricsListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, - keepAlive){}; + CHIPOperationalCredentialsFabricsListAttributeCallbackBridge(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< chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> & value); }; -class CHIPOperationalCredentialsFabricsListListAttributeCallbackSubscriptionBridge - : public CHIPOperationalCredentialsFabricsListListAttributeCallbackBridge +class CHIPOperationalCredentialsFabricsListAttributeCallbackSubscriptionBridge + : public CHIPOperationalCredentialsFabricsListAttributeCallbackBridge { public: - CHIPOperationalCredentialsFabricsListListAttributeCallbackSubscriptionBridge( - dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, - SubscriptionEstablishedHandler establishedHandler) : - CHIPOperationalCredentialsFabricsListListAttributeCallbackBridge(queue, handler, action, true), + CHIPOperationalCredentialsFabricsListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPOperationalCredentialsFabricsListAttributeCallbackBridge(queue, handler, action, true), mEstablishedHandler(establishedHandler) {} diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h index fe3f5fac019f0e..571f0aced07871 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h @@ -4048,12 +4048,11 @@ NS_ASSUME_NONNULL_BEGIN subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler; -- (void)readAttributeFabricsListWithCompletionHandler:(void (^)( - NSArray * _Nullable value, NSError * _Nullable error))completionHandler; -- (void)subscribeAttributeFabricsListWithMinInterval:(NSNumber * _Nonnull)minInterval - maxInterval:(NSNumber * _Nonnull)maxInterval - subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler; +- (void)readAttributeFabricsWithCompletionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler; +- (void)subscribeAttributeFabricsWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler; - (void)readAttributeSupportedFabricsWithCompletionHandler:(void (^)(NSNumber * _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 e29668b50fc961..eaa6d332b95d55 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm @@ -16913,32 +16913,31 @@ new CHIPOperationalCredentialsNOCsListAttributeCallbackSubscriptionBridge( subscriptionEstablishedHandler); } -- (void)readAttributeFabricsListWithCompletionHandler:(void (^)( - NSArray * _Nullable value, NSError * _Nullable error))completionHandler +- (void)readAttributeFabricsWithCompletionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPOperationalCredentialsFabricsListListAttributeCallbackBridge( + new CHIPOperationalCredentialsFabricsListAttributeCallbackBridge( self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = OperationalCredentials::Attributes::FabricsList::TypeInfo; - auto successFn = Callback::FromCancelable(success); + using TypeInfo = OperationalCredentials::Attributes::Fabrics::TypeInfo; + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)subscribeAttributeFabricsListWithMinInterval:(NSNumber * _Nonnull)minInterval - maxInterval:(NSNumber * _Nonnull)maxInterval - subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +- (void)subscribeAttributeFabricsWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler { - new CHIPOperationalCredentialsFabricsListListAttributeCallbackSubscriptionBridge( + new CHIPOperationalCredentialsFabricsListAttributeCallbackSubscriptionBridge( self.callbackQueue, reportHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = OperationalCredentials::Attributes::FabricsList::TypeInfo; - auto successFn = Callback::FromCancelable(success); + using TypeInfo = OperationalCredentials::Attributes::Fabrics::TypeInfo; + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, [minInterval unsignedShortValue], [maxInterval unsignedShortValue], - CHIPOperationalCredentialsFabricsListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); + CHIPOperationalCredentialsFabricsListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); }, subscriptionEstablishedHandler); } diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h index a2408cae1d37b3..bc9d49f3e43a51 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h @@ -877,7 +877,7 @@ NS_ASSUME_NONNULL_BEGIN @interface CHIPTestOperationalCredentials : CHIPOperationalCredentials - (void)writeAttributeNOCsWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeFabricsListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFabricsWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeSupportedFabricsWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeCommissionedFabricsWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeTrustedRootCertificatesWithValue:(NSArray * _Nonnull)value diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm index 8f12cc0898fa98..3e0e4d17486cc8 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm @@ -10416,7 +10416,7 @@ new CHIPDefaultSuccessCallbackBridge( }); } -- (void)writeAttributeFabricsListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeFabricsWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -10425,7 +10425,7 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = OperationalCredentials::Attributes::FabricsList::TypeInfo; + using TypeInfo = OperationalCredentials::Attributes::Fabrics::TypeInfo; TypeInfo::Type cppValue; { using ListType_0 = std::remove_reference_t; diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index a2168493d9b8aa..7f279c636e2693 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -44608,6 +44608,7 @@ - (void)testSendClusterTestOperationalCredentialsCluster_000002_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +NSNumber * _Nonnull ourFabricIndex; - (void)testSendClusterTestOperationalCredentialsCluster_000003_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read current fabric index"]; @@ -44630,6 +44631,10 @@ - (void)testSendClusterTestOperationalCredentialsCluster_000003_ReadAttribute XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 1); } } + { + id actualValue = value; + ourFabricIndex = actualValue; + } [expectation fulfill]; }]; @@ -44666,6 +44671,99 @@ - (void)testSendClusterTestOperationalCredentialsCluster_000004_RemoveFabric [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterTestOperationalCredentialsCluster_000005_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read fabric list before setting label"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeFabricsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read fabric list before setting label Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue count], 1); + XCTAssertEqualObjects( + ((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[0]).fabricIndex, ourFabricIndex); + XCTAssertTrue([((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[0]).label isEqualToString:@""]); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestOperationalCredentialsCluster_000006_UpdateFabricLabel +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Set the fabric label"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + __auto_type * params = [[CHIPOperationalCredentialsClusterUpdateFabricLabelParams alloc] init]; + params.label = @"Batcave"; + [cluster updateFabricLabelWithParams:params + completionHandler:^( + CHIPOperationalCredentialsClusterNOCResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Set the fabric label Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = values.statusCode; + XCTAssertEqual([actualValue unsignedCharValue], 0); + } + { + id actualValue = values.fabricIndex; + XCTAssertEqualObjects(actualValue, ourFabricIndex); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestOperationalCredentialsCluster_000007_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read fabric list after setting label"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeFabricsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read fabric list after setting label Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue count], 1); + XCTAssertEqualObjects( + ((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[0]).fabricIndex, ourFabricIndex); + XCTAssertTrue( + [((CHIPOperationalCredentialsClusterFabricDescriptor *) actualValue[0]).label isEqualToString:@"Batcave"]); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} - (void)testSendClusterTestModeSelectCluster_000000_WaitForCommissionee { 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 3f3fc1bd514569..d1d759a3979b3e 100644 --- a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h +++ b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h @@ -1730,7 +1730,7 @@ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* fabrics list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* Fabrics */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SupportedFabrics */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* CommissionedFabrics */ \ { 0x00000004, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ 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 6c2742ceb7d3c9..1851b2e478dafb 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 @@ -10742,8 +10742,8 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre case Attributes::NOCs::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, NOCs)); break; - case Attributes::FabricsList::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, fabricsList)); + case Attributes::Fabrics::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, fabrics)); break; case Attributes::SupportedFabrics::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, supportedFabrics)); 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 3fbcea3260c10c..ab687e0c3673fb 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 @@ -16355,7 +16355,7 @@ struct TypeInfo static constexpr bool MustUseTimedWrite() { return false; } }; } // namespace NOCs -namespace FabricsList { +namespace Fabrics { struct TypeInfo { using Type = chip::app::DataModel::List; @@ -16365,10 +16365,10 @@ struct TypeInfo chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> &; static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::FabricsList::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::Fabrics::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; -} // namespace FabricsList +} // namespace Fabrics namespace SupportedFabrics { struct TypeInfo { @@ -16487,7 +16487,7 @@ struct TypeInfo CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); Attributes::NOCs::TypeInfo::DecodableType NOCs; - Attributes::FabricsList::TypeInfo::DecodableType fabricsList; + Attributes::Fabrics::TypeInfo::DecodableType fabrics; Attributes::SupportedFabrics::TypeInfo::DecodableType supportedFabrics = static_cast(0); Attributes::CommissionedFabrics::TypeInfo::DecodableType commissionedFabrics = static_cast(0); Attributes::TrustedRootCertificates::TypeInfo::DecodableType trustedRootCertificates; 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 255f8256af8f78..93e4e165f823c0 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 @@ -2396,9 +2396,9 @@ namespace NOCs { static constexpr AttributeId Id = 0x00000000; } // namespace NOCs -namespace FabricsList { +namespace Fabrics { static constexpr AttributeId Id = 0x00000001; -} // namespace FabricsList +} // namespace Fabrics namespace SupportedFabrics { static constexpr AttributeId Id = 0x00000002; diff --git a/zzz_generated/bridge-app/zap-generated/endpoint_config.h b/zzz_generated/bridge-app/zap-generated/endpoint_config.h index db44cd9ea2281a..305fddc4304f0e 100644 --- a/zzz_generated/bridge-app/zap-generated/endpoint_config.h +++ b/zzz_generated/bridge-app/zap-generated/endpoint_config.h @@ -827,7 +827,7 @@ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* fabrics list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* Fabrics */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SupportedFabrics */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* CommissionedFabrics */ \ { 0x00000004, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index d7d44f4ce10e34..2caeb898dd4aec 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -5487,7 +5487,7 @@ class AdministratorCommissioningRevokeCommissioning : public ClusterCommand |------------------------------------------------------------------------------| | Attributes: | | | * NOCs | 0x0000 | -| * FabricsList | 0x0001 | +| * Fabrics | 0x0001 | | * SupportedFabrics | 0x0002 | | * CommissionedFabrics | 0x0003 | | * TrustedRootCertificates | 0x0004 | @@ -18422,7 +18422,7 @@ void registerClusterOperationalCredentials(Commands & commands, CredentialIssuer // make_unique(Id, credsIssuerConfig), // make_unique(Id, "nocs", Attributes::NOCs::Id, credsIssuerConfig), // - make_unique(Id, "fabrics-list", Attributes::FabricsList::Id, credsIssuerConfig), // + make_unique(Id, "fabrics", Attributes::Fabrics::Id, credsIssuerConfig), // make_unique(Id, "supported-fabrics", Attributes::SupportedFabrics::Id, credsIssuerConfig), // make_unique(Id, "commissioned-fabrics", Attributes::CommissionedFabrics::Id, credsIssuerConfig), // make_unique(Id, "trusted-root-certificates", Attributes::TrustedRootCertificates::Id, credsIssuerConfig), // @@ -18437,7 +18437,7 @@ void registerClusterOperationalCredentials(Commands & commands, CredentialIssuer make_unique(Id, credsIssuerConfig), // make_unique(Id, credsIssuerConfig), // make_unique(Id, "nocs", Attributes::NOCs::Id, credsIssuerConfig), // - make_unique(Id, "fabrics-list", Attributes::FabricsList::Id, credsIssuerConfig), // + make_unique(Id, "fabrics", Attributes::Fabrics::Id, credsIssuerConfig), // make_unique(Id, "supported-fabrics", Attributes::SupportedFabrics::Id, credsIssuerConfig), // make_unique(Id, "commissioned-fabrics", Attributes::CommissionedFabrics::Id, credsIssuerConfig), // make_unique(Id, "trusted-root-certificates", Attributes::TrustedRootCertificates::Id, diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index a698c4dd14a524..afc7f8f8b16184 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -7481,12 +7481,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("NOCs", 1, value); } - case OperationalCredentials::Attributes::FabricsList::Id: { + case OperationalCredentials::Attributes::Fabrics::Id: { chip::app::DataModel::DecodableList< chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("fabrics list", 1, value); + return DataModelLogger::LogValue("Fabrics", 1, value); } case OperationalCredentials::Attributes::SupportedFabrics::Id: { uint8_t value; diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 7a1e1ef3ba9815..d29552ae3bc798 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -19089,9 +19089,9 @@ class Test_TC_DM_2_2 : public TestCommand static void OnSuccessCallback_1(void * context, const chip::app::DataModel::DecodableList< - chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> & fabricsList) + chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> & fabrics) { - (static_cast(context))->OnSuccessResponse_1(fabricsList); + (static_cast(context))->OnSuccessResponse_1(fabrics); } static void OnFailureCallback_2(void * context, CHIP_ERROR error) @@ -19141,7 +19141,7 @@ class Test_TC_DM_2_2 : public TestCommand chip::Controller::OperationalCredentialsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( + ReturnErrorOnFailure(cluster.ReadAttribute( this, OnSuccessCallback_1, OnFailureCallback_1)); return CHIP_NO_ERROR; } @@ -19153,15 +19153,15 @@ class Test_TC_DM_2_2 : public TestCommand } void OnSuccessResponse_1(const chip::app::DataModel::DecodableList< - chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> & fabricsList) + chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> & fabrics) { { - auto iter_0 = fabricsList.begin(); - VerifyOrReturn(CheckNextListItemDecodes("fabricsList", iter_0, 0)); - VerifyOrReturn(CheckValueAsString("fabricsList[0].label", iter_0.GetValue().label, chip::CharSpan("", 0))); - VerifyOrReturn(CheckNoMoreListItems("fabricsList", iter_0, 1)); + auto iter_0 = fabrics.begin(); + VerifyOrReturn(CheckNextListItemDecodes("fabrics", iter_0, 0)); + VerifyOrReturn(CheckValueAsString("fabrics[0].label", iter_0.GetValue().label, chip::CharSpan("", 0))); + VerifyOrReturn(CheckNoMoreListItems("fabrics", iter_0, 1)); } - VerifyOrReturn(CheckConstraintType("fabricsList", "", "list")); + VerifyOrReturn(CheckConstraintType("fabrics", "", "list")); NextTest(); } @@ -77196,6 +77196,18 @@ class TestOperationalCredentialsCluster : public TestCommand ChipLogProgress(chipTool, " ***** Test Step 4 : Remove nonexistent fabric\n"); err = TestRemoveNonexistentFabric_4(); break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read fabric list before setting label\n"); + err = TestReadFabricListBeforeSettingLabel_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Set the fabric label\n"); + err = TestSetTheFabricLabel_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read fabric list after setting label\n"); + err = TestReadFabricListAfterSettingLabel_7(); + break; } if (CHIP_NO_ERROR != err) @@ -77207,12 +77219,14 @@ class TestOperationalCredentialsCluster : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; + const uint16_t mTestCount = 8; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; + chip::FabricIndex ourFabricIndex; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override { bool isExpectedDnssdResult = false; @@ -77251,6 +77265,32 @@ class TestOperationalCredentialsCluster : public TestCommand (static_cast(context))->OnSuccessResponse_3(currentFabricIndex); } + static void OnFailureCallback_5(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_5(error); + } + + static void + OnSuccessCallback_5(void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> & fabrics) + { + (static_cast(context))->OnSuccessResponse_5(fabrics); + } + + static void OnFailureCallback_7(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_7(error); + } + + static void + OnSuccessCallback_7(void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> & fabrics) + { + (static_cast(context))->OnSuccessResponse_7(fabrics); + } + // // Tests methods // @@ -77333,6 +77373,7 @@ class TestOperationalCredentialsCluster : public TestCommand { VerifyOrReturn(CheckConstraintType("currentFabricIndex", "", "uint8")); VerifyOrReturn(CheckConstraintMinValue("currentFabricIndex", currentFabricIndex, 1)); + ourFabricIndex = currentFabricIndex; NextTest(); } @@ -77371,6 +77412,107 @@ class TestOperationalCredentialsCluster : public TestCommand NextTest(); } + + CHIP_ERROR TestReadFabricListBeforeSettingLabel_5() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::OperationalCredentialsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_5, OnFailureCallback_5)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_5(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_5(const chip::app::DataModel::DecodableList< + chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> & fabrics) + { + { + auto iter_0 = fabrics.begin(); + VerifyOrReturn(CheckNextListItemDecodes("fabrics", iter_0, 0)); + VerifyOrReturn(CheckValue("fabrics[0].fabricIndex", iter_0.GetValue().fabricIndex, ourFabricIndex)); + VerifyOrReturn(CheckValueAsString("fabrics[0].label", iter_0.GetValue().label, chip::CharSpan("", 0))); + VerifyOrReturn(CheckNoMoreListItems("fabrics", iter_0, 1)); + } + + NextTest(); + } + + CHIP_ERROR TestSetTheFabricLabel_6() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + using RequestType = chip::app::Clusters::OperationalCredentials::Commands::UpdateFabricLabel::Type; + + RequestType request; + request.label = chip::Span("Batcavegarbage: not in length on purpose", 7); + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context)) + ->OnSuccessResponse_6(data.statusCode, data.fabricIndex, data.debugText); + }; + + auto failure = [](void * context, CHIP_ERROR error) { + (static_cast(context))->OnFailureResponse_6(error); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_6(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_6(chip::app::Clusters::OperationalCredentials::OperationalCertStatus statusCode, + const chip::Optional & fabricIndex, + const chip::Optional & debugText) + { + VerifyOrReturn(CheckValue("statusCode", statusCode, 0)); + + VerifyOrReturn(CheckValuePresent("fabricIndex", fabricIndex)); + VerifyOrReturn(CheckValue("fabricIndex.Value()", fabricIndex.Value(), ourFabricIndex)); + + NextTest(); + } + + CHIP_ERROR TestReadFabricListAfterSettingLabel_7() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::OperationalCredentialsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_7, OnFailureCallback_7)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_7(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_7(const chip::app::DataModel::DecodableList< + chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> & fabrics) + { + { + auto iter_0 = fabrics.begin(); + VerifyOrReturn(CheckNextListItemDecodes("fabrics", iter_0, 0)); + VerifyOrReturn(CheckValue("fabrics[0].fabricIndex", iter_0.GetValue().fabricIndex, ourFabricIndex)); + VerifyOrReturn(CheckValueAsString("fabrics[0].label", iter_0.GetValue().label, chip::CharSpan("Batcave", 7))); + VerifyOrReturn(CheckNoMoreListItems("fabrics", iter_0, 1)); + } + + NextTest(); + } }; class TestModeSelectCluster : public TestCommand diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h index 4aa7eb72926196..9f5014e0660bd8 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h @@ -760,10 +760,10 @@ typedef void (*OperationalCredentialsNOCsListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -void OperationalCredentialsClusterFabricsListListAttributeFilter(chip::TLV::TLVReader * data, - chip::Callback::Cancelable * onSuccessCallback, - chip::Callback::Cancelable * onFailureCallback); -typedef void (*OperationalCredentialsFabricsListListAttributeCallback)( +void OperationalCredentialsClusterFabricsListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*OperationalCredentialsFabricsListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList< chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> & data); diff --git a/zzz_generated/door-lock-app/zap-generated/endpoint_config.h b/zzz_generated/door-lock-app/zap-generated/endpoint_config.h index 95a6a19425fc50..2c312998d9f28c 100644 --- a/zzz_generated/door-lock-app/zap-generated/endpoint_config.h +++ b/zzz_generated/door-lock-app/zap-generated/endpoint_config.h @@ -833,7 +833,7 @@ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* fabrics list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* Fabrics */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SupportedFabrics */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* CommissionedFabrics */ \ { 0x00000004, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ diff --git a/zzz_generated/light-switch-app/zap-generated/endpoint_config.h b/zzz_generated/light-switch-app/zap-generated/endpoint_config.h index 5dc3f60412862e..023e6dc4018ed8 100644 --- a/zzz_generated/light-switch-app/zap-generated/endpoint_config.h +++ b/zzz_generated/light-switch-app/zap-generated/endpoint_config.h @@ -738,7 +738,7 @@ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* fabrics list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* Fabrics */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SupportedFabrics */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* CommissionedFabrics */ \ { 0x00000004, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ diff --git a/zzz_generated/lighting-app/zap-generated/endpoint_config.h b/zzz_generated/lighting-app/zap-generated/endpoint_config.h index 8fcbb842bda988..58d1b44319ea0f 100644 --- a/zzz_generated/lighting-app/zap-generated/endpoint_config.h +++ b/zzz_generated/lighting-app/zap-generated/endpoint_config.h @@ -799,7 +799,7 @@ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* fabrics list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* Fabrics */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SupportedFabrics */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* CommissionedFabrics */ \ { 0x00000004, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ diff --git a/zzz_generated/lock-app/zap-generated/endpoint_config.h b/zzz_generated/lock-app/zap-generated/endpoint_config.h index 07cc8a26cd687c..f0df9717e19a15 100644 --- a/zzz_generated/lock-app/zap-generated/endpoint_config.h +++ b/zzz_generated/lock-app/zap-generated/endpoint_config.h @@ -823,7 +823,7 @@ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* fabrics list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* Fabrics */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SupportedFabrics */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* CommissionedFabrics */ \ { 0x00000004, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ diff --git a/zzz_generated/log-source-app/zap-generated/endpoint_config.h b/zzz_generated/log-source-app/zap-generated/endpoint_config.h index dd5cd41208ab16..bcd76b2aeb2757 100644 --- a/zzz_generated/log-source-app/zap-generated/endpoint_config.h +++ b/zzz_generated/log-source-app/zap-generated/endpoint_config.h @@ -97,7 +97,7 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* fabrics list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* Fabrics */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SupportedFabrics */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* CommissionedFabrics */ \ { 0x00000004, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ diff --git a/zzz_generated/ota-provider-app/zap-generated/endpoint_config.h b/zzz_generated/ota-provider-app/zap-generated/endpoint_config.h index 5d19a98149c6ca..ba2fc047e2b80e 100644 --- a/zzz_generated/ota-provider-app/zap-generated/endpoint_config.h +++ b/zzz_generated/ota-provider-app/zap-generated/endpoint_config.h @@ -214,7 +214,7 @@ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* fabrics list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* Fabrics */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SupportedFabrics */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* CommissionedFabrics */ \ { 0x00000004, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ diff --git a/zzz_generated/ota-requestor-app/zap-generated/endpoint_config.h b/zzz_generated/ota-requestor-app/zap-generated/endpoint_config.h index 119f0de2b2fae6..35a35e06e1d5be 100644 --- a/zzz_generated/ota-requestor-app/zap-generated/endpoint_config.h +++ b/zzz_generated/ota-requestor-app/zap-generated/endpoint_config.h @@ -219,7 +219,7 @@ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* fabrics list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* Fabrics */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SupportedFabrics */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* CommissionedFabrics */ \ { 0x00000004, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ diff --git a/zzz_generated/placeholder/app1/zap-generated/CHIPClientCallbacks.h b/zzz_generated/placeholder/app1/zap-generated/CHIPClientCallbacks.h index b5fff234b6e560..ff7772f2fa8297 100644 --- a/zzz_generated/placeholder/app1/zap-generated/CHIPClientCallbacks.h +++ b/zzz_generated/placeholder/app1/zap-generated/CHIPClientCallbacks.h @@ -31,10 +31,10 @@ #include // List specific responses -void OperationalCredentialsClusterFabricsListListAttributeFilter(chip::TLV::TLVReader * data, - chip::Callback::Cancelable * onSuccessCallback, - chip::Callback::Cancelable * onFailureCallback); -typedef void (*OperationalCredentialsFabricsListListAttributeCallback)( +void OperationalCredentialsClusterFabricsListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*OperationalCredentialsFabricsListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList< chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> & data); diff --git a/zzz_generated/placeholder/app1/zap-generated/endpoint_config.h b/zzz_generated/placeholder/app1/zap-generated/endpoint_config.h index 15f097cc2bb075..f09e9fcb828adf 100644 --- a/zzz_generated/placeholder/app1/zap-generated/endpoint_config.h +++ b/zzz_generated/placeholder/app1/zap-generated/endpoint_config.h @@ -177,7 +177,7 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* fabrics list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* Fabrics */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SupportedFabrics */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* CommissionedFabrics */ \ { 0x00000004, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ diff --git a/zzz_generated/placeholder/app2/zap-generated/CHIPClientCallbacks.h b/zzz_generated/placeholder/app2/zap-generated/CHIPClientCallbacks.h index b5fff234b6e560..ff7772f2fa8297 100644 --- a/zzz_generated/placeholder/app2/zap-generated/CHIPClientCallbacks.h +++ b/zzz_generated/placeholder/app2/zap-generated/CHIPClientCallbacks.h @@ -31,10 +31,10 @@ #include // List specific responses -void OperationalCredentialsClusterFabricsListListAttributeFilter(chip::TLV::TLVReader * data, - chip::Callback::Cancelable * onSuccessCallback, - chip::Callback::Cancelable * onFailureCallback); -typedef void (*OperationalCredentialsFabricsListListAttributeCallback)( +void OperationalCredentialsClusterFabricsListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*OperationalCredentialsFabricsListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList< chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> & data); diff --git a/zzz_generated/placeholder/app2/zap-generated/endpoint_config.h b/zzz_generated/placeholder/app2/zap-generated/endpoint_config.h index 15f097cc2bb075..f09e9fcb828adf 100644 --- a/zzz_generated/placeholder/app2/zap-generated/endpoint_config.h +++ b/zzz_generated/placeholder/app2/zap-generated/endpoint_config.h @@ -177,7 +177,7 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* fabrics list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* Fabrics */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SupportedFabrics */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* CommissionedFabrics */ \ { 0x00000004, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ diff --git a/zzz_generated/pump-app/zap-generated/endpoint_config.h b/zzz_generated/pump-app/zap-generated/endpoint_config.h index eb388bd25ac7e2..50893d0f3ce082 100644 --- a/zzz_generated/pump-app/zap-generated/endpoint_config.h +++ b/zzz_generated/pump-app/zap-generated/endpoint_config.h @@ -669,7 +669,7 @@ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* fabrics list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* Fabrics */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SupportedFabrics */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* CommissionedFabrics */ \ { 0x00000004, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ diff --git a/zzz_generated/pump-controller-app/zap-generated/endpoint_config.h b/zzz_generated/pump-controller-app/zap-generated/endpoint_config.h index dc56ef2c0f45fd..56b837c9932708 100644 --- a/zzz_generated/pump-controller-app/zap-generated/endpoint_config.h +++ b/zzz_generated/pump-controller-app/zap-generated/endpoint_config.h @@ -771,7 +771,7 @@ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* fabrics list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* Fabrics */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SupportedFabrics */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* CommissionedFabrics */ \ { 0x00000004, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ diff --git a/zzz_generated/temperature-measurement-app/zap-generated/endpoint_config.h b/zzz_generated/temperature-measurement-app/zap-generated/endpoint_config.h index b30ddd9bec4518..f033d5ccd468b4 100644 --- a/zzz_generated/temperature-measurement-app/zap-generated/endpoint_config.h +++ b/zzz_generated/temperature-measurement-app/zap-generated/endpoint_config.h @@ -425,7 +425,7 @@ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* fabrics list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* Fabrics */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SupportedFabrics */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* CommissionedFabrics */ \ { 0x00000004, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ diff --git a/zzz_generated/thermostat/zap-generated/endpoint_config.h b/zzz_generated/thermostat/zap-generated/endpoint_config.h index f0aade205b4379..d36db33eb25674 100644 --- a/zzz_generated/thermostat/zap-generated/endpoint_config.h +++ b/zzz_generated/thermostat/zap-generated/endpoint_config.h @@ -875,7 +875,7 @@ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* fabrics list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* Fabrics */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SupportedFabrics */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* CommissionedFabrics */ \ { 0x00000004, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ diff --git a/zzz_generated/tv-app/zap-generated/CHIPClientCallbacks.h b/zzz_generated/tv-app/zap-generated/CHIPClientCallbacks.h index 7034c1c80aac5a..79ed9e6cd56dfc 100644 --- a/zzz_generated/tv-app/zap-generated/CHIPClientCallbacks.h +++ b/zzz_generated/tv-app/zap-generated/CHIPClientCallbacks.h @@ -45,10 +45,10 @@ typedef void (*OperationalCredentialsNOCsListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -void OperationalCredentialsClusterFabricsListListAttributeFilter(chip::TLV::TLVReader * data, - chip::Callback::Cancelable * onSuccessCallback, - chip::Callback::Cancelable * onFailureCallback); -typedef void (*OperationalCredentialsFabricsListListAttributeCallback)( +void OperationalCredentialsClusterFabricsListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*OperationalCredentialsFabricsListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList< chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> & data); diff --git a/zzz_generated/tv-app/zap-generated/endpoint_config.h b/zzz_generated/tv-app/zap-generated/endpoint_config.h index b8f42effad0bd7..baebe72b432e0d 100644 --- a/zzz_generated/tv-app/zap-generated/endpoint_config.h +++ b/zzz_generated/tv-app/zap-generated/endpoint_config.h @@ -1219,7 +1219,7 @@ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* fabrics list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* Fabrics */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SupportedFabrics */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* CommissionedFabrics */ \ { 0x00000004, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ 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 a13e3c28cbf321..012ad542177aa3 100644 --- a/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h +++ b/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h @@ -1082,7 +1082,7 @@ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* fabrics list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* Fabrics */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SupportedFabrics */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* CommissionedFabrics */ \ { 0x00000004, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ diff --git a/zzz_generated/window-app/zap-generated/endpoint_config.h b/zzz_generated/window-app/zap-generated/endpoint_config.h index 8cbdddfb3184fb..cdb7a2495dcc65 100644 --- a/zzz_generated/window-app/zap-generated/endpoint_config.h +++ b/zzz_generated/window-app/zap-generated/endpoint_config.h @@ -822,7 +822,7 @@ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* fabrics list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* Fabrics */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SupportedFabrics */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* CommissionedFabrics */ \ { 0x00000004, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \