diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index 9b5ef11f101753..e61c272394d9c9 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -88,5 +88,5 @@ "commandDiscovery": true } }, - "defaultReportable": true + "defaultReportingPolicy": "mandatory" } diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index dca196240a3623..e0f680cd02eca2 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -2319,7 +2319,7 @@ client cluster OperationalCredentials = 62 { CHAR_STRING label = 5; } - readonly nosubscribe attribute NOCStruct NOCs[] = 0; + readonly attribute NOCStruct NOCs[] = 0; readonly attribute FabricDescriptor fabricsList[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 0677aec9022146..c7b3f385f881ac 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -3321,6 +3321,7 @@ class ChipClusters: "attributeName": "NOCs", "attributeId": 0x00000000, "type": "", + "reportable": True, }, 0x00000001: { "attributeName": "FabricsList", diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h index 64cfc7056c090f..ede0e44a6d1345 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h @@ -3104,6 +3104,10 @@ NS_ASSUME_NONNULL_BEGIN NSError * _Nullable error))completionHandler; - (void)readAttributeNOCsWithCompletionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler; +- (void)subscribeAttributeNOCsWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler; - (void)readAttributeFabricsListWithCompletionHandler:(void (^)( NSArray * _Nullable value, NSError * _Nullable error))completionHandler; diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm index 9eaee739ff51d5..e422b9b0eeccc5 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm @@ -12969,6 +12969,24 @@ new CHIPOperationalCredentialsNOCsListAttributeCallbackBridge( }); } +- (void)subscribeAttributeNOCsWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + new CHIPOperationalCredentialsNOCsListAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = OperationalCredentials::Attributes::NOCs::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + minInterval, maxInterval, + CHIPOperationalCredentialsNOCsListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); + }, + subscriptionEstablishedHandler); +} + - (void)readAttributeFabricsListWithCompletionHandler:(void (^)( NSArray * _Nullable value, NSError * _Nullable error))completionHandler { diff --git a/third_party/zap/repo b/third_party/zap/repo index d57a2656ed73c1..1f8065a628fbe9 160000 --- a/third_party/zap/repo +++ b/third_party/zap/repo @@ -1 +1 @@ -Subproject commit d57a2656ed73c12a72e393ab65cb0a729b9593a9 +Subproject commit 1f8065a628fbe9c9b01a1070755f43ac0985dc5b diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 7cf3c6f4105a1e..f9f86d8f9f51e2 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -32787,6 +32787,51 @@ class ReadOperationalCredentialsNOCs : public ModelCommand } }; +class ReportOperationalCredentialsNOCs : public ModelCommand +{ +public: + ReportOperationalCredentialsNOCs() : ModelCommand("report") + { + AddArgument("attr-name", "nocs"); + AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); + AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); + AddArgument("wait", 0, 1, &mWait); + ModelCommand::AddArguments(); + } + + ~ReportOperationalCredentialsNOCs() {} + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x003E) ReportAttribute on endpoint %" PRIu8, endpointId); + + chip::Controller::OperationalCredentialsCluster cluster; + cluster.Associate(device, endpointId); + + auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; + return cluster.SubscribeAttribute( + this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } + + static void OnValueReport( + void * context, + const chip::app::DataModel::DecodableList & + value) + { + LogValue("OperationalCredentials.NOCs report", 0, value); + } + +private: + uint16_t mMinInterval; + uint16_t mMaxInterval; + bool mWait; +}; + /* * Attribute FabricsList */ @@ -61385,6 +61430,7 @@ void registerClusterOperationalCredentials(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), //