diff --git a/examples/darwin-framework-tool/templates/commands.zapt b/examples/darwin-framework-tool/templates/commands.zapt index 6a969072384e6d..0b6f7367cb3d98 100644 --- a/examples/darwin-framework-tool/templates/commands.zapt +++ b/examples/darwin-framework-tool/templates/commands.zapt @@ -18,6 +18,7 @@ {{> clusters_header}} {{#chip_client_clusters includeAll=true}} +{{#unless (wasRemoved (asUpperCamelCase name preserveAcronyms=true))}} {{> cluster_header}} {{#chip_cluster_commands}} @@ -92,6 +93,7 @@ private: {{/chip_cluster_commands}} {{#chip_server_cluster_attributes}} +{{#unless (wasRemoved (asUpperCamelCase parent.name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true))}} {{#*inline "cluster"}}Cluster{{asUpperCamelCase parent.name preserveAcronyms=true}}{{/inline}} {{#*inline "attribute"}}Attribute{{asUpperCamelCase name preserveAcronyms=true}}{{/inline}} @@ -243,13 +245,16 @@ public: }; {{/if}} +{{/unless}} {{/chip_server_cluster_attributes}} +{{/unless}} {{/chip_client_clusters}} /*----------------------------------------------------------------------------*\ | Register all Clusters commands | \*----------------------------------------------------------------------------*/ {{#chip_client_clusters includeAll=true}} +{{#unless (wasRemoved (asUpperCamelCase name preserveAcronyms=true))}} void registerCluster{{asUpperCamelCase name}}(Commands & commands) { using namespace chip::app::Clusters::{{asUpperCamelCase name}}; @@ -267,24 +272,31 @@ void registerCluster{{asUpperCamelCase name}}(Commands & commands) {{#first}} make_unique(Id), // {{/first}} + {{#unless (wasRemoved (asUpperCamelCase parent.name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true))}} make_unique(), // + {{/unless}} {{#first}} make_unique(Id), // {{/first}} + {{#unless (wasRemoved (asUpperCamelCase parent.name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true))}} {{#if isWritableAttribute}} make_unique(), // {{/if}} + {{/unless}} {{#first}} make_unique(Id), // {{/first}} + {{#unless (wasRemoved (asUpperCamelCase parent.name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true))}} {{#if isReportableAttribute}} make_unique(), // {{/if}} + {{/unless}} {{/chip_server_cluster_attributes}} }; commands.Register(clusterName, clusterCommands); } +{{/unless}} {{/chip_client_clusters}} void registerClusterAny(Commands & commands) @@ -306,6 +318,8 @@ void registerClusters(Commands & commands) { registerClusterAny(commands); {{#chip_client_clusters includeAll=true}} + {{#unless (wasRemoved (asUpperCamelCase name preserveAcronyms=true))}} registerCluster{{asUpperCamelCase name}}(commands); + {{/unless}} {{/chip_client_clusters}} } diff --git a/examples/darwin-framework-tool/templates/tests/ciTests.json b/examples/darwin-framework-tool/templates/tests/ciTests.json index bc93afef772ff6..77f97d3ce7e0a3 100644 --- a/examples/darwin-framework-tool/templates/tests/ciTests.json +++ b/examples/darwin-framework-tool/templates/tests/ciTests.json @@ -1,6 +1,7 @@ { "include": "../../../../src/app/tests/suites/ciTests.json", "disable": [ + "TestClientMonitoringCluster", "Test_TC_SC_4_2", "TestClusterComplexTypes", "TestEvents", diff --git a/src/darwin/Framework/CHIP/templates/MTRAttributeTLVValueDecoder-src.zapt b/src/darwin/Framework/CHIP/templates/MTRAttributeTLVValueDecoder-src.zapt index b79fa746c2bea3..3b28b6e15651d1 100644 --- a/src/darwin/Framework/CHIP/templates/MTRAttributeTLVValueDecoder-src.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRAttributeTLVValueDecoder-src.zapt @@ -19,11 +19,13 @@ id MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader & switch (aPath.mClusterId) { {{#chip_client_clusters includeAll=true}} + {{#unless (wasRemoved (asUpperCamelCase name preserveAcronyms=true))}} case Clusters::{{asUpperCamelCase name}}::Id: { using namespace Clusters::{{asUpperCamelCase name}}; switch (aPath.mAttributeId) { {{#chip_server_cluster_attributes}} + {{#unless (wasRemoved (asUpperCamelCase ../name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true))}} case Attributes::{{asUpperCamelCase name}}::Id: { using TypeInfo = Attributes::{{asUpperCamelCase name}}::TypeInfo; TypeInfo::DecodableType cppValue; @@ -36,6 +38,7 @@ id MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader & {{>decode_value target="value" source="cppValue" cluster=parent.name errorCode="*aError = err; return nil;" depth=0}} return value; } + {{/unless}} {{/chip_server_cluster_attributes}} default: *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; @@ -43,6 +46,7 @@ id MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader & } break; } + {{/unless}} {{/chip_client_clusters}} default: { *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; diff --git a/src/darwin/Framework/CHIP/templates/MTRBaseClusters-src.zapt b/src/darwin/Framework/CHIP/templates/MTRBaseClusters-src.zapt index 39163d92e437c3..14bc90e2fc47e4 100644 --- a/src/darwin/Framework/CHIP/templates/MTRBaseClusters-src.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRBaseClusters-src.zapt @@ -23,6 +23,7 @@ using chip::SessionHandle; // NOLINTBEGIN(clang-analyzer-cplusplus.NewDeleteLeaks): Linter is unable to locate the delete on these objects. {{#chip_client_clusters includeAll=true}} +{{#unless (wasRemoved (asUpperCamelCase name preserveAcronyms=true))}} @implementation MTRBaseCluster{{asUpperCamelCase name preserveAcronyms=true}} - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue @@ -117,6 +118,9 @@ MTR{{cluster}}Cluster{{command}}Params {{/chip_cluster_commands}} {{#chip_server_cluster_attributes}} +{{! This is used as the implementation for both the new-name and old-name bits, so check for both here. }} +{{#unless (and (wasRemoved (asUpperCamelCase parent.name preserveAcronyms=true) command=(asUpperCamelCase name preserveAcronyms=true)) + (wasRemoved (compatClusterNameRemapping parent.name) command=(compatCommandNameRemapping parent.name name)))}} {{#*inline "attribute"}}Attribute{{asUpperCamelCase name preserveAcronyms=true}}{{/inline}} - (void)read{{>attribute}}With {{~#if_is_fabric_scoped_struct type~}} @@ -214,15 +218,21 @@ reportHandler:(void (^)({{asObjectiveCClass type parent.name}} * _Nullable value } {{/if}} +{{/unless}} {{/chip_server_cluster_attributes}} @end +{{/unless}} {{#unless (isStrEqual (asUpperCamelCase name preserveAcronyms=true) (compatClusterNameRemapping name))}} +{{#unless (wasRemoved (compatClusterNameRemapping name))}} @implementation MTRBaseCluster{{compatClusterNameRemapping name}} @end {{/unless}} +{{/unless}} +{{#if (and (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping name)) + (not (wasRemoved (compatClusterNameRemapping name))))}} @implementation MTRBaseCluster{{compatClusterNameRemapping name}} (Deprecated) {{#chip_cluster_commands}} @@ -255,7 +265,8 @@ reportHandler:(void (^)({{asObjectiveCClass type parent.name}} * _Nullable value {{/chip_cluster_commands}} {{#chip_server_cluster_attributes}} -{{#if (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name))}} +{{#if (and (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name)) + (not (wasRemoved (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name))))}} {{#*inline "attribute"}}Attribute{{compatAttributeNameRemapping parent.name name}}{{/inline}} - (void)read{{>attribute}}With {{~#if_is_fabric_scoped_struct type~}} @@ -319,6 +330,7 @@ subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptio } @end +{{/if}} {{/chip_client_clusters}} diff --git a/src/darwin/Framework/CHIP/templates/MTRBaseClusters.zapt b/src/darwin/Framework/CHIP/templates/MTRBaseClusters.zapt index c1e7b6a9ad45ad..9a7ccc35a06a17 100644 --- a/src/darwin/Framework/CHIP/templates/MTRBaseClusters.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRBaseClusters.zapt @@ -12,6 +12,7 @@ NS_ASSUME_NONNULL_BEGIN {{#chip_client_clusters includeAll=true}} +{{#unless (wasRemoved (asUpperCamelCase name preserveAcronyms=true))}} /** * Cluster {{name}} * @@ -44,6 +45,7 @@ NS_ASSUME_NONNULL_BEGIN {{/chip_cluster_commands}} {{#chip_server_cluster_attributes}} +{{#unless (wasRemoved (asUpperCamelCase parent.name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true))}} {{#*inline "attribute"}}Attribute{{asUpperCamelCase name preserveAcronyms=true}}{{/inline}} - (void)read{{>attribute}}With {{~#if_is_fabric_scoped_struct type~}} @@ -61,21 +63,25 @@ NS_ASSUME_NONNULL_BEGIN subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished reportHandler:(void (^)({{asObjectiveCClass type parent.name}} * _Nullable value, NSError * _Nullable error))reportHandler {{availability (asUpperCamelCase parent.name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true) minimalRelease="First major API revamp"}}; + (void) read{{>attribute}}WithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)({{asObjectiveCClass type parent.name}} * _Nullable value, NSError * _Nullable error))completion {{availability (asUpperCamelCase parent.name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true) minimalRelease="First major API revamp"}}; {{/if}} +{{/unless}} {{/chip_server_cluster_attributes}} - (instancetype)init NS_UNAVAILABLE; + (instancetype)new NS_UNAVAILABLE; @end +{{/unless}} {{/chip_client_clusters}} {{#chip_client_clusters includeAll=true}} {{#unless (isStrEqual (asUpperCamelCase name preserveAcronyms=true) (compatClusterNameRemapping name))}} +{{#unless (wasRemoved (compatClusterNameRemapping name))}} {{availability (compatClusterNameRemapping name) deprecationMessage=(concat "Please use MTRBaseCluster" (asUpperCamelCase name preserveAcronyms=true))}} @interface MTRBaseCluster{{compatClusterNameRemapping name}} : MTRBaseCluster{{asUpperCamelCase name preserveAcronyms=true}} @end +{{/unless}} {{/unless}} {{/chip_client_clusters}} @@ -168,7 +174,8 @@ typedef NS_OPTIONS({{asUnderlyingZclType name}}, {{objCEnumName clusterName bitm {{/zcl_clusters}} {{#chip_client_clusters includeAll=true}} -{{#if (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping name))}} +{{#if (and (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping name)) + (not (wasRemoved (compatClusterNameRemapping name))))}} @interface MTRBaseCluster{{compatClusterNameRemapping name}} (Deprecated) - (nullable instancetype)initWithDevice:(MTRBaseDevice *)device @@ -193,7 +200,8 @@ typedef NS_OPTIONS({{asUnderlyingZclType name}}, {{objCEnumName clusterName bitm {{/chip_cluster_commands}} {{#chip_server_cluster_attributes}} -{{#if (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name))}} +{{#if (and (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name)) + (not (wasRemoved (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name))))}} {{#*inline "attribute"}}Attribute{{compatAttributeNameRemapping parent.name name}}{{/inline}} - (void)read{{>attribute}}With {{~#if_is_fabric_scoped_struct type~}} diff --git a/src/darwin/Framework/CHIP/templates/MTRBaseClusters_Internal.zapt b/src/darwin/Framework/CHIP/templates/MTRBaseClusters_Internal.zapt index 15fc82e76a062f..4c3022025f74dc 100644 --- a/src/darwin/Framework/CHIP/templates/MTRBaseClusters_Internal.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRBaseClusters_Internal.zapt @@ -9,9 +9,11 @@ {{#chip_client_clusters includeAll=true}} +{{#unless (wasRemoved (asUpperCamelCase name preserveAcronyms=true))}} @interface MTRBaseCluster{{asUpperCamelCase name preserveAcronyms=true}} () @property (nonatomic, strong, readonly) MTRBaseDevice * device; @property (nonatomic, assign, readonly) chip::EndpointId endpoint; @end +{{/unless}} {{/chip_client_clusters}} diff --git a/src/darwin/Framework/CHIP/templates/MTRCallbackBridge-src.zapt b/src/darwin/Framework/CHIP/templates/MTRCallbackBridge-src.zapt index 85d4ddc9b39ecf..5ddf8c083944df 100644 --- a/src/darwin/Framework/CHIP/templates/MTRCallbackBridge-src.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRCallbackBridge-src.zapt @@ -39,6 +39,7 @@ {{#chip_client_clusters includeAll=true}} {{#chip_server_cluster_attributes}} +{{#unless (wasRemoved (asUpperCamelCase ../name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true))}} {{#if isArray}} {{#>MTRCallbackBridge ns=parent.name }}{{asUpperCamelCase ../../name preserveAcronyms=true}}{{asUpperCamelCase ../name preserveAcronyms=true}}ListAttributeCallback{{/MTRCallbackBridge}} {{else}} @@ -49,18 +50,23 @@ {{#>MTRCallbackBridge ns=parent.name }}{{asUpperCamelCase ../../name preserveAcronyms=true}}{{asUpperCamelCase ../name preserveAcronyms=true}}AttributeCallback{{/MTRCallbackBridge}} {{/if_is_strongly_typed_bitmap}} {{/if}} +{{/unless}} {{/chip_server_cluster_attributes}} {{/chip_client_clusters}} {{#chip_client_clusters includeAll=true}} {{#chip_cluster_responses}} +{{#unless (wasRemoved (asUpperCamelCase ../name preserveAcronyms=true) command=(asUpperCamelCase name preserveAcronyms=true))}} {{#>MTRCallbackBridge partial-type="Command" }}{{asUpperCamelCase ../../name preserveAcronyms=true}}Cluster{{asUpperCamelCase ../name preserveAcronyms=true}}Callback{{/MTRCallbackBridge}} +{{/unless}} {{/chip_cluster_responses}} {{/chip_client_clusters}} {{#zcl_clusters}} {{#zcl_enums}} +{{#unless (wasRemoved (asUpperCamelCase parent.name preserveAcronyms=true) enum=(asUpperCamelCase name preserveAcronyms=true))}} {{#>MTRCallbackBridge type=(asType label) isNullable=false ns=parent.name}}{{asUpperCamelCase parent.name preserveAcronyms=true}}Cluster{{asUpperCamelCase name preserveAcronyms=true}}AttributeCallback{{/MTRCallbackBridge}} {{#>MTRCallbackBridge type=(asType label) isNullable=true ns=parent.name}}Nullable{{asUpperCamelCase parent.name preserveAcronyms=true}}Cluster{{asUpperCamelCase name preserveAcronyms=true}}AttributeCallback{{/MTRCallbackBridge}} +{{/unless}} {{/zcl_enums}} {{/zcl_clusters}} diff --git a/src/darwin/Framework/CHIP/templates/MTRCallbackBridge.zapt b/src/darwin/Framework/CHIP/templates/MTRCallbackBridge.zapt index 4f0c2981ef433f..5249fb152d89cd 100644 --- a/src/darwin/Framework/CHIP/templates/MTRCallbackBridge.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRCallbackBridge.zapt @@ -16,19 +16,24 @@ typedef void (*NullableVendorIdAttributeCallback)(void *, const chip::app::DataM {{#chip_client_clusters includeAll=true}} {{#chip_cluster_responses}} +{{#unless (wasRemoved (asUpperCamelCase parent.name preserveAcronyms=true) command=(asUpperCamelCase name preserveAcronyms=true))}} typedef void (*{{asUpperCamelCase parent.name preserveAcronyms=true}}Cluster{{asUpperCamelCase name preserveAcronyms=true}}CallbackType)(void *, const chip::app::Clusters::{{asUpperCamelCase parent.name}}::Commands::{{asUpperCamelCase name}}::DecodableType &); +{{/unless}} {{/chip_cluster_responses}} {{/chip_client_clusters}} {{#zcl_clusters}} {{#zcl_enums}} +{{#unless (wasRemoved (asUpperCamelCase parent.name preserveAcronyms=true) enum=(asUpperCamelCase name preserveAcronyms=true))}} typedef void (*{{asUpperCamelCase parent.name preserveAcronyms=true}}Cluster{{asUpperCamelCase name preserveAcronyms=true}}AttributeCallback)(void *, chip::app::Clusters::{{asUpperCamelCase parent.name}}::{{asType label}}); typedef void (*Nullable{{asUpperCamelCase parent.name preserveAcronyms=true}}Cluster{{asUpperCamelCase name preserveAcronyms=true}}AttributeCallback)(void *, const chip::app::DataModel::Nullable &); +{{/unless}} {{/zcl_enums}} {{/zcl_clusters}} {{#chip_client_clusters includeAll=true}} {{#chip_server_cluster_attributes}} +{{#unless (wasRemoved (asUpperCamelCase parent.name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true))}} {{#if isArray}} typedef void (*{{asUpperCamelCase parent.name preserveAcronyms=true}}{{asUpperCamelCase name preserveAcronyms=true}}ListAttributeCallback)(void * context, {{zapTypeToDecodableClusterObjectType type ns=parent.name isArgument=true}} data); {{else}} @@ -39,6 +44,7 @@ typedef void (*{{asUpperCamelCase parent.name preserveAcronyms=true}}{{asUpperCa typedef void (*{{asUpperCamelCase parent.name preserveAcronyms=true}}{{asUpperCamelCase name preserveAcronyms=true}}AttributeCallback)(void *, {{zapTypeToDecodableClusterObjectType type ns=parent.name isArgument=true forceNotOptional=true}}); {{/if_is_strongly_typed_bitmap}} {{/if}} +{{/unless}} {{/chip_server_cluster_attributes}} {{/chip_client_clusters}} @@ -75,6 +81,7 @@ typedef void (*{{asUpperCamelCase parent.name preserveAcronyms=true}}{{asUpperCa {{#chip_client_clusters includeAll=true}} {{#chip_server_cluster_attributes}} +{{#unless (wasRemoved (asUpperCamelCase parent.name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true))}} {{#if isArray}} {{#>MTRCallbackBridge header="1" ns=parent.name }}{{asUpperCamelCase ../../name preserveAcronyms=true}}{{asUpperCamelCase ../name preserveAcronyms=true}}ListAttributeCallback{{/MTRCallbackBridge}} {{else}} @@ -85,18 +92,23 @@ typedef void (*{{asUpperCamelCase parent.name preserveAcronyms=true}}{{asUpperCa {{#>MTRCallbackBridge header="1" ns=parent.name }}{{asUpperCamelCase ../../name preserveAcronyms=true}}{{asUpperCamelCase ../name preserveAcronyms=true}}AttributeCallback{{/MTRCallbackBridge}} {{/if_is_strongly_typed_bitmap}} {{/if}} +{{/unless}} {{/chip_server_cluster_attributes}} {{/chip_client_clusters}} {{#chip_client_clusters includeAll=true}} {{#chip_cluster_responses}} +{{#unless (wasRemoved (asUpperCamelCase parent.name preserveAcronyms=true) command=(asUpperCamelCase name preserveAcronyms=true))}} {{#>MTRCallbackBridge header="1" partial-type="Command" }}{{asUpperCamelCase ../../name preserveAcronyms=true}}Cluster{{asUpperCamelCase ../name preserveAcronyms=true}}Callback{{/MTRCallbackBridge}} +{{/unless}} {{/chip_cluster_responses}} {{/chip_client_clusters}} {{#zcl_clusters}} {{#zcl_enums}} +{{#unless (wasRemoved (asUpperCamelCase parent.name preserveAcronyms=true) enum=(asUpperCamelCase name preserveAcronyms=true))}} {{#>MTRCallbackBridge header="1" type=(asType label) isNullable=false ns=parent.name}}{{asUpperCamelCase parent.name preserveAcronyms=true}}Cluster{{asUpperCamelCase name preserveAcronyms=true}}AttributeCallback{{/MTRCallbackBridge}} {{#>MTRCallbackBridge header="1" type=(asType label) isNullable=true ns=parent.name}}Nullable{{asUpperCamelCase parent.name preserveAcronyms=true}}Cluster{{asUpperCamelCase name preserveAcronyms=true}}AttributeCallback{{/MTRCallbackBridge}} +{{/unless}} {{/zcl_enums}} {{/zcl_clusters}} diff --git a/src/darwin/Framework/CHIP/templates/MTRClusterConstants.zapt b/src/darwin/Framework/CHIP/templates/MTRClusterConstants.zapt index 87d783e8e1df1a..dc1a5aa40ba4e7 100644 --- a/src/darwin/Framework/CHIP/templates/MTRClusterConstants.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRClusterConstants.zapt @@ -7,13 +7,16 @@ typedef NS_ENUM(uint32_t, MTRClusterIDType) { {{#zcl_clusters}} -{{#if (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping name) isForIds=true)}} +{{#if (and (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping name) isForIds=true) + (not (wasRemoved (compatClusterNameRemapping name) isForIds=true)))}} MTRCluster{{compatClusterNameRemapping label}}ID {{availability (compatClusterNameRemapping name) deprecatedRelease="First major API revamp" deprecationMessage=(concat "Please use MTRClusterIDType" (asUpperCamelCase label preserveAcronyms=true) "ID") isForIds=true}} = {{asMEI manufacturerCode code}}, {{/if}} {{/zcl_clusters}} {{#zcl_clusters}} +{{#unless (wasRemoved (asUpperCamelCase label preserveAcronyms=true) isForIds=true)}} {{~#*inline "cluster"}}{{asUpperCamelCase label preserveAcronyms=true}}{{/inline~}} MTRClusterIDType{{>cluster}}ID {{availability (asUpperCamelCase label preserveAcronyms=true) minimalRelease="First major API revamp" isForIds=true}} = {{asMEI manufacturerCode code}}, +{{/unless}} {{/zcl_clusters}} }; @@ -35,8 +38,10 @@ MTRClusterGlobalAttribute{{asUpperCamelCase label}}ID {{#zcl_attributes_server}} {{~#*inline "attribute"}}{{asUpperCamelCase label preserveAcronyms=true}}{{/inline~}} {{#unless clusterRef}} +{{#unless (wasRemoved "" globalAttribute=(asUpperCamelCase label) isForIds=true)}} MTRAttributeIDTypeGlobalAttribute{{>attribute}}ID {{availability "" globalAttribute=(asUpperCamelCase label) minimalRelease="First major API revamp" isForIds=true}} = {{asMEI manufacturerCode code}}, {{/unless}} +{{/unless}} {{/zcl_attributes_server}} {{#zcl_clusters}} @@ -44,7 +49,9 @@ MTRAttributeIDTypeGlobalAttribute{{>attribute}}ID {{availability "" globalAttrib {{#zcl_attributes_server}} {{#first}} {{#if (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping ../clusterName) isForIds=true)}} +{{#unless (wasRemoved (compatClusterNameRemapping ../clusterName))}} // Cluster {{compatClusterNameRemapping ../clusterName}} deprecated attribute names +{{/unless}} {{/if}} {{/first}} {{! DeviceTypeList is special: we did not call it by that name @@ -57,7 +64,8 @@ MTRClusterDescriptorAttributeDeviceTypeListID = {{asMEI manufacturerCode code}}, {{/if}} {{/if}} -{{#if (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping ../clusterName) attribute=(compatAttributeNameRemapping ../clusterName label) isForIds=true)}} +{{#if (and (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping ../clusterName) attribute=(compatAttributeNameRemapping ../clusterName label) isForIds=true) + (not (wasRemoved (compatClusterNameRemapping ../clusterName) attribute=(compatAttributeNameRemapping ../clusterName label) isForIds=true)))}} MTRCluster{{compatClusterNameRemapping ../clusterName}}Attribute{{compatAttributeNameRemapping ../clusterName label}}ID {{availability (compatClusterNameRemapping ../clusterName) attribute=(compatAttributeNameRemapping ../clusterName label) deprecatedRelease="First major API revamp" deprecationMessage=(concat "Please use MTRAttributeIDTypeCluster" (asUpperCamelCase ../clusterName preserveAcronyms=true) "Attribute" (asUpperCamelCase label preserveAcronyms=true) "ID") isForIds=true}} = {{#if clusterRef}} @@ -74,14 +82,18 @@ MTRClusterGlobalAttribute{{asUpperCamelCase label}}ID, {{~#*inline "cluster"}}{{asUpperCamelCase ../clusterName preserveAcronyms=true}}{{/inline~}} {{~#*inline "attribute"}}{{asUpperCamelCase label preserveAcronyms=true}}{{/inline~}} {{#first}} +{{#unless (wasRemoved (asUpperCamelCase ../clusterName preserveAcronyms=true))}} // Cluster {{> cluster}} attributes +{{/unless}} {{/first}} +{{#unless (wasRemoved (asUpperCamelCase ../clusterName preserveAcronyms=true) attribute=(asUpperCamelCase label preserveAcronyms=true) isForIds=true)}} MTRAttributeIDTypeCluster{{>cluster}}Attribute{{>attribute}}ID {{availability (asUpperCamelCase ../clusterName preserveAcronyms=true) attribute=(asUpperCamelCase label preserveAcronyms=true) minimalRelease="First major API revamp" isForIds=true}} = {{#if clusterRef}} {{asMEI manufacturerCode code}}, {{else}} MTRAttributeIDTypeGlobalAttribute{{asUpperCamelCase label}}ID, {{/if}} +{{/unless}} {{#last}} {{/last}} @@ -100,7 +112,9 @@ typedef NS_ENUM(uint32_t, MTRCommandIDType) { {{#zcl_commands}} {{#first}} {{#if (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping ../clusterName) isForIds=true)}} +{{#unless (wasRemoved (compatClusterNameRemapping ../clusterName))}} // Cluster {{compatClusterNameRemapping ../clusterName}} deprecated command id names +{{/unless}} {{/if}} {{/first}} {{! Takes two arguments: cluster name and command name, plus the ambient state where the command is "this" }} @@ -121,7 +135,9 @@ MTRCluster{{cluster}}Command{{command}}ID {{#zcl_commands}} {{~#*inline "cluster"}}{{asUpperCamelCase ../clusterName preserveAcronyms=true}}{{/inline~}} {{#first}} +{{#unless (wasRemoved (asUpperCamelCase ../clusterName preserveAcronyms=true))}} // Cluster {{>cluster}} commands +{{/unless}} {{/first}} {{! Takes two arguments: cluster name and command name, plus the ambient state where the command is "this" }} {{#*inline "commandIdDecl"}} @@ -149,10 +165,13 @@ typedef NS_ENUM(uint32_t, MTREventIDType) { {{#zcl_events}} {{#first}} {{#if (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping ../clusterName) isForIds=true)}} +{{#unless (wasRemoved (compatClusterNameRemapping ../clusterName))}} // Cluster {{compatClusterNameRemapping ../clusterName}} deprecated event names +{{/unless}} {{/if}} {{/first}} -{{#if (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping ../clusterName) event=(asUpperCamelCase name) isForIds=true)}} +{{#if (and (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping ../clusterName) event=(asUpperCamelCase name) isForIds=true) + (not (wasRemoved (compatClusterNameRemapping ../clusterName) event=(asUpperCamelCase name) isForIds=true)))}} MTRCluster{{compatClusterNameRemapping ../clusterName}}Event{{asUpperCamelCase name}}ID {{availability (compatClusterNameRemapping ../clusterName) event=(asUpperCamelCase name) deprecatedRelease="First major API revamp" deprecationMessage=(concat "Please use MTREventIDTypeCluster" (asUpperCamelCase ../clusterName preserveAcronyms=true) "Event" (asUpperCamelCase name preserveAcronyms=true) "ID") isForIds=true}} = {{asMEI manufacturerCode code}}, @@ -165,9 +184,13 @@ MTRCluster{{compatClusterNameRemapping ../clusterName}}Event{{asUpperCamelCase n {{~#*inline "cluster"}}{{asUpperCamelCase ../clusterName preserveAcronyms=true}}{{/inline~}} {{~#*inline "event"}}{{asUpperCamelCase name preserveAcronyms=true}}{{/inline~}} {{#first}} +{{#unless (wasRemoved (asUpperCamelCase ../clusterName preserveAcronyms=true))}} // Cluster {{>cluster}} events +{{/unless}} {{/first}} +{{#unless (wasRemoved (asUpperCamelCase ../clusterName preserveAcronyms=true) event=(asUpperCamelCase name preserveAcronyms=true) isForIds=true)}} MTREventIDTypeCluster{{>cluster}}Event{{>event}}ID {{availability (asUpperCamelCase ../clusterName preserveAcronyms=true) event=(asUpperCamelCase name preserveAcronyms=true) minimalRelease="First major API revamp" isForIds=true}} = {{asMEI manufacturerCode code}}, +{{/unless}} {{#last}} {{/last}} diff --git a/src/darwin/Framework/CHIP/templates/MTRClusters-src.zapt b/src/darwin/Framework/CHIP/templates/MTRClusters-src.zapt index 70ccaf69147034..9f268b08e81397 100644 --- a/src/darwin/Framework/CHIP/templates/MTRClusters-src.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRClusters-src.zapt @@ -37,6 +37,7 @@ static void MTRClustersLogCompletion(NSString *logPrefix, id value, NSError *err // NOLINTBEGIN(clang-analyzer-cplusplus.NewDeleteLeaks): Linter is unable to locate the delete on these objects. {{#chip_client_clusters includeAll=true}} +{{#unless (wasRemoved (asUpperCamelCase name preserveAcronyms=true))}} @implementation MTRCluster{{asUpperCamelCase name preserveAcronyms=true}} - (instancetype)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue @@ -169,6 +170,9 @@ MTRCommandIDTypeCluster{{cluster}}Command{{command}}ID {{/chip_cluster_commands}} {{#chip_server_cluster_attributes}} +{{! This is used as the implementation for both the new-name and old-name bits, so check for both here. }} +{{#unless (and (wasRemoved (asUpperCamelCase parent.name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true)) + (wasRemoved (compatClusterNameRemapping parent.name) command=(compatAttributeNameRemapping parent.name name)))}} {{#*inline "cluster"}}{{asUpperCamelCase parent.name preserveAcronyms=true}}{{/inline}} {{#*inline "attribute"}}Attribute{{asUpperCamelCase name preserveAcronyms=true}}{{/inline}} - (NSDictionary *)read{{>attribute}}WithParams:(MTRReadParams * _Nullable)params { @@ -195,15 +199,20 @@ MTRCommandIDTypeCluster{{cluster}}Command{{command}}ID {{/if}} +{{/unless}} {{/chip_server_cluster_attributes}} @end +{{/unless}} {{#unless (isStrEqual (asUpperCamelCase name preserveAcronyms=true) (compatClusterNameRemapping name))}} - +{{#unless (wasRemoved (compatClusterNameRemapping name))}} @implementation MTRCluster{{compatClusterNameRemapping name}} @end {{/unless}} +{{/unless}} +{{#if (and (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping name)) + (not (wasRemoved (compatClusterNameRemapping name))))}} @implementation MTRCluster{{compatClusterNameRemapping name}} (Deprecated) - (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue @@ -241,7 +250,8 @@ MTRCommandIDTypeCluster{{cluster}}Command{{command}}ID {{/chip_cluster_commands}} {{~#chip_server_cluster_attributes}} {{~#*inline "attributeImpls"}} -{{#unless (isStrEqual attribute (asUpperCamelCase name preserveAcronyms=true))}} +{{#unless (or (isStrEqual attribute (asUpperCamelCase name preserveAcronyms=true)) + (wasRemoved (compatClusterNameRemapping parent.name) attribute=attribute))}} - (NSDictionary *)readAttribute{{attribute}}WithParams:(MTRReadParams * _Nullable)params { return [self readAttribute{{asUpperCamelCase name preserveAcronyms=true}}WithParams:params]; @@ -261,6 +271,7 @@ MTRCommandIDTypeCluster{{cluster}}Command{{command}}ID {{> attributeImpls attribute=(compatAttributeNameRemapping parent.name name)}} {{/chip_server_cluster_attributes}} @end +{{/if}} {{/chip_client_clusters}} diff --git a/src/darwin/Framework/CHIP/templates/MTRClusters.zapt b/src/darwin/Framework/CHIP/templates/MTRClusters.zapt index eeda4ebcb29c09..54c05ea59ede1a 100644 --- a/src/darwin/Framework/CHIP/templates/MTRClusters.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRClusters.zapt @@ -12,6 +12,7 @@ NS_ASSUME_NONNULL_BEGIN {{#chip_client_clusters includeAll=true}} +{{#unless (wasRemoved (asUpperCamelCase name preserveAcronyms=true))}} /** * Cluster {{name}} * {{description}} @@ -38,6 +39,7 @@ NS_ASSUME_NONNULL_BEGIN {{/chip_cluster_commands}} {{#chip_server_cluster_attributes}} +{{#unless (wasRemoved (asUpperCamelCase parent.name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true))}} {{#*inline "attribute"}}Attribute{{asUpperCamelCase name preserveAcronyms=true}}{{/inline}} {{#*inline "availability"}} {{availability (asUpperCamelCase parent.name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true)}} @@ -47,6 +49,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)write{{>attribute}}WithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs {{> availability}}; - (void)write{{>attribute}}WithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params {{> availability}}; {{/if}} +{{/unless}} {{/chip_server_cluster_attributes}} - (instancetype)init NS_UNAVAILABLE; @@ -54,19 +57,23 @@ NS_ASSUME_NONNULL_BEGIN @end +{{/unless}} {{/chip_client_clusters}} {{#chip_client_clusters includeAll=true}} {{#unless (isStrEqual (asUpperCamelCase name preserveAcronyms=true) (compatClusterNameRemapping name))}} +{{#unless (wasRemoved (compatClusterNameRemapping name))}} {{availability (compatClusterNameRemapping name) deprecationMessage=(concat "Please use MTRCluster" (asUpperCamelCase name preserveAcronyms=true))}} @interface MTRCluster{{compatClusterNameRemapping name}} : MTRCluster{{asUpperCamelCase name preserveAcronyms=true}} @end +{{/unless}} {{/unless}} {{/chip_client_clusters}} {{#chip_client_clusters includeAll=true}} -{{#if (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping name))}} +{{#if (and (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping name)) + (not (wasRemoved (compatClusterNameRemapping name))))}} @interface MTRCluster{{compatClusterNameRemapping name}} (Deprecated) - (nullable instancetype)initWithDevice:(MTRDevice *)device diff --git a/src/darwin/Framework/CHIP/templates/MTRClusters_Internal.zapt b/src/darwin/Framework/CHIP/templates/MTRClusters_Internal.zapt index ccad7c4389101c..3ef41f3a5bc686 100644 --- a/src/darwin/Framework/CHIP/templates/MTRClusters_Internal.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRClusters_Internal.zapt @@ -10,9 +10,11 @@ {{#chip_client_clusters includeAll=true}} +{{#unless (wasRemoved (asUpperCamelCase name preserveAcronyms=true))}} @interface MTRCluster{{asUpperCamelCase name preserveAcronyms=true}} () @property (nonatomic, readonly) uint16_t endpoint; @property (nonatomic, readonly) MTRDevice *device; @end +{{/unless}} {{/chip_client_clusters}} diff --git a/src/darwin/Framework/CHIP/templates/MTREventTLVValueDecoder-src.zapt b/src/darwin/Framework/CHIP/templates/MTREventTLVValueDecoder-src.zapt index 14a052bbe56d90..4f66da9dd3253f 100644 --- a/src/darwin/Framework/CHIP/templates/MTREventTLVValueDecoder-src.zapt +++ b/src/darwin/Framework/CHIP/templates/MTREventTLVValueDecoder-src.zapt @@ -22,13 +22,13 @@ id MTRDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRead switch (aPath.mClusterId) { {{#chip_client_clusters includeAll=true}} + {{#unless (wasRemoved (asUpperCamelCase name preserveAcronyms=true))}} case Clusters::{{asUpperCamelCase name}}::Id: { using namespace Clusters::{{asUpperCamelCase name}}; switch (aPath.mEventId) { {{#zcl_events}} - {{#zcl_event_fields}} - {{/zcl_event_fields}} + {{#unless (wasRemoved (asUpperCamelCase ../name preserveAcronyms=true) event=(asUpperCamelCase name preserveAcronyms=true))}} case Events::{{asUpperCamelCase name}}::Id: { Events::{{asUpperCamelCase name}}::DecodableType cppValue; @@ -41,16 +41,19 @@ id MTRDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRead __auto_type *value = [MTR{{asUpperCamelCase parent.name preserveAcronyms=true}}Cluster{{asUpperCamelCase name preserveAcronyms=true}}Event new]; {{#zcl_event_fields}} + {{#unless (wasRemoved (asUpperCamelCase ../../name preserveAcronyms=true) event=(asUpperCamelCase ../name preserveAcronyms=true) eventField=(asStructPropertyName name))}} do { {{asObjectiveCType type parent.parent.name}} memberValue; {{>decode_value target="memberValue" source=(concat "cppValue." (asLowerCamelCase name)) cluster=parent.parent.name errorCode="*aError = err; return nil;" depth=0}} value.{{asStructPropertyName name}} = memberValue; } while(0); + {{/unless}} {{/zcl_event_fields}} return value; } + {{/unless}} {{/zcl_events}} default: @@ -59,6 +62,7 @@ id MTRDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRead } break; } + {{/unless}} {{/chip_client_clusters}} default: { *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; diff --git a/src/darwin/Framework/CHIP/templates/MTRStructsObjc-src.zapt b/src/darwin/Framework/CHIP/templates/MTRStructsObjc-src.zapt index 37c4f2af35a1c5..207d94403ec417 100644 --- a/src/darwin/Framework/CHIP/templates/MTRStructsObjc-src.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRStructsObjc-src.zapt @@ -12,7 +12,9 @@ NS_ASSUME_NONNULL_BEGIN { if (self = [super init]) { {{#zcl_struct_items}} + {{#unless (wasRemoved (asUpperCamelCase parent.parent.name preserveAcronyms=true) struct=(asUpperCamelCase parent.name preserveAcronyms=true) structField=(asStructPropertyName label))}} {{>init_struct_member label=label type=type cluster=parent.parent.name}} + {{/unless}} {{/zcl_struct_items}} } return self; @@ -23,7 +25,9 @@ NS_ASSUME_NONNULL_BEGIN auto other = [[{{interfaceName}} alloc] init]; {{#zcl_struct_items}} + {{#unless (wasRemoved (asUpperCamelCase parent.parent.name preserveAcronyms=true) struct=(asUpperCamelCase parent.name preserveAcronyms=true) structField=(asStructPropertyName label))}} other.{{asStructPropertyName label}} = self.{{asStructPropertyName label}}; + {{/unless}} {{/zcl_struct_items}} return other; @@ -31,11 +35,20 @@ NS_ASSUME_NONNULL_BEGIN - (NSString *)description { - NSString *descriptionString = [NSString stringWithFormat:@"<%@: {{#zcl_struct_items}}{{asStructPropertyName label}}:%@; {{/zcl_struct_items}}>", NSStringFromClass([self class]){{#zcl_struct_items}},{{#if isArray}}_{{asStructPropertyName label}}{{else if (isOctetString type)}}[_{{asStructPropertyName label}} base64EncodedStringWithOptions:0]{{else}}_{{asStructPropertyName label}}{{/if}}{{/zcl_struct_items}}]; + NSString *descriptionString = [NSString stringWithFormat:@"<%@: {{#zcl_struct_items~}} + {{~#unless (wasRemoved (asUpperCamelCase parent.parent.name preserveAcronyms=true) struct=(asUpperCamelCase parent.name preserveAcronyms=true) structField=(asStructPropertyName label))~}} + {{~asStructPropertyName label}}:%@; {{!Just here to keep the preceding space}} + {{~/unless~}} + {{~/zcl_struct_items}}>", NSStringFromClass([self class]){{#zcl_struct_items~}} + {{~#unless (wasRemoved (asUpperCamelCase parent.parent.name preserveAcronyms=true) struct=(asUpperCamelCase parent.name preserveAcronyms=true) structField=(asStructPropertyName label))~}} + ,{{#if isArray}}_{{asStructPropertyName label}}{{else if (isOctetString type)}}[_{{asStructPropertyName label}} base64EncodedStringWithOptions:0]{{else}}_{{asStructPropertyName label}}{{/if}} + {{~/unless~}} + {{~/zcl_struct_items}}]; return descriptionString; } {{#zcl_struct_items}} -{{#if (hasOldName (asUpperCamelCase ../../name preserveAcronyms=true) struct=(asUpperCamelCase ../name preserveAcronyms=true) structField=(asStructPropertyName label))}} +{{#if (and (hasOldName (asUpperCamelCase ../../name preserveAcronyms=true) struct=(asUpperCamelCase ../name preserveAcronyms=true) structField=(asStructPropertyName label)) + (not (wasRemoved (asUpperCamelCase ../../name preserveAcronyms=true) struct=(asUpperCamelCase ../name preserveAcronyms=true) structField=(oldName (asUpperCamelCase ../../name preserveAcronyms=true) struct=(asUpperCamelCase ../name preserveAcronyms=true) structField=(asStructPropertyName label)))))}} {{> renamed_struct_field_impl cluster=../../name type=type newName=label oldName=(oldName (asUpperCamelCase ../../name preserveAcronyms=true) struct=(asUpperCamelCase ../name preserveAcronyms=true) structField=(asStructPropertyName label))}} {{/if}} @@ -44,12 +57,16 @@ NS_ASSUME_NONNULL_BEGIN @end {{/inline}} +{{#unless (wasRemoved (asUpperCamelCase parent.name preserveAcronyms=true) struct=(asUpperCamelCase name preserveAcronyms=true))}} {{> interfaceImpl interfaceName=(concat "MTR" (asUpperCamelCase parent.name preserveAcronyms=true) "Cluster" (asUpperCamelCase name preserveAcronyms=true))}} +{{/unless}} {{! Takes the name of the struct to use as structName. }} {{#*inline "oldNameImpl"}} +{{#unless (wasRemoved (compatClusterNameRemapping parent.name) struct=structName)}} @implementation MTR{{compatClusterNameRemapping parent.name}}Cluster{{structName}} : MTR{{asUpperCamelCase parent.name preserveAcronyms=true}}Cluster{{asUpperCamelCase name preserveAcronyms=true}} @end +{{/unless}} {{/inline}} {{! Takes the old name of the struct, if any, as oldStructName. }} {{#*inline "oldNameCheck"}} @@ -67,12 +84,15 @@ NS_ASSUME_NONNULL_BEGIN {{/zcl_structs}} {{#zcl_events}} +{{#unless (wasRemoved (asUpperCamelCase parent.name preserveAcronyms=true) event=(asUpperCamelCase name preserveAcronyms=true))}} @implementation MTR{{asUpperCamelCase parent.name preserveAcronyms=true}}Cluster{{asUpperCamelCase name preserveAcronyms=true}}Event - (instancetype)init { if (self = [super init]) { {{#zcl_event_fields}} + {{#unless (wasRemoved (asUpperCamelCase parent.parent.name preserveAcronyms=true) event=(asUpperCamelCase parent.name preserveAcronyms=true) eventField=(asStructPropertyName name))}} {{>init_struct_member label=name type=type cluster=parent.parent.name}} + {{/unless}} {{/zcl_event_fields}} } return self; @@ -83,7 +103,9 @@ NS_ASSUME_NONNULL_BEGIN auto other = [[MTR{{asUpperCamelCase parent.name preserveAcronyms=true}}Cluster{{asUpperCamelCase name preserveAcronyms=true}}Event alloc] init]; {{#zcl_event_fields}} + {{#unless (wasRemoved (asUpperCamelCase parent.parent.name preserveAcronyms=true) event=(asUpperCamelCase parent.name preserveAcronyms=true) eventField=(asStructPropertyName name))}} other.{{asStructPropertyName name}} = self.{{asStructPropertyName name}}; + {{/unless}} {{/zcl_event_fields}} return other; @@ -91,31 +113,43 @@ NS_ASSUME_NONNULL_BEGIN - (NSString *)description { - NSString *descriptionString = [NSString stringWithFormat:@"<%@: {{#zcl_event_fields}}{{asStructPropertyName name}}:%@; {{/zcl_event_fields}}>", NSStringFromClass([self class]){{#zcl_event_fields}},{{#if isArray}}_{{asStructPropertyName name}}{{else if (isOctetString type)}}[_{{asStructPropertyName name}} base64EncodedStringWithOptions:0]{{else}}_{{asStructPropertyName name}}{{/if}}{{/zcl_event_fields}}]; + NSString *descriptionString = [NSString stringWithFormat:@"<%@: {{#zcl_event_fields~}} + {{~#unless (wasRemoved (asUpperCamelCase parent.parent.name preserveAcronyms=true) event=(asUpperCamelCase parent.name preserveAcronyms=true) eventField=(asStructPropertyName name))~}} + {{asStructPropertyName name}}:%@; {{!Just here to keep the preceding space}} + {{~/unless~}} + {{~/zcl_event_fields}}>", NSStringFromClass([self class]){{#zcl_event_fields~}} + {{~#unless (wasRemoved (asUpperCamelCase parent.parent.name preserveAcronyms=true) event=(asUpperCamelCase parent.name preserveAcronyms=true) eventField=(asStructPropertyName name))~}} + ,{{#if isArray}}_{{asStructPropertyName name}}{{else if (isOctetString type)}}[_{{asStructPropertyName name}} base64EncodedStringWithOptions:0]{{else}}_{{asStructPropertyName name}}{{/if}} + {{~/unless~}} + {{~/zcl_event_fields}}]; return descriptionString; } {{#zcl_event_fields}} -{{#if (hasOldName (asUpperCamelCase ../parent.name preserveAcronyms=true) event=(asUpperCamelCase ../name preserveAcronyms=true) eventField=(asStructPropertyName name))}} +{{#if (and (hasOldName (asUpperCamelCase ../parent.name preserveAcronyms=true) event=(asUpperCamelCase ../name preserveAcronyms=true) eventField=(asStructPropertyName name)) + (not (wasRemoved (asUpperCamelCase ../parent.name preserveAcronyms=true) event=(asUpperCamelCase ../name preserveAcronyms=true) eventField=(oldName (asUpperCamelCase ../parent.name preserveAcronyms=true) event=(asUpperCamelCase ../name preserveAcronyms=true) eventField=(asStructPropertyName name)))))}} {{> renamed_struct_field_impl cluster=../parent.name type=type newName=name oldName=(oldName (asUpperCamelCase ../parent.name preserveAcronyms=true) event=(asUpperCamelCase ../name preserveAcronyms=true) eventField=(asStructPropertyName name))}} {{/if}} {{/zcl_event_fields}} @end +{{/unless}} {{! Takes the name of the event to use as eventName. }} -{{#*inline "oldNameDecl"}} +{{#*inline "oldNameImpl"}} +{{#unless (wasRemoved (compatClusterNameRemapping parent.name) event=eventName)}} @implementation MTR{{compatClusterNameRemapping parent.name}}Cluster{{eventName}}Event : MTR{{asUpperCamelCase parent.name preserveAcronyms=true}}Cluster{{asUpperCamelCase name preserveAcronyms=true}}Event @end +{{/unless}} {{/inline}} {{! Takes the old name of the event, if any, as oldEventName. }} {{#*inline "oldNameCheck"}} {{#if (or oldEventName (hasOldName (asUpperCamelCase parent.name preserveAcronyms=true)))}} {{#if oldEventName}} -{{> oldNameDecl eventName=oldEventName}} +{{> oldNameImpl eventName=oldEventName}} {{else}} -{{> oldNameDecl eventName=(asUpperCamelCase name preserveAcronyms=true)}} +{{> oldNameImpl eventName=(asUpperCamelCase name preserveAcronyms=true)}} {{/if}} {{/if}} {{/inline}} diff --git a/src/darwin/Framework/CHIP/templates/MTRStructsObjc.zapt b/src/darwin/Framework/CHIP/templates/MTRStructsObjc.zapt index 81a67ad8b972b7..41d89746f69bd5 100644 --- a/src/darwin/Framework/CHIP/templates/MTRStructsObjc.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRStructsObjc.zapt @@ -8,22 +8,30 @@ NS_ASSUME_NONNULL_BEGIN {{#zcl_structs}} {{#*inline "interfaceDecl"}} {{#zcl_struct_items}} +{{#unless (wasRemoved (asUpperCamelCase ../../name preserveAcronyms=true) struct=../struct structField=(asStructPropertyName label))}} {{> struct_field_decl cluster=parent.parent.name type=type label=label}} {{availability (asUpperCamelCase ../../name preserveAcronyms=true) struct=../struct structField=(asStructPropertyName label) deprecationMessage=(concat "Please use MTR" (asUpperCamelCase ../../name preserveAcronyms=true) "Cluster" (asUpperCamelCase ../name preserveAcronyms=true))}}; +{{/unless}} {{#if (hasOldName (asUpperCamelCase ../../name preserveAcronyms=true) struct=(asUpperCamelCase ../name preserveAcronyms=true) structField=(asStructPropertyName label))}} -{{> struct_field_decl cluster=../../name type=type label=(oldName (asUpperCamelCase ../../name preserveAcronyms=true) struct=(asUpperCamelCase ../name preserveAcronyms=true) structField=(asStructPropertyName label))}} {{availability (asUpperCamelCase ../../name preserveAcronyms=true) struct=(asUpperCamelCase ../name preserveAcronyms=true) structField=(oldName (asUpperCamelCase ../../name preserveAcronyms=true) struct=(asUpperCamelCase ../name preserveAcronyms=true) structField=(asStructPropertyName name)) deprecationMessage=(concat "Please use " (asStructPropertyName name))}}; +{{#unless (wasRemoved (asUpperCamelCase ../../name preserveAcronyms=true) struct=(asUpperCamelCase ../name preserveAcronyms=true) structField=(oldName (asUpperCamelCase ../../name preserveAcronyms=true) struct=(asUpperCamelCase ../name preserveAcronyms=true) structField=(asStructPropertyName label)))}} +{{> struct_field_decl cluster=../../name type=type label=(oldName (asUpperCamelCase ../../name preserveAcronyms=true) struct=(asUpperCamelCase ../name preserveAcronyms=true) structField=(asStructPropertyName label))}} {{availability (asUpperCamelCase ../../name preserveAcronyms=true) struct=(asUpperCamelCase ../name preserveAcronyms=true) structField=(oldName (asUpperCamelCase ../../name preserveAcronyms=true) struct=(asUpperCamelCase ../name preserveAcronyms=true) structField=(asStructPropertyName label)) deprecationMessage=(concat "Please use " (asStructPropertyName label))}}; +{{/unless}} {{/if}} {{/zcl_struct_items}} {{/inline}} +{{#unless (wasRemoved (asUpperCamelCase parent.name preserveAcronyms=true) struct=(asUpperCamelCase name preserveAcronyms=true))}} {{availability (asUpperCamelCase parent.name preserveAcronyms=true) struct=(asUpperCamelCase name preserveAcronyms=true) deprecationMessage="This struct is unused and will be removed"}} @interface MTR{{asUpperCamelCase parent.name preserveAcronyms=true}}Cluster{{asUpperCamelCase name preserveAcronyms=true}} : NSObject {{> interfaceDecl struct=(asUpperCamelCase name preserveAcronyms=true)}} @end +{{/unless}} {{! Takes the name of the struct to use as structName. }} {{#*inline "oldNameDecl"}} +{{#unless (wasRemoved (compatClusterNameRemapping parent.name) struct=structName)}} {{availability (compatClusterNameRemapping parent.name) struct=structName deprecationMessage=(concat "Please use MTR" (asUpperCamelCase parent.name preserveAcronyms=true) "Cluster" (asUpperCamelCase name preserveAcronyms=true))}} @interface MTR{{compatClusterNameRemapping parent.name}}Cluster{{structName}} : MTR{{asUpperCamelCase parent.name preserveAcronyms=true}}Cluster{{asUpperCamelCase name preserveAcronyms=true}} @end +{{/unless}} {{/inline}} {{! Takes the old name of the struct, if any, as oldStructName. }} {{#*inline "oldNameCheck"}} @@ -40,21 +48,29 @@ NS_ASSUME_NONNULL_BEGIN {{/zcl_structs}} {{#zcl_events}} +{{#unless (wasRemoved (asUpperCamelCase parent.name preserveAcronyms=true) event=(asUpperCamelCase name preserveAcronyms=true))}} {{availability (asUpperCamelCase parent.name preserveAcronyms=true) event=(asUpperCamelCase name preserveAcronyms=true)}} @interface MTR{{asUpperCamelCase parent.name preserveAcronyms=true}}Cluster{{asUpperCamelCase name preserveAcronyms=true}}Event : NSObject {{#zcl_event_fields}} +{{#unless (wasRemoved (asUpperCamelCase ../../name preserveAcronyms=true) event=(asUpperCamelCase ../name preserveAcronyms=true) eventField=(asStructPropertyName name))}} {{> struct_field_decl cluster=parent.parent.name type=type label=name}} {{availability (asUpperCamelCase ../../name preserveAcronyms=true) event=(asUpperCamelCase ../name preserveAcronyms=true) eventField=(asStructPropertyName name)}}; +{{/unless}} {{#if (hasOldName (asUpperCamelCase ../parent.name preserveAcronyms=true) event=(asUpperCamelCase ../name preserveAcronyms=true) eventField=(asStructPropertyName name))}} +{{#unless (wasRemoved (asUpperCamelCase ../../name preserveAcronyms=true) event=(asUpperCamelCase ../name preserveAcronyms=true) eventField=(oldName (asUpperCamelCase ../parent.name preserveAcronyms=true) event=(asUpperCamelCase ../name preserveAcronyms=true) eventField=(asStructPropertyName name)))}} {{> struct_field_decl cluster=parent.parent.name type=type label=(oldName (asUpperCamelCase ../parent.name preserveAcronyms=true) event=(asUpperCamelCase ../name preserveAcronyms=true) eventField=(asStructPropertyName name))}} {{availability (asUpperCamelCase ../../name preserveAcronyms=true) event=(asUpperCamelCase ../name preserveAcronyms=true) eventField=(oldName (asUpperCamelCase ../parent.name preserveAcronyms=true) event=(asUpperCamelCase ../name preserveAcronyms=true) eventField=(asStructPropertyName name)) deprecationMessage=(concat "Please use " (asStructPropertyName name))}}; +{{/unless}} {{/if}} {{/zcl_event_fields}} @end +{{/unless}} {{! Takes the name of the event to use as eventName. }} {{#*inline "oldNameDecl"}} +{{#unless (wasRemoved (compatClusterNameRemapping parent.name) event=eventName)}} {{availability (compatClusterNameRemapping parent.name) event=eventName deprecationMessage=(concat "Please use MTR" (asUpperCamelCase parent.name preserveAcronyms=true) "Cluster" (asUpperCamelCase name preserveAcronyms=true) "Event")}} @interface MTR{{compatClusterNameRemapping parent.name}}Cluster{{eventName}}Event : MTR{{asUpperCamelCase parent.name preserveAcronyms=true}}Cluster{{asUpperCamelCase name preserveAcronyms=true}}Event @end +{{/unless}} {{/inline}} {{! Takes the old name of the event, if any, as oldEventName. }} {{#*inline "oldNameCheck"}} diff --git a/src/darwin/Framework/CHIP/templates/availability.yaml b/src/darwin/Framework/CHIP/templates/availability.yaml index 6cb565286d9c47..98255e4af4d09b 100644 --- a/src/darwin/Framework/CHIP/templates/availability.yaml +++ b/src/darwin/Framework/CHIP/templates/availability.yaml @@ -4771,6 +4771,7 @@ - TestEmitTestFabricScopedEventRequest ClientMonitoring: - RegisterClientMonitoring + - UnregisterClientMonitoring - StayAwakeRequest command fields: UnitTesting: @@ -4927,6 +4928,9 @@ RegisterClientMonitoring: - clientNodeId - iCid + UnregisterClientMonitoring: + - clientNodeId + - iCid Groups: AddGroup: - groupID @@ -5428,6 +5432,9 @@ - Timed Invoke for server to client commands - Deprecated global attribute names removed: + clusters: + # Not ready to be public API yet. + - ClientMonitoring commands: BasicInformation: - MfgSpecificPing diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index d198564b137073..b0508b5329ac82 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -16082,177 +16082,6 @@ id MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader & } break; } - case Clusters::ClientMonitoring::Id: { - using namespace Clusters::ClientMonitoring; - switch (aPath.mAttributeId) { - case Attributes::IdleModeInterval::Id: { - using TypeInfo = Attributes::IdleModeInterval::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ActiveModeInterval::Id: { - using TypeInfo = Attributes::ActiveModeInterval::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ActiveModeThreshold::Id: { - using TypeInfo = Attributes::ActiveModeThreshold::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::ExpectedClients::Id: { - using TypeInfo = Attributes::ExpectedClients::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRClientMonitoringClusterMonitoringRegistration * newElement_0; - newElement_0 = [MTRClientMonitoringClusterMonitoringRegistration new]; - newElement_0.clientNodeId = [NSNumber numberWithUnsignedLongLong:entry_0.clientNodeId]; - newElement_0.iCid = [NSNumber numberWithUnsignedLongLong:entry_0.ICid]; - newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - break; - } - break; - } case Clusters::UnitTesting::Id: { using namespace Clusters::UnitTesting; switch (aPath.mAttributeId) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index a29a8c2685fadc..3d2835298fb782 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -15349,155 +15349,6 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @end -/** - * Cluster Client Monitoring - * - * Client Monitoring allows for ensuring that listed clients meet the required monitoring conditions on the server. - */ -MTR_NEWLY_AVAILABLE -@interface MTRBaseClusterClientMonitoring : MTRCluster - -- (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device - endpointID:(NSNumber *)endpointID - queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_NEWLY_AVAILABLE; - -/** - * Command RegisterClientMonitoring - * - * Register a client to the end device - */ -- (void)registerClientMonitoringWithParams:(MTRClientMonitoringClusterRegisterClientMonitoringParams *)params - completion:(MTRStatusCompletion)completion MTR_NEWLY_AVAILABLE; -/** - * Command UnregisterClientMonitoring - * - * Unregister a client from an end device - */ -- (void)unregisterClientMonitoringWithParams:(MTRClientMonitoringClusterUnregisterClientMonitoringParams *)params - completion:(MTRStatusCompletion)completion MTR_NEWLY_AVAILABLE; -/** - * Command StayAwakeRequest - * - * Request the end device to stay in Active Mode for an additional ActiveModeThreshold - */ -- (void)stayAwakeRequestWithParams:(MTRClientMonitoringClusterStayAwakeRequestParams * _Nullable)params - completion:(MTRStatusCompletion)completion MTR_NEWLY_AVAILABLE; -- (void)stayAwakeRequestWithCompletion:(MTRStatusCompletion)completion MTR_NEWLY_AVAILABLE; - -- (void)readAttributeIdleModeIntervalWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion - MTR_NEWLY_AVAILABLE; -- (void)subscribeAttributeIdleModeIntervalWithParams:(MTRSubscribeParams *)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler - MTR_NEWLY_AVAILABLE; -+ (void)readAttributeIdleModeIntervalWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion:(void (^)(NSNumber * _Nullable value, - NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - -- (void)readAttributeActiveModeIntervalWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion - MTR_NEWLY_AVAILABLE; -- (void)subscribeAttributeActiveModeIntervalWithParams:(MTRSubscribeParams *)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, - NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; -+ (void)readAttributeActiveModeIntervalWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion:(void (^)(NSNumber * _Nullable value, - NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - -- (void)readAttributeActiveModeThresholdWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion - MTR_NEWLY_AVAILABLE; -- (void)subscribeAttributeActiveModeThresholdWithParams:(MTRSubscribeParams *)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, - NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; -+ (void)readAttributeActiveModeThresholdWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion:(void (^)(NSNumber * _Nullable value, - NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - -- (void)readAttributeExpectedClientsWithParams:(MTRReadParams * _Nullable)params - completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion - MTR_NEWLY_AVAILABLE; -- (void)subscribeAttributeExpectedClientsWithParams:(MTRSubscribeParams *)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler - MTR_NEWLY_AVAILABLE; -+ (void)readAttributeExpectedClientsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion - MTR_NEWLY_AVAILABLE; - -- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion - MTR_NEWLY_AVAILABLE; -- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams *)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, - NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; -+ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion:(void (^)(NSArray * _Nullable value, - NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - -- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion - MTR_NEWLY_AVAILABLE; -- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams *)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, - NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; -+ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion:(void (^)(NSArray * _Nullable value, - NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - -- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion - MTR_NEWLY_AVAILABLE; -- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams *)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler - MTR_NEWLY_AVAILABLE; -+ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion - MTR_NEWLY_AVAILABLE; - -- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion - MTR_NEWLY_AVAILABLE; -- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams *)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler - MTR_NEWLY_AVAILABLE; -+ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion - MTR_NEWLY_AVAILABLE; - -- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion - MTR_NEWLY_AVAILABLE; -- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams *)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler - MTR_NEWLY_AVAILABLE; -+ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion:(void (^)(NSNumber * _Nullable value, - NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)new NS_UNAVAILABLE; - -@end - /** * Cluster Unit Testing * diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index b81b29a9b371a1..c8b4e71e2127da 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -104070,542 +104070,6 @@ - (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16 @end -@implementation MTRBaseClusterClientMonitoring - -- (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue -{ - if (self = [super initWithQueue:queue]) { - if (device == nil) { - return nil; - } - - _device = device; - _endpoint = [endpointID unsignedShortValue]; - } - return self; -} - -- (void)registerClientMonitoringWithParams:(MTRClientMonitoringClusterRegisterClientMonitoringParams *)params - completion:(MTRStatusCompletion)completion -{ - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, - MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - chip::Optional timedInvokeTimeoutMs; - ListFreer listFreer; - ClientMonitoring::Commands::RegisterClientMonitoring::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - } - request.clientNodeId = params.clientNodeId.unsignedLongLongValue; - request.ICid = params.iCid.unsignedLongLongValue; - - return MTRStartInvokeInteraction( - typedBridge, request, exchangeManager, session, successCb, failureCb, self->_endpoint, timedInvokeTimeoutMs); - }); - std::move(*bridge).DispatchAction(self.device); -} - -- (void)unregisterClientMonitoringWithParams:(MTRClientMonitoringClusterUnregisterClientMonitoringParams *)params - completion:(MTRStatusCompletion)completion -{ - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, - MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - chip::Optional timedInvokeTimeoutMs; - ListFreer listFreer; - ClientMonitoring::Commands::UnregisterClientMonitoring::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - } - request.clientNodeId = params.clientNodeId.unsignedLongLongValue; - request.ICid = params.iCid.unsignedLongLongValue; - - return MTRStartInvokeInteraction( - typedBridge, request, exchangeManager, session, successCb, failureCb, self->_endpoint, timedInvokeTimeoutMs); - }); - std::move(*bridge).DispatchAction(self.device); -} - -- (void)stayAwakeRequestWithCompletion:(MTRStatusCompletion)completion -{ - [self stayAwakeRequestWithParams:nil completion:completion]; -} -- (void)stayAwakeRequestWithParams:(MTRClientMonitoringClusterStayAwakeRequestParams * _Nullable)params - completion:(MTRStatusCompletion)completion -{ - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, - MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - chip::Optional timedInvokeTimeoutMs; - ListFreer listFreer; - ClientMonitoring::Commands::StayAwakeRequest::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - } - - return MTRStartInvokeInteraction( - typedBridge, request, exchangeManager, session, successCb, failureCb, self->_endpoint, timedInvokeTimeoutMs); - }); - std::move(*bridge).DispatchAction(self.device); -} - -- (void)readAttributeIdleModeIntervalWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - MTRReadParams * params = [[MTRReadParams alloc] init]; - using TypeInfo = ClientMonitoring::Attributes::IdleModeInterval::TypeInfo; - return MTRReadAttribute( - params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); -} - -- (void)subscribeAttributeIdleModeIntervalWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = ClientMonitoring::Attributes::IdleModeInterval::TypeInfo; - MTRSubscribeAttribute(params, - subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), - TypeInfo::GetAttributeId()); -} - -+ (void)readAttributeIdleModeIntervalWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion: - (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( - clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ClientMonitoring::Attributes::IdleModeInterval::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); -} - -- (void)readAttributeActiveModeIntervalWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - MTRReadParams * params = [[MTRReadParams alloc] init]; - using TypeInfo = ClientMonitoring::Attributes::ActiveModeInterval::TypeInfo; - return MTRReadAttribute( - params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); -} - -- (void)subscribeAttributeActiveModeIntervalWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler: - (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = ClientMonitoring::Attributes::ActiveModeInterval::TypeInfo; - MTRSubscribeAttribute(params, - subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), - TypeInfo::GetAttributeId()); -} - -+ (void)readAttributeActiveModeIntervalWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion: - (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( - clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ClientMonitoring::Attributes::ActiveModeInterval::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); -} - -- (void)readAttributeActiveModeThresholdWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - MTRReadParams * params = [[MTRReadParams alloc] init]; - using TypeInfo = ClientMonitoring::Attributes::ActiveModeThreshold::TypeInfo; - return MTRReadAttribute( - params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); -} - -- (void)subscribeAttributeActiveModeThresholdWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler: - (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = ClientMonitoring::Attributes::ActiveModeThreshold::TypeInfo; - MTRSubscribeAttribute(params, - subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), - TypeInfo::GetAttributeId()); -} - -+ (void)readAttributeActiveModeThresholdWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion: - (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( - clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ClientMonitoring::Attributes::ActiveModeThreshold::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); -} - -- (void)readAttributeExpectedClientsWithParams:(MTRReadParams * _Nullable)params - completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ // Make a copy of params before we go async. - params = [params copy]; - using TypeInfo = ClientMonitoring::Attributes::ExpectedClients::TypeInfo; - return MTRReadAttribute( - params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); -} - -- (void)subscribeAttributeExpectedClientsWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = ClientMonitoring::Attributes::ExpectedClients::TypeInfo; - MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, - TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); -} - -+ (void)readAttributeExpectedClientsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - auto * bridge = new MTRClientMonitoringExpectedClientsListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, - ^(ClientMonitoringExpectedClientsListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ClientMonitoring::Attributes::ExpectedClients::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); -} - -- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - MTRReadParams * params = [[MTRReadParams alloc] init]; - using TypeInfo = ClientMonitoring::Attributes::GeneratedCommandList::TypeInfo; - return MTRReadAttribute( - params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); -} - -- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler: - (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = ClientMonitoring::Attributes::GeneratedCommandList::TypeInfo; - MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, - TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); -} - -+ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion: - (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - auto * bridge = new MTRClientMonitoringGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, - ^(ClientMonitoringGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ClientMonitoring::Attributes::GeneratedCommandList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); -} - -- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - MTRReadParams * params = [[MTRReadParams alloc] init]; - using TypeInfo = ClientMonitoring::Attributes::AcceptedCommandList::TypeInfo; - return MTRReadAttribute( - params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); -} - -- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler: - (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = ClientMonitoring::Attributes::AcceptedCommandList::TypeInfo; - MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, - TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); -} - -+ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion: - (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - auto * bridge = new MTRClientMonitoringAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, - ^(ClientMonitoringAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ClientMonitoring::Attributes::AcceptedCommandList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); -} - -- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - MTRReadParams * params = [[MTRReadParams alloc] init]; - using TypeInfo = ClientMonitoring::Attributes::AttributeList::TypeInfo; - return MTRReadAttribute( - params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); -} - -- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = ClientMonitoring::Attributes::AttributeList::TypeInfo; - MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, - TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); -} - -+ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - auto * bridge = new MTRClientMonitoringAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, - ^(ClientMonitoringAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ClientMonitoring::Attributes::AttributeList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); -} - -- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - MTRReadParams * params = [[MTRReadParams alloc] init]; - using TypeInfo = ClientMonitoring::Attributes::FeatureMap::TypeInfo; - return MTRReadAttribute( - params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); -} - -- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = ClientMonitoring::Attributes::FeatureMap::TypeInfo; - MTRSubscribeAttribute(params, - subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), - TypeInfo::GetAttributeId()); -} - -+ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( - clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ClientMonitoring::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); -} - -- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - MTRReadParams * params = [[MTRReadParams alloc] init]; - using TypeInfo = ClientMonitoring::Attributes::ClusterRevision::TypeInfo; - return MTRReadAttribute( - params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); -} - -- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = ClientMonitoring::Attributes::ClusterRevision::TypeInfo; - MTRSubscribeAttribute(params, - subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), - TypeInfo::GetAttributeId()); -} - -+ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion: - (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( - clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ClientMonitoring::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); -} - -@end - -@implementation MTRBaseClusterClientMonitoring (Deprecated) - -- (void)registerClientMonitoringWithParams:(MTRClientMonitoringClusterRegisterClientMonitoringParams *)params - completionHandler:(MTRStatusCompletion)completionHandler -{ - [self registerClientMonitoringWithParams:params completion:completionHandler]; -} -- (void)unregisterClientMonitoringWithParams:(MTRClientMonitoringClusterUnregisterClientMonitoringParams *)params - completionHandler:(MTRStatusCompletion)completionHandler -{ - [self unregisterClientMonitoringWithParams:params completion:completionHandler]; -} -- (void)stayAwakeRequestWithParams:(MTRClientMonitoringClusterStayAwakeRequestParams * _Nullable)params - completionHandler:(MTRStatusCompletion)completionHandler -{ - [self stayAwakeRequestWithParams:params completion:completionHandler]; -} -- (void)stayAwakeRequestWithCompletionHandler:(MTRStatusCompletion)completionHandler -{ - [self stayAwakeRequestWithParams:nil completionHandler:completionHandler]; -} - -- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue -{ - return [self initWithDevice:device endpointID:@(endpoint) queue:queue]; -} - -@end - @implementation MTRBaseClusterUnitTesting - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h index 065387a01f13a6..333bc902185570 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h @@ -342,11 +342,6 @@ @property (nonatomic, assign, readonly) chip::EndpointId endpoint; @end -@interface MTRBaseClusterClientMonitoring () -@property (nonatomic, strong, readonly) MTRBaseDevice * device; -@property (nonatomic, assign, readonly) chip::EndpointId endpoint; -@end - @interface MTRBaseClusterUnitTesting () @property (nonatomic, strong, readonly) MTRBaseDevice * device; @property (nonatomic, assign, readonly) chip::EndpointId endpoint; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h index 54c0fb4dc1f5fe..c3d79ef81d5c97 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h @@ -1074,16 +1074,6 @@ typedef void (*ElectricalMeasurementAcceptedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*ElectricalMeasurementAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*ClientMonitoringExpectedClientsListAttributeCallback)( - void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::ClientMonitoring::Structs::MonitoringRegistration::DecodableType> & data); -typedef void (*ClientMonitoringGeneratedCommandListListAttributeCallback)( - void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*ClientMonitoringAcceptedCommandListListAttributeCallback)( - void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*ClientMonitoringAttributeListListAttributeCallback)( - void * context, const chip::app::DataModel::DecodableList & data); typedef void (*UnitTestingBitmap8AttributeCallback)(void *, chip::BitMask); typedef void (*UnitTestingBitmap16AttributeCallback)(void *, chip::BitMask); typedef void (*UnitTestingBitmap32AttributeCallback)(void *, chip::BitMask); @@ -10244,140 +10234,6 @@ class MTRElectricalMeasurementAttributeListListAttributeCallbackSubscriptionBrid MTRSubscriptionEstablishedHandler mEstablishedHandler; }; -class MTRClientMonitoringExpectedClientsListAttributeCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRClientMonitoringExpectedClientsListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRClientMonitoringExpectedClientsListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::ClientMonitoring::Structs::MonitoringRegistration::DecodableType> & value); -}; - -class MTRClientMonitoringExpectedClientsListAttributeCallbackSubscriptionBridge - : public MTRClientMonitoringExpectedClientsListAttributeCallbackBridge -{ -public: - MTRClientMonitoringExpectedClientsListAttributeCallbackSubscriptionBridge( - dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, - MTRSubscriptionEstablishedHandler establishedHandler) : - MTRClientMonitoringExpectedClientsListAttributeCallbackBridge(queue, handler, action), - mEstablishedHandler(establishedHandler) - {} - - void OnSubscriptionEstablished(); - using MTRClientMonitoringExpectedClientsListAttributeCallbackBridge::KeepAliveOnCallback; - using MTRClientMonitoringExpectedClientsListAttributeCallbackBridge::OnDone; - -private: - MTRSubscriptionEstablishedHandler mEstablishedHandler; -}; - -class MTRClientMonitoringGeneratedCommandListListAttributeCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRClientMonitoringGeneratedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRClientMonitoringGeneratedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); -}; - -class MTRClientMonitoringGeneratedCommandListListAttributeCallbackSubscriptionBridge - : public MTRClientMonitoringGeneratedCommandListListAttributeCallbackBridge -{ -public: - MTRClientMonitoringGeneratedCommandListListAttributeCallbackSubscriptionBridge( - dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, - MTRSubscriptionEstablishedHandler establishedHandler) : - MTRClientMonitoringGeneratedCommandListListAttributeCallbackBridge(queue, handler, action), - mEstablishedHandler(establishedHandler) - {} - - void OnSubscriptionEstablished(); - using MTRClientMonitoringGeneratedCommandListListAttributeCallbackBridge::KeepAliveOnCallback; - using MTRClientMonitoringGeneratedCommandListListAttributeCallbackBridge::OnDone; - -private: - MTRSubscriptionEstablishedHandler mEstablishedHandler; -}; - -class MTRClientMonitoringAcceptedCommandListListAttributeCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRClientMonitoringAcceptedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRClientMonitoringAcceptedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); -}; - -class MTRClientMonitoringAcceptedCommandListListAttributeCallbackSubscriptionBridge - : public MTRClientMonitoringAcceptedCommandListListAttributeCallbackBridge -{ -public: - MTRClientMonitoringAcceptedCommandListListAttributeCallbackSubscriptionBridge( - dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, - MTRSubscriptionEstablishedHandler establishedHandler) : - MTRClientMonitoringAcceptedCommandListListAttributeCallbackBridge(queue, handler, action), - mEstablishedHandler(establishedHandler) - {} - - void OnSubscriptionEstablished(); - using MTRClientMonitoringAcceptedCommandListListAttributeCallbackBridge::KeepAliveOnCallback; - using MTRClientMonitoringAcceptedCommandListListAttributeCallbackBridge::OnDone; - -private: - MTRSubscriptionEstablishedHandler mEstablishedHandler; -}; - -class MTRClientMonitoringAttributeListListAttributeCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRClientMonitoringAttributeListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRClientMonitoringAttributeListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); -}; - -class MTRClientMonitoringAttributeListListAttributeCallbackSubscriptionBridge - : public MTRClientMonitoringAttributeListListAttributeCallbackBridge -{ -public: - MTRClientMonitoringAttributeListListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action, - MTRSubscriptionEstablishedHandler establishedHandler) : - MTRClientMonitoringAttributeListListAttributeCallbackBridge(queue, handler, action), - mEstablishedHandler(establishedHandler) - {} - - void OnSubscriptionEstablished(); - using MTRClientMonitoringAttributeListListAttributeCallbackBridge::KeepAliveOnCallback; - using MTRClientMonitoringAttributeListListAttributeCallbackBridge::OnDone; - -private: - MTRSubscriptionEstablishedHandler mEstablishedHandler; -}; - class MTRUnitTestingBitmap8AttributeCallbackBridge : public MTRCallbackBridge { public: diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm index 28d59429a107bf..af6b57bc696872 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm @@ -10413,162 +10413,6 @@ } } -void MTRClientMonitoringExpectedClientsListAttributeCallbackBridge::OnSuccessFn(void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::ClientMonitoring::Structs::MonitoringRegistration::DecodableType> & value) -{ - NSArray * _Nonnull objCValue; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = value.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRClientMonitoringClusterMonitoringRegistration * newElement_0; - newElement_0 = [MTRClientMonitoringClusterMonitoringRegistration new]; - newElement_0.clientNodeId = [NSNumber numberWithUnsignedLongLong:entry_0.clientNodeId]; - newElement_0.iCid = [NSNumber numberWithUnsignedLongLong:entry_0.ICid]; - newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - objCValue = array_0; - } - DispatchSuccess(context, objCValue); -}; - -void MTRClientMonitoringExpectedClientsListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() -{ - if (!mQueue) { - return; - } - - if (mEstablishedHandler != nil) { - dispatch_async(mQueue, mEstablishedHandler); - // On failure, mEstablishedHandler will be cleaned up by our destructor, - // but we can clean it up earlier on successful subscription - // establishment. - mEstablishedHandler = nil; - } -} - -void MTRClientMonitoringGeneratedCommandListListAttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::DataModel::DecodableList & value) -{ - NSArray * _Nonnull objCValue; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = value.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - objCValue = array_0; - } - DispatchSuccess(context, objCValue); -}; - -void MTRClientMonitoringGeneratedCommandListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() -{ - if (!mQueue) { - return; - } - - if (mEstablishedHandler != nil) { - dispatch_async(mQueue, mEstablishedHandler); - // On failure, mEstablishedHandler will be cleaned up by our destructor, - // but we can clean it up earlier on successful subscription - // establishment. - mEstablishedHandler = nil; - } -} - -void MTRClientMonitoringAcceptedCommandListListAttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::DataModel::DecodableList & value) -{ - NSArray * _Nonnull objCValue; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = value.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - objCValue = array_0; - } - DispatchSuccess(context, objCValue); -}; - -void MTRClientMonitoringAcceptedCommandListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() -{ - if (!mQueue) { - return; - } - - if (mEstablishedHandler != nil) { - dispatch_async(mQueue, mEstablishedHandler); - // On failure, mEstablishedHandler will be cleaned up by our destructor, - // but we can clean it up earlier on successful subscription - // establishment. - mEstablishedHandler = nil; - } -} - -void MTRClientMonitoringAttributeListListAttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::DataModel::DecodableList & value) -{ - NSArray * _Nonnull objCValue; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = value.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - objCValue = array_0; - } - DispatchSuccess(context, objCValue); -}; - -void MTRClientMonitoringAttributeListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() -{ - if (!mQueue) { - return; - } - - if (mEstablishedHandler != nil) { - dispatch_async(mQueue, mEstablishedHandler); - // On failure, mEstablishedHandler will be cleaned up by our destructor, - // but we can clean it up earlier on successful subscription - // establishment. - mEstablishedHandler = nil; - } -} - void MTRUnitTestingBitmap8AttributeCallbackBridge::OnSuccessFn( void * context, chip::BitMask value) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index b8fe172dc3dafa..951a44b5ae611b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -303,7 +303,6 @@ typedef NS_ENUM(uint32_t, MTRClusterIDType) { MTRClusterIDTypeApplicationBasicID MTR_NEWLY_AVAILABLE = 0x0000050D, MTRClusterIDTypeAccountLoginID MTR_NEWLY_AVAILABLE = 0x0000050E, MTRClusterIDTypeElectricalMeasurementID MTR_NEWLY_AVAILABLE = 0x00000B04, - MTRClusterIDTypeClientMonitoringID MTR_NEWLY_AVAILABLE = 0x00001046, MTRClusterIDTypeUnitTestingID MTR_NEWLY_AVAILABLE = 0xFFF1FC05, MTRClusterIDTypeFaultInjectionID MTR_NEWLY_AVAILABLE = 0xFFF1FC06, }; @@ -5190,22 +5189,6 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterElectricalMeasurementAttributeClusterRevisionID MTR_NEWLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, - // Cluster ClientMonitoring attributes - MTRAttributeIDTypeClusterClientMonitoringAttributeIdleModeIntervalID MTR_NEWLY_AVAILABLE = 0x00000000, - MTRAttributeIDTypeClusterClientMonitoringAttributeActiveModeIntervalID MTR_NEWLY_AVAILABLE = 0x00000001, - MTRAttributeIDTypeClusterClientMonitoringAttributeActiveModeThresholdID MTR_NEWLY_AVAILABLE = 0x00000002, - MTRAttributeIDTypeClusterClientMonitoringAttributeExpectedClientsID MTR_NEWLY_AVAILABLE = 0x00000003, - MTRAttributeIDTypeClusterClientMonitoringAttributeGeneratedCommandListID MTR_NEWLY_AVAILABLE - = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, - MTRAttributeIDTypeClusterClientMonitoringAttributeAcceptedCommandListID MTR_NEWLY_AVAILABLE - = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, - MTRAttributeIDTypeClusterClientMonitoringAttributeAttributeListID MTR_NEWLY_AVAILABLE - = MTRAttributeIDTypeGlobalAttributeAttributeListID, - MTRAttributeIDTypeClusterClientMonitoringAttributeFeatureMapID MTR_NEWLY_AVAILABLE - = MTRAttributeIDTypeGlobalAttributeFeatureMapID, - MTRAttributeIDTypeClusterClientMonitoringAttributeClusterRevisionID MTR_NEWLY_AVAILABLE - = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, - // Cluster TestCluster deprecated attribute names MTRClusterTestClusterAttributeBooleanID API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) MTR_NEWLY_DEPRECATED("Please use MTRAttributeIDTypeClusterUnitTestingAttributeBooleanID") @@ -6594,11 +6577,6 @@ typedef NS_ENUM(uint32_t, MTRCommandIDType) { MTRCommandIDTypeClusterElectricalMeasurementCommandGetMeasurementProfileResponseCommandID MTR_NEWLY_AVAILABLE = 0x00000001, MTRCommandIDTypeClusterElectricalMeasurementCommandGetMeasurementProfileCommandID MTR_NEWLY_AVAILABLE = 0x00000001, - // Cluster ClientMonitoring commands - MTRCommandIDTypeClusterClientMonitoringCommandRegisterClientMonitoringID MTR_NEWLY_AVAILABLE = 0x00000000, - MTRCommandIDTypeClusterClientMonitoringCommandUnregisterClientMonitoringID MTR_NEWLY_AVAILABLE = 0x00000001, - MTRCommandIDTypeClusterClientMonitoringCommandStayAwakeRequestID MTR_NEWLY_AVAILABLE = 0x00000002, - // Cluster TestCluster deprecated command id names MTRClusterTestClusterCommandTestID API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) MTR_NEWLY_DEPRECATED("Please use MTRCommandIDTypeClusterUnitTestingCommandTestID") diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index b5fde881dbaed7..c374d5bc9a260e 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -5867,56 +5867,6 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @end -/** - * Cluster Client Monitoring - * Client Monitoring allows for ensuring that listed clients meet the required monitoring conditions on the server. - */ -MTR_NEWLY_AVAILABLE -@interface MTRClusterClientMonitoring : MTRCluster - -- (instancetype _Nullable)initWithDevice:(MTRDevice *)device - endpointID:(NSNumber *)endpointID - queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_NEWLY_AVAILABLE; - -- (void)registerClientMonitoringWithParams:(MTRClientMonitoringClusterRegisterClientMonitoringParams *)params - expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries - expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs - completion:(MTRStatusCompletion)completion MTR_NEWLY_AVAILABLE; -- (void)unregisterClientMonitoringWithParams:(MTRClientMonitoringClusterUnregisterClientMonitoringParams *)params - expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries - expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs - completion:(MTRStatusCompletion)completion MTR_NEWLY_AVAILABLE; -- (void)stayAwakeRequestWithParams:(MTRClientMonitoringClusterStayAwakeRequestParams * _Nullable)params - expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries - expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs - completion:(MTRStatusCompletion)completion MTR_NEWLY_AVAILABLE; -- (void)stayAwakeRequestWithExpectedValues:(NSArray *> *)expectedValues - expectedValueInterval:(NSNumber *)expectedValueIntervalMs - completion:(MTRStatusCompletion)completion MTR_NEWLY_AVAILABLE; - -- (NSDictionary *)readAttributeIdleModeIntervalWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; - -- (NSDictionary *)readAttributeActiveModeIntervalWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; - -- (NSDictionary *)readAttributeActiveModeThresholdWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; - -- (NSDictionary *)readAttributeExpectedClientsWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; - -- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; - -- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; - -- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; - -- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; - -- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; - -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)new NS_UNAVAILABLE; - -@end - /** * Cluster Unit Testing * The Test Cluster is meant to validate the generated code diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index 671370f3e1624f..60a943cc11bcaf 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -5448,7 +5448,6 @@ - (void)writeAttributeLocalConfigDisabledWithValue:(NSDictionary } @end - @implementation MTRClusterBasic @end @@ -5757,7 +5756,6 @@ - (void)notifyUpdateAppliedWithParams:(MTROTASoftwareUpdateProviderClusterNotify } @end - @implementation MTRClusterOtaSoftwareUpdateProvider @end @@ -5988,7 +5986,6 @@ - (void)writeAttributeDefaultOTAProvidersWithValue:(NSDictionary } @end - @implementation MTRClusterOtaSoftwareUpdateRequestor @end @@ -20599,7 +20596,6 @@ - (instancetype)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpoi } @end - @implementation MTRClusterWakeOnLan @end @@ -25636,324 +25632,6 @@ - (void)getMeasurementProfileCommandWithParams:(MTRElectricalMeasurementClusterG } @end -@implementation MTRClusterClientMonitoring - -- (instancetype)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue -{ - if (self = [super initWithQueue:queue]) { - if (device == nil) { - return nil; - } - - _endpoint = [endpointID unsignedShortValue]; - _device = device; - } - return self; -} - -- (void)registerClientMonitoringWithParams:(MTRClientMonitoringClusterRegisterClientMonitoringParams *)params - expectedValues:(NSArray *> *)expectedValues - expectedValueInterval:(NSNumber *)expectedValueIntervalMs - completion:(MTRStatusCompletion)completion -{ - NSString * logPrefix = [NSString stringWithFormat:@"MTRDevice command %u %u %u %u", self.device.deviceController.fabricIndex, - _endpoint, (unsigned int) MTRClusterIDTypeClientMonitoringID, - (unsigned int) MTRCommandIDTypeClusterClientMonitoringCommandRegisterClientMonitoringID]; - // Make a copy of params before we go async. - params = [params copy]; - NSNumber * timedInvokeTimeoutMsParam = params.timedInvokeTimeoutMs; - if (timedInvokeTimeoutMsParam) { - timedInvokeTimeoutMsParam = MTRClampedNumber(timedInvokeTimeoutMsParam, @(1), @(UINT16_MAX)); - } - MTRAsyncCallbackQueueWorkItem * workItem = [[MTRAsyncCallbackQueueWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID - controller:self.device.deviceController]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.device.queue, - ^(id _Nullable value, NSError * _Nullable error) { - MTRClustersLogCompletion(logPrefix, value, error); - dispatch_async(self.callbackQueue, ^{ - completion(error); - }); - [workItem endWork]; - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, - MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - chip::Optional timedInvokeTimeoutMs; - ListFreer listFreer; - ClientMonitoring::Commands::RegisterClientMonitoring::Type request; - if (timedInvokeTimeoutMsParam != nil) { - timedInvokeTimeoutMs.SetValue(timedInvokeTimeoutMsParam.unsignedShortValue); - } - request.clientNodeId = params.clientNodeId.unsignedLongLongValue; - request.ICid = params.iCid.unsignedLongLongValue; - - chip::Controller::ClientMonitoringCluster cppCluster(exchangeManager, session, self->_endpoint); - return cppCluster.InvokeCommand(request, bridge, successCb, failureCb, timedInvokeTimeoutMs); - }); - std::move(*bridge).DispatchAction(baseDevice); - }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; - - if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { - expectedValues = nil; - } else { - expectedValueIntervalMs = MTRClampedNumber(expectedValueIntervalMs, @(1), @(UINT32_MAX)); - } - if (expectedValues) { - [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; - } -} - -- (void)unregisterClientMonitoringWithParams:(MTRClientMonitoringClusterUnregisterClientMonitoringParams *)params - expectedValues:(NSArray *> *)expectedValues - expectedValueInterval:(NSNumber *)expectedValueIntervalMs - completion:(MTRStatusCompletion)completion -{ - NSString * logPrefix = [NSString stringWithFormat:@"MTRDevice command %u %u %u %u", self.device.deviceController.fabricIndex, - _endpoint, (unsigned int) MTRClusterIDTypeClientMonitoringID, - (unsigned int) MTRCommandIDTypeClusterClientMonitoringCommandUnregisterClientMonitoringID]; - // Make a copy of params before we go async. - params = [params copy]; - NSNumber * timedInvokeTimeoutMsParam = params.timedInvokeTimeoutMs; - if (timedInvokeTimeoutMsParam) { - timedInvokeTimeoutMsParam = MTRClampedNumber(timedInvokeTimeoutMsParam, @(1), @(UINT16_MAX)); - } - MTRAsyncCallbackQueueWorkItem * workItem = [[MTRAsyncCallbackQueueWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID - controller:self.device.deviceController]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.device.queue, - ^(id _Nullable value, NSError * _Nullable error) { - MTRClustersLogCompletion(logPrefix, value, error); - dispatch_async(self.callbackQueue, ^{ - completion(error); - }); - [workItem endWork]; - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, - MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - chip::Optional timedInvokeTimeoutMs; - ListFreer listFreer; - ClientMonitoring::Commands::UnregisterClientMonitoring::Type request; - if (timedInvokeTimeoutMsParam != nil) { - timedInvokeTimeoutMs.SetValue(timedInvokeTimeoutMsParam.unsignedShortValue); - } - request.clientNodeId = params.clientNodeId.unsignedLongLongValue; - request.ICid = params.iCid.unsignedLongLongValue; - - chip::Controller::ClientMonitoringCluster cppCluster(exchangeManager, session, self->_endpoint); - return cppCluster.InvokeCommand(request, bridge, successCb, failureCb, timedInvokeTimeoutMs); - }); - std::move(*bridge).DispatchAction(baseDevice); - }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; - - if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { - expectedValues = nil; - } else { - expectedValueIntervalMs = MTRClampedNumber(expectedValueIntervalMs, @(1), @(UINT32_MAX)); - } - if (expectedValues) { - [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; - } -} - -- (void)stayAwakeRequestWithExpectedValues:(NSArray *> *)expectedValues - expectedValueInterval:(NSNumber *)expectedValueIntervalMs - completion:(MTRStatusCompletion)completion -{ - [self stayAwakeRequestWithParams:nil - expectedValues:expectedValues - expectedValueInterval:expectedValueIntervalMs - completion:completion]; -} -- (void)stayAwakeRequestWithParams:(MTRClientMonitoringClusterStayAwakeRequestParams * _Nullable)params - expectedValues:(NSArray *> *)expectedValues - expectedValueInterval:(NSNumber *)expectedValueIntervalMs - completion:(MTRStatusCompletion)completion -{ - NSString * logPrefix = [NSString stringWithFormat:@"MTRDevice command %u %u %u %u", self.device.deviceController.fabricIndex, - _endpoint, (unsigned int) MTRClusterIDTypeClientMonitoringID, - (unsigned int) MTRCommandIDTypeClusterClientMonitoringCommandStayAwakeRequestID]; - // Make a copy of params before we go async. - params = [params copy]; - NSNumber * timedInvokeTimeoutMsParam = params.timedInvokeTimeoutMs; - if (timedInvokeTimeoutMsParam) { - timedInvokeTimeoutMsParam = MTRClampedNumber(timedInvokeTimeoutMsParam, @(1), @(UINT16_MAX)); - } - MTRAsyncCallbackQueueWorkItem * workItem = [[MTRAsyncCallbackQueueWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID - controller:self.device.deviceController]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.device.queue, - ^(id _Nullable value, NSError * _Nullable error) { - MTRClustersLogCompletion(logPrefix, value, error); - dispatch_async(self.callbackQueue, ^{ - completion(error); - }); - [workItem endWork]; - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, - MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - chip::Optional timedInvokeTimeoutMs; - ListFreer listFreer; - ClientMonitoring::Commands::StayAwakeRequest::Type request; - if (timedInvokeTimeoutMsParam != nil) { - timedInvokeTimeoutMs.SetValue(timedInvokeTimeoutMsParam.unsignedShortValue); - } - - chip::Controller::ClientMonitoringCluster cppCluster(exchangeManager, session, self->_endpoint); - return cppCluster.InvokeCommand(request, bridge, successCb, failureCb, timedInvokeTimeoutMs); - }); - std::move(*bridge).DispatchAction(baseDevice); - }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; - - if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { - expectedValues = nil; - } else { - expectedValueIntervalMs = MTRClampedNumber(expectedValueIntervalMs, @(1), @(UINT32_MAX)); - } - if (expectedValues) { - [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; - } -} - -- (NSDictionary *)readAttributeIdleModeIntervalWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterIDTypeClientMonitoringID) - attributeID:@(MTRAttributeIDTypeClusterClientMonitoringAttributeIdleModeIntervalID) - params:params]; -} - -- (NSDictionary *)readAttributeActiveModeIntervalWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterIDTypeClientMonitoringID) - attributeID:@(MTRAttributeIDTypeClusterClientMonitoringAttributeActiveModeIntervalID) - params:params]; -} - -- (NSDictionary *)readAttributeActiveModeThresholdWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterIDTypeClientMonitoringID) - attributeID:@(MTRAttributeIDTypeClusterClientMonitoringAttributeActiveModeThresholdID) - params:params]; -} - -- (NSDictionary *)readAttributeExpectedClientsWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterIDTypeClientMonitoringID) - attributeID:@(MTRAttributeIDTypeClusterClientMonitoringAttributeExpectedClientsID) - params:params]; -} - -- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterIDTypeClientMonitoringID) - attributeID:@(MTRAttributeIDTypeClusterClientMonitoringAttributeGeneratedCommandListID) - params:params]; -} - -- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterIDTypeClientMonitoringID) - attributeID:@(MTRAttributeIDTypeClusterClientMonitoringAttributeAcceptedCommandListID) - params:params]; -} - -- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterIDTypeClientMonitoringID) - attributeID:@(MTRAttributeIDTypeClusterClientMonitoringAttributeAttributeListID) - params:params]; -} - -- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterIDTypeClientMonitoringID) - attributeID:@(MTRAttributeIDTypeClusterClientMonitoringAttributeFeatureMapID) - params:params]; -} - -- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterIDTypeClientMonitoringID) - attributeID:@(MTRAttributeIDTypeClusterClientMonitoringAttributeClusterRevisionID) - params:params]; -} - -@end - -@implementation MTRClusterClientMonitoring (Deprecated) - -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue -{ - return [self initWithDevice:device endpointID:@(endpoint) queue:queue]; -} - -- (void)registerClientMonitoringWithParams:(MTRClientMonitoringClusterRegisterClientMonitoringParams *)params - expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries - expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs - completionHandler:(MTRStatusCompletion)completionHandler -{ - [self registerClientMonitoringWithParams:params - expectedValues:expectedDataValueDictionaries - expectedValueInterval:expectedValueIntervalMs - completion:completionHandler]; -} -- (void)unregisterClientMonitoringWithParams:(MTRClientMonitoringClusterUnregisterClientMonitoringParams *)params - expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries - expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs - completionHandler:(MTRStatusCompletion)completionHandler -{ - [self unregisterClientMonitoringWithParams:params - expectedValues:expectedDataValueDictionaries - expectedValueInterval:expectedValueIntervalMs - completion:completionHandler]; -} -- (void)stayAwakeRequestWithParams:(MTRClientMonitoringClusterStayAwakeRequestParams * _Nullable)params - expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries - expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs - completionHandler:(MTRStatusCompletion)completionHandler -{ - [self stayAwakeRequestWithParams:params - expectedValues:expectedDataValueDictionaries - expectedValueInterval:expectedValueIntervalMs - completion:completionHandler]; -} -- (void)stayAwakeRequestWithExpectedValues:(NSArray *> *)expectedValues - expectedValueInterval:(NSNumber *)expectedValueIntervalMs - completionHandler:(MTRStatusCompletion)completionHandler -{ - [self stayAwakeRequestWithParams:nil - expectedValues:expectedValues - expectedValueInterval:expectedValueIntervalMs - completionHandler:completionHandler]; -} -@end - @implementation MTRClusterUnitTesting - (instancetype)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue @@ -30316,7 +29994,6 @@ - (void)writeAttributeWriteOnlyInt8uWithValue:(NSDictionary *)da } @end - @implementation MTRClusterTestCluster @end diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h index 84d58b18bd299a..fe4cc255dcb8f5 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h @@ -343,11 +343,6 @@ @property (nonatomic, readonly) MTRDevice * device; @end -@interface MTRClusterClientMonitoring () -@property (nonatomic, readonly) uint16_t endpoint; -@property (nonatomic, readonly) MTRDevice * device; -@end - @interface MTRClusterUnitTesting () @property (nonatomic, readonly) uint16_t endpoint; @property (nonatomic, readonly) MTRDevice * device; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h index 5175d794573f57..f2714a5618ee5f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -5178,71 +5178,6 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; @end -MTR_NEWLY_AVAILABLE -@interface MTRClientMonitoringClusterRegisterClientMonitoringParams : NSObject - -@property (nonatomic, copy) NSNumber * _Nonnull clientNodeId MTR_NEWLY_AVAILABLE; - -@property (nonatomic, copy) NSNumber * _Nonnull iCid MTR_NEWLY_AVAILABLE; -/** - * Controls whether the command is a timed command (using Timed Invoke). - * - * If nil (the default value), a regular invoke is done for commands that do - * not require a timed invoke and a timed invoke with some default timed request - * timeout is done for commands that require a timed invoke. - * - * If not nil, a timed invoke is done, with the provided value used as the timed - * request timeout. The value should be chosen small enough to provide the - * desired security properties but large enough that it will allow a round-trip - * from the sever to the client (for the status response and actual invoke - * request) within the timeout window. - * - */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; -@end - -MTR_NEWLY_AVAILABLE -@interface MTRClientMonitoringClusterUnregisterClientMonitoringParams : NSObject - -@property (nonatomic, copy) NSNumber * _Nonnull clientNodeId MTR_NEWLY_AVAILABLE; - -@property (nonatomic, copy) NSNumber * _Nonnull iCid MTR_NEWLY_AVAILABLE; -/** - * Controls whether the command is a timed command (using Timed Invoke). - * - * If nil (the default value), a regular invoke is done for commands that do - * not require a timed invoke and a timed invoke with some default timed request - * timeout is done for commands that require a timed invoke. - * - * If not nil, a timed invoke is done, with the provided value used as the timed - * request timeout. The value should be chosen small enough to provide the - * desired security properties but large enough that it will allow a round-trip - * from the sever to the client (for the status response and actual invoke - * request) within the timeout window. - * - */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; -@end - -MTR_NEWLY_AVAILABLE -@interface MTRClientMonitoringClusterStayAwakeRequestParams : NSObject -/** - * Controls whether the command is a timed command (using Timed Invoke). - * - * If nil (the default value), a regular invoke is done for commands that do - * not require a timed invoke and a timed invoke with some default timed request - * timeout is done for commands that require a timed invoke. - * - * If not nil, a timed invoke is done, with the provided value used as the timed - * request timeout. The value should be chosen small enough to provide the - * desired security properties but large enough that it will allow a round-trip - * from the sever to the client (for the status response and actual invoke - * request) within the timeout window. - * - */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; -@end - MTR_NEWLY_AVAILABLE @interface MTRUnitTestingClusterTestParams : NSObject /** diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index fc9d9c62e69f31..a002bf55dd823c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -7175,95 +7175,6 @@ - (NSString *)description return descriptionString; } -@end -@implementation MTRClientMonitoringClusterRegisterClientMonitoringParams -- (instancetype)init -{ - if (self = [super init]) { - - _clientNodeId = @(0); - - _iCid = @(0); - _timedInvokeTimeoutMs = nil; - } - return self; -} - -- (id)copyWithZone:(NSZone * _Nullable)zone; -{ - auto other = [[MTRClientMonitoringClusterRegisterClientMonitoringParams alloc] init]; - - other.clientNodeId = self.clientNodeId; - other.iCid = self.iCid; - other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; - - return other; -} - -- (NSString *)description -{ - NSString * descriptionString = - [NSString stringWithFormat:@"<%@: clientNodeId:%@; iCid:%@; >", NSStringFromClass([self class]), _clientNodeId, _iCid]; - return descriptionString; -} - -@end -@implementation MTRClientMonitoringClusterUnregisterClientMonitoringParams -- (instancetype)init -{ - if (self = [super init]) { - - _clientNodeId = @(0); - - _iCid = @(0); - _timedInvokeTimeoutMs = nil; - } - return self; -} - -- (id)copyWithZone:(NSZone * _Nullable)zone; -{ - auto other = [[MTRClientMonitoringClusterUnregisterClientMonitoringParams alloc] init]; - - other.clientNodeId = self.clientNodeId; - other.iCid = self.iCid; - other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; - - return other; -} - -- (NSString *)description -{ - NSString * descriptionString = - [NSString stringWithFormat:@"<%@: clientNodeId:%@; iCid:%@; >", NSStringFromClass([self class]), _clientNodeId, _iCid]; - return descriptionString; -} - -@end -@implementation MTRClientMonitoringClusterStayAwakeRequestParams -- (instancetype)init -{ - if (self = [super init]) { - _timedInvokeTimeoutMs = nil; - } - return self; -} - -- (id)copyWithZone:(NSZone * _Nullable)zone; -{ - auto other = [[MTRClientMonitoringClusterStayAwakeRequestParams alloc] init]; - - other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; - - return other; -} - -- (NSString *)description -{ - NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; - return descriptionString; -} - @end @implementation MTRUnitTestingClusterTestParams - (instancetype)init diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm index cd9d590301347d..a2fa781704a557 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -2256,16 +2256,6 @@ id MTRDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRead } break; } - case Clusters::ClientMonitoring::Id: { - using namespace Clusters::ClientMonitoring; - switch (aPath.mEventId) { - - default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; - break; - } - break; - } case Clusters::UnitTesting::Id: { using namespace Clusters::UnitTesting; switch (aPath.mEventId) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index 4ed03fb24dd717..f25c0a264de5de 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -856,13 +856,6 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy) NSString * _Nonnull applicationId API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); @end -MTR_NEWLY_AVAILABLE -@interface MTRClientMonitoringClusterMonitoringRegistration : NSObject -@property (nonatomic, copy) NSNumber * _Nonnull clientNodeId MTR_NEWLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nonnull iCid MTR_NEWLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nonnull fabricIndex MTR_NEWLY_AVAILABLE; -@end - MTR_NEWLY_AVAILABLE @interface MTRUnitTestingClusterSimpleStruct : NSObject @property (nonatomic, copy) NSNumber * _Nonnull a MTR_NEWLY_AVAILABLE; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index b53d2e9f772f05..03e854a2c5bfb3 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -3695,40 +3695,6 @@ - (NSString *)description @end -@implementation MTRClientMonitoringClusterMonitoringRegistration -- (instancetype)init -{ - if (self = [super init]) { - - _clientNodeId = @(0); - - _iCid = @(0); - - _fabricIndex = @(0); - } - return self; -} - -- (id)copyWithZone:(NSZone * _Nullable)zone -{ - auto other = [[MTRClientMonitoringClusterMonitoringRegistration alloc] init]; - - other.clientNodeId = self.clientNodeId; - other.iCid = self.iCid; - other.fabricIndex = self.fabricIndex; - - return other; -} - -- (NSString *)description -{ - NSString * descriptionString = [NSString stringWithFormat:@"<%@: clientNodeId:%@; iCid:%@; fabricIndex:%@; >", - NSStringFromClass([self class]), _clientNodeId, _iCid, _fabricIndex]; - return descriptionString; -} - -@end - @implementation MTRUnitTestingClusterSimpleStruct - (instancetype)init { diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index da7b7867a33d39..a48c4bdcd29c85 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -86057,802 +86057,6 @@ class SubscribeAttributeElectricalMeasurementClusterRevision : public SubscribeA } }; -/*----------------------------------------------------------------------------*\ -| Cluster ClientMonitoring | 0x1046 | -|------------------------------------------------------------------------------| -| Commands: | | -| * RegisterClientMonitoring | 0x00 | -| * UnregisterClientMonitoring | 0x01 | -| * StayAwakeRequest | 0x02 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * IdleModeInterval | 0x0000 | -| * ActiveModeInterval | 0x0001 | -| * ActiveModeThreshold | 0x0002 | -| * ExpectedClients | 0x0003 | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Command RegisterClientMonitoring - */ -class ClientMonitoringRegisterClientMonitoring : public ClusterCommand { -public: - ClientMonitoringRegisterClientMonitoring() - : ClusterCommand("register-client-monitoring") - { - AddArgument("ClientNodeId", 0, UINT64_MAX, &mRequest.clientNodeId); - AddArgument("ICid", 0, UINT64_MAX, &mRequest.ICid); - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00001046) command (0x00000000) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterClientMonitoring alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - __auto_type * params = [[MTRClientMonitoringClusterRegisterClientMonitoringParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.clientNodeId = [NSNumber numberWithUnsignedLongLong:mRequest.clientNodeId]; - params.iCid = [NSNumber numberWithUnsignedLongLong:mRequest.ICid]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster registerClientMonitoringWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return CHIP_NO_ERROR; - } - -private: - chip::app::Clusters::ClientMonitoring::Commands::RegisterClientMonitoring::Type mRequest; -}; - -/* - * Command UnregisterClientMonitoring - */ -class ClientMonitoringUnregisterClientMonitoring : public ClusterCommand { -public: - ClientMonitoringUnregisterClientMonitoring() - : ClusterCommand("unregister-client-monitoring") - { - AddArgument("ClientNodeId", 0, UINT64_MAX, &mRequest.clientNodeId); - AddArgument("ICid", 0, UINT64_MAX, &mRequest.ICid); - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00001046) command (0x00000001) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterClientMonitoring alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - __auto_type * params = [[MTRClientMonitoringClusterUnregisterClientMonitoringParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.clientNodeId = [NSNumber numberWithUnsignedLongLong:mRequest.clientNodeId]; - params.iCid = [NSNumber numberWithUnsignedLongLong:mRequest.ICid]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster unregisterClientMonitoringWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return CHIP_NO_ERROR; - } - -private: - chip::app::Clusters::ClientMonitoring::Commands::UnregisterClientMonitoring::Type mRequest; -}; - -/* - * Command StayAwakeRequest - */ -class ClientMonitoringStayAwakeRequest : public ClusterCommand { -public: - ClientMonitoringStayAwakeRequest() - : ClusterCommand("stay-awake-request") - { - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00001046) command (0x00000002) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterClientMonitoring alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - __auto_type * params = [[MTRClientMonitoringClusterStayAwakeRequestParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster stayAwakeRequestWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return CHIP_NO_ERROR; - } - -private: -}; - -/* - * Attribute IdleModeInterval - */ -class ReadClientMonitoringIdleModeInterval : public ReadAttribute { -public: - ReadClientMonitoringIdleModeInterval() - : ReadAttribute("idle-mode-interval") - { - } - - ~ReadClientMonitoringIdleModeInterval() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00001046) ReadAttribute (0x00000000) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterClientMonitoring alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - [cluster readAttributeIdleModeIntervalWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ClientMonitoring.IdleModeInterval response %@", [value description]); - if (error != nil) { - LogNSError("ClientMonitoring IdleModeInterval read Error", error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } -}; - -class SubscribeAttributeClientMonitoringIdleModeInterval : public SubscribeAttribute { -public: - SubscribeAttributeClientMonitoringIdleModeInterval() - : SubscribeAttribute("idle-mode-interval") - { - } - - ~SubscribeAttributeClientMonitoringIdleModeInterval() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00001046) ReportAttribute (0x00000000) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterClientMonitoring alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; - if (mKeepSubscriptions.HasValue()) { - params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); - } - if (mFabricFiltered.HasValue()) { - params.filterByFabric = mFabricFiltered.Value(); - } - if (mAutoResubscribe.HasValue()) { - params.resubscribeIfLost = mAutoResubscribe.Value(); - } - [cluster subscribeAttributeIdleModeIntervalWithParams:params - subscriptionEstablished:^() { - mSubscriptionEstablished = YES; - } - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ClientMonitoring.IdleModeInterval response %@", [value description]); - SetCommandExitStatus(error); - }]; - - return CHIP_NO_ERROR; - } -}; - -/* - * Attribute ActiveModeInterval - */ -class ReadClientMonitoringActiveModeInterval : public ReadAttribute { -public: - ReadClientMonitoringActiveModeInterval() - : ReadAttribute("active-mode-interval") - { - } - - ~ReadClientMonitoringActiveModeInterval() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00001046) ReadAttribute (0x00000001) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterClientMonitoring alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - [cluster readAttributeActiveModeIntervalWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ClientMonitoring.ActiveModeInterval response %@", [value description]); - if (error != nil) { - LogNSError("ClientMonitoring ActiveModeInterval read Error", error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } -}; - -class SubscribeAttributeClientMonitoringActiveModeInterval : public SubscribeAttribute { -public: - SubscribeAttributeClientMonitoringActiveModeInterval() - : SubscribeAttribute("active-mode-interval") - { - } - - ~SubscribeAttributeClientMonitoringActiveModeInterval() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00001046) ReportAttribute (0x00000001) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterClientMonitoring alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; - if (mKeepSubscriptions.HasValue()) { - params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); - } - if (mFabricFiltered.HasValue()) { - params.filterByFabric = mFabricFiltered.Value(); - } - if (mAutoResubscribe.HasValue()) { - params.resubscribeIfLost = mAutoResubscribe.Value(); - } - [cluster subscribeAttributeActiveModeIntervalWithParams:params - subscriptionEstablished:^() { - mSubscriptionEstablished = YES; - } - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ClientMonitoring.ActiveModeInterval response %@", [value description]); - SetCommandExitStatus(error); - }]; - - return CHIP_NO_ERROR; - } -}; - -/* - * Attribute ActiveModeThreshold - */ -class ReadClientMonitoringActiveModeThreshold : public ReadAttribute { -public: - ReadClientMonitoringActiveModeThreshold() - : ReadAttribute("active-mode-threshold") - { - } - - ~ReadClientMonitoringActiveModeThreshold() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00001046) ReadAttribute (0x00000002) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterClientMonitoring alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - [cluster readAttributeActiveModeThresholdWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ClientMonitoring.ActiveModeThreshold response %@", [value description]); - if (error != nil) { - LogNSError("ClientMonitoring ActiveModeThreshold read Error", error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } -}; - -class SubscribeAttributeClientMonitoringActiveModeThreshold : public SubscribeAttribute { -public: - SubscribeAttributeClientMonitoringActiveModeThreshold() - : SubscribeAttribute("active-mode-threshold") - { - } - - ~SubscribeAttributeClientMonitoringActiveModeThreshold() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00001046) ReportAttribute (0x00000002) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterClientMonitoring alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; - if (mKeepSubscriptions.HasValue()) { - params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); - } - if (mFabricFiltered.HasValue()) { - params.filterByFabric = mFabricFiltered.Value(); - } - if (mAutoResubscribe.HasValue()) { - params.resubscribeIfLost = mAutoResubscribe.Value(); - } - [cluster subscribeAttributeActiveModeThresholdWithParams:params - subscriptionEstablished:^() { - mSubscriptionEstablished = YES; - } - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ClientMonitoring.ActiveModeThreshold response %@", [value description]); - SetCommandExitStatus(error); - }]; - - return CHIP_NO_ERROR; - } -}; - -/* - * Attribute ExpectedClients - */ -class ReadClientMonitoringExpectedClients : public ReadAttribute { -public: - ReadClientMonitoringExpectedClients() - : ReadAttribute("expected-clients") - { - } - - ~ReadClientMonitoringExpectedClients() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00001046) ReadAttribute (0x00000003) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterClientMonitoring alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - __auto_type * params = [[MTRReadParams alloc] init]; - if (mFabricFiltered.HasValue()) { - params.filterByFabric = mFabricFiltered.Value(); - } - [cluster readAttributeExpectedClientsWithParams:params - completion:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"ClientMonitoring.ExpectedClients response %@", [value description]); - if (error != nil) { - LogNSError("ClientMonitoring ExpectedClients read Error", error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } -}; - -class SubscribeAttributeClientMonitoringExpectedClients : public SubscribeAttribute { -public: - SubscribeAttributeClientMonitoringExpectedClients() - : SubscribeAttribute("expected-clients") - { - } - - ~SubscribeAttributeClientMonitoringExpectedClients() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00001046) ReportAttribute (0x00000003) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterClientMonitoring alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; - if (mKeepSubscriptions.HasValue()) { - params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); - } - if (mFabricFiltered.HasValue()) { - params.filterByFabric = mFabricFiltered.Value(); - } - if (mAutoResubscribe.HasValue()) { - params.resubscribeIfLost = mAutoResubscribe.Value(); - } - [cluster subscribeAttributeExpectedClientsWithParams:params - subscriptionEstablished:^() { - mSubscriptionEstablished = YES; - } - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"ClientMonitoring.ExpectedClients response %@", [value description]); - SetCommandExitStatus(error); - }]; - - return CHIP_NO_ERROR; - } -}; - -/* - * Attribute GeneratedCommandList - */ -class ReadClientMonitoringGeneratedCommandList : public ReadAttribute { -public: - ReadClientMonitoringGeneratedCommandList() - : ReadAttribute("generated-command-list") - { - } - - ~ReadClientMonitoringGeneratedCommandList() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00001046) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterClientMonitoring alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"ClientMonitoring.GeneratedCommandList response %@", [value description]); - if (error != nil) { - LogNSError("ClientMonitoring GeneratedCommandList read Error", error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } -}; - -class SubscribeAttributeClientMonitoringGeneratedCommandList : public SubscribeAttribute { -public: - SubscribeAttributeClientMonitoringGeneratedCommandList() - : SubscribeAttribute("generated-command-list") - { - } - - ~SubscribeAttributeClientMonitoringGeneratedCommandList() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00001046) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterClientMonitoring alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; - if (mKeepSubscriptions.HasValue()) { - params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); - } - if (mFabricFiltered.HasValue()) { - params.filterByFabric = mFabricFiltered.Value(); - } - if (mAutoResubscribe.HasValue()) { - params.resubscribeIfLost = mAutoResubscribe.Value(); - } - [cluster subscribeAttributeGeneratedCommandListWithParams:params - subscriptionEstablished:^() { - mSubscriptionEstablished = YES; - } - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"ClientMonitoring.GeneratedCommandList response %@", [value description]); - SetCommandExitStatus(error); - }]; - - return CHIP_NO_ERROR; - } -}; - -/* - * Attribute AcceptedCommandList - */ -class ReadClientMonitoringAcceptedCommandList : public ReadAttribute { -public: - ReadClientMonitoringAcceptedCommandList() - : ReadAttribute("accepted-command-list") - { - } - - ~ReadClientMonitoringAcceptedCommandList() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00001046) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterClientMonitoring alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"ClientMonitoring.AcceptedCommandList response %@", [value description]); - if (error != nil) { - LogNSError("ClientMonitoring AcceptedCommandList read Error", error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } -}; - -class SubscribeAttributeClientMonitoringAcceptedCommandList : public SubscribeAttribute { -public: - SubscribeAttributeClientMonitoringAcceptedCommandList() - : SubscribeAttribute("accepted-command-list") - { - } - - ~SubscribeAttributeClientMonitoringAcceptedCommandList() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00001046) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterClientMonitoring alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; - if (mKeepSubscriptions.HasValue()) { - params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); - } - if (mFabricFiltered.HasValue()) { - params.filterByFabric = mFabricFiltered.Value(); - } - if (mAutoResubscribe.HasValue()) { - params.resubscribeIfLost = mAutoResubscribe.Value(); - } - [cluster subscribeAttributeAcceptedCommandListWithParams:params - subscriptionEstablished:^() { - mSubscriptionEstablished = YES; - } - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"ClientMonitoring.AcceptedCommandList response %@", [value description]); - SetCommandExitStatus(error); - }]; - - return CHIP_NO_ERROR; - } -}; - -/* - * Attribute AttributeList - */ -class ReadClientMonitoringAttributeList : public ReadAttribute { -public: - ReadClientMonitoringAttributeList() - : ReadAttribute("attribute-list") - { - } - - ~ReadClientMonitoringAttributeList() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00001046) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterClientMonitoring alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"ClientMonitoring.AttributeList response %@", [value description]); - if (error != nil) { - LogNSError("ClientMonitoring AttributeList read Error", error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } -}; - -class SubscribeAttributeClientMonitoringAttributeList : public SubscribeAttribute { -public: - SubscribeAttributeClientMonitoringAttributeList() - : SubscribeAttribute("attribute-list") - { - } - - ~SubscribeAttributeClientMonitoringAttributeList() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00001046) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterClientMonitoring alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; - if (mKeepSubscriptions.HasValue()) { - params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); - } - if (mFabricFiltered.HasValue()) { - params.filterByFabric = mFabricFiltered.Value(); - } - if (mAutoResubscribe.HasValue()) { - params.resubscribeIfLost = mAutoResubscribe.Value(); - } - [cluster subscribeAttributeAttributeListWithParams:params - subscriptionEstablished:^() { - mSubscriptionEstablished = YES; - } - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"ClientMonitoring.AttributeList response %@", [value description]); - SetCommandExitStatus(error); - }]; - - return CHIP_NO_ERROR; - } -}; - -/* - * Attribute FeatureMap - */ -class ReadClientMonitoringFeatureMap : public ReadAttribute { -public: - ReadClientMonitoringFeatureMap() - : ReadAttribute("feature-map") - { - } - - ~ReadClientMonitoringFeatureMap() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00001046) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterClientMonitoring alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ClientMonitoring.FeatureMap response %@", [value description]); - if (error != nil) { - LogNSError("ClientMonitoring FeatureMap read Error", error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } -}; - -class SubscribeAttributeClientMonitoringFeatureMap : public SubscribeAttribute { -public: - SubscribeAttributeClientMonitoringFeatureMap() - : SubscribeAttribute("feature-map") - { - } - - ~SubscribeAttributeClientMonitoringFeatureMap() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00001046) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterClientMonitoring alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; - if (mKeepSubscriptions.HasValue()) { - params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); - } - if (mFabricFiltered.HasValue()) { - params.filterByFabric = mFabricFiltered.Value(); - } - if (mAutoResubscribe.HasValue()) { - params.resubscribeIfLost = mAutoResubscribe.Value(); - } - [cluster subscribeAttributeFeatureMapWithParams:params - subscriptionEstablished:^() { - mSubscriptionEstablished = YES; - } - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ClientMonitoring.FeatureMap response %@", [value description]); - SetCommandExitStatus(error); - }]; - - return CHIP_NO_ERROR; - } -}; - -/* - * Attribute ClusterRevision - */ -class ReadClientMonitoringClusterRevision : public ReadAttribute { -public: - ReadClientMonitoringClusterRevision() - : ReadAttribute("cluster-revision") - { - } - - ~ReadClientMonitoringClusterRevision() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00001046) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterClientMonitoring alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ClientMonitoring.ClusterRevision response %@", [value description]); - if (error != nil) { - LogNSError("ClientMonitoring ClusterRevision read Error", error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } -}; - -class SubscribeAttributeClientMonitoringClusterRevision : public SubscribeAttribute { -public: - SubscribeAttributeClientMonitoringClusterRevision() - : SubscribeAttribute("cluster-revision") - { - } - - ~SubscribeAttributeClientMonitoringClusterRevision() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00001046) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterClientMonitoring alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; - if (mKeepSubscriptions.HasValue()) { - params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); - } - if (mFabricFiltered.HasValue()) { - params.filterByFabric = mFabricFiltered.Value(); - } - if (mAutoResubscribe.HasValue()) { - params.resubscribeIfLost = mAutoResubscribe.Value(); - } - [cluster subscribeAttributeClusterRevisionWithParams:params - subscriptionEstablished:^() { - mSubscriptionEstablished = YES; - } - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ClientMonitoring.ClusterRevision response %@", [value description]); - SetCommandExitStatus(error); - }]; - - return CHIP_NO_ERROR; - } -}; - /*----------------------------------------------------------------------------*\ | Cluster UnitTesting | 0xFFF1FC05| |------------------------------------------------------------------------------| @@ -101501,42 +100705,6 @@ void registerClusterElectricalMeasurement(Commands & commands) commands.Register(clusterName, clusterCommands); } -void registerClusterClientMonitoring(Commands & commands) -{ - using namespace chip::app::Clusters::ClientMonitoring; - - const char * clusterName = "ClientMonitoring"; - - commands_list clusterCommands = { - make_unique(Id), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(Id), // - make_unique(), // - make_unique(Id), // - make_unique(Id), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - }; - - commands.Register(clusterName, clusterCommands); -} void registerClusterUnitTesting(Commands & commands) { using namespace chip::app::Clusters::UnitTesting; @@ -101913,6 +101081,5 @@ void registerClusters(Commands & commands) registerClusterApplicationBasic(commands); registerClusterAccountLogin(commands); registerClusterElectricalMeasurement(commands); - registerClusterClientMonitoring(commands); registerClusterUnitTesting(commands); } diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index 2a80d4ddec15e7..d97c7a72260270 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -220,7 +220,6 @@ class TestList : public Command { printf("TestAccessControlConstraints\n"); printf("TestLevelControlWithOnOffDependency\n"); printf("TestCommissioningWindow\n"); - printf("TestClientMonitoringCluster\n"); printf("TestMultiAdmin\n"); printf("Test_TC_DGSW_1_1\n"); printf("TestSubscribe_OnOff\n"); @@ -104162,356 +104161,6 @@ class TestCommissioningWindow : public TestCommandBridge { } }; -class TestClientMonitoringCluster : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - TestClientMonitoringCluster() - : TestCommandBridge("TestClientMonitoringCluster") - , mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~TestClientMonitoringCluster() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TestClientMonitoringCluster\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TestClientMonitoringCluster\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Register Client 2 - Invalid\n"); - err = TestRegisterClient2Invalid_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Register Client 1\n"); - err = TestRegisterClient1_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Register Client 2 - Invalid\n"); - err = TestRegisterClient2Invalid_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Verify Register Client\n"); - err = TestVerifyRegisterClient_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Unregister Client - Invalid Client NodeId\n"); - err = TestUnregisterClientInvalidClientNodeId_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Unregister Client - Invalid ICid\n"); - err = TestUnregisterClientInvalidICid_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Unregister Client - Valid\n"); - err = TestUnregisterClientValid_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Verify Register Client - Empty\n"); - err = TestVerifyRegisterClientEmpty_8(); - break; - } - - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - - void OnStatusUpdate(const chip::app::StatusIB & status) override - { - switch (mTestIndex - 1) { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); - break; - case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_RESOURCE_EXHAUSTED)); - break; - case 4: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 5: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); - break; - case 6: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); - break; - case 7: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 8: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - } - - // Go on to the next test. - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 9; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); - } - - CHIP_ERROR TestRegisterClient2Invalid_1() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterClientMonitoring alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRClientMonitoringClusterRegisterClientMonitoringParams alloc] init]; - params.clientNodeId = [NSNumber numberWithUnsignedLongLong:0ULL]; - params.iCid = [NSNumber numberWithUnsignedLongLong:0ULL]; - [cluster registerClientMonitoringWithParams:params - completion:^(NSError * _Nullable err) { - NSLog(@"Register Client 2 - Invalid Error: %@", err); - - VerifyOrReturn(CheckValue("status", - err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] - ? err.code - : EMBER_ZCL_STATUS_FAILURE) - : 0, - EMBER_ZCL_STATUS_FAILURE)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestRegisterClient1_2() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterClientMonitoring alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRClientMonitoringClusterRegisterClientMonitoringParams alloc] init]; - params.clientNodeId = [NSNumber numberWithUnsignedLongLong:10ULL]; - params.iCid = [NSNumber numberWithUnsignedLongLong:20ULL]; - [cluster registerClientMonitoringWithParams:params - completion:^(NSError * _Nullable err) { - NSLog(@"Register Client 1 Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestRegisterClient2Invalid_3() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterClientMonitoring alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRClientMonitoringClusterRegisterClientMonitoringParams alloc] init]; - params.clientNodeId = [NSNumber numberWithUnsignedLongLong:11ULL]; - params.iCid = [NSNumber numberWithUnsignedLongLong:21ULL]; - [cluster registerClientMonitoringWithParams:params - completion:^(NSError * _Nullable err) { - NSLog(@"Register Client 2 - Invalid Error: %@", err); - - VerifyOrReturn(CheckValue("status", - err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] - ? err.code - : EMBER_ZCL_STATUS_FAILURE) - : 0, - EMBER_ZCL_STATUS_RESOURCE_EXHAUSTED)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestVerifyRegisterClient_4() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterClientMonitoring alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRReadParams alloc] init]; - params.filterByFabric = true; - [cluster readAttributeExpectedClientsWithParams:params - completion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify Register Client Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue( - "ExpectedClients", [actualValue count], static_cast(1))); - VerifyOrReturn(CheckValue("ClientNodeId", - ((MTRClientMonitoringClusterMonitoringRegistration *) actualValue[0]) - .clientNodeId, - 10ULL)); - VerifyOrReturn(CheckValue("ICid", - ((MTRClientMonitoringClusterMonitoringRegistration *) actualValue[0]).iCid, - 20ULL)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestUnregisterClientInvalidClientNodeId_5() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterClientMonitoring alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRClientMonitoringClusterUnregisterClientMonitoringParams alloc] init]; - params.clientNodeId = [NSNumber numberWithUnsignedLongLong:30ULL]; - params.iCid = [NSNumber numberWithUnsignedLongLong:20ULL]; - [cluster unregisterClientMonitoringWithParams:params - completion:^(NSError * _Nullable err) { - NSLog(@"Unregister Client - Invalid Client NodeId Error: %@", err); - - VerifyOrReturn(CheckValue("status", - err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] - ? err.code - : EMBER_ZCL_STATUS_FAILURE) - : 0, - EMBER_ZCL_STATUS_FAILURE)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestUnregisterClientInvalidICid_6() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterClientMonitoring alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRClientMonitoringClusterUnregisterClientMonitoringParams alloc] init]; - params.clientNodeId = [NSNumber numberWithUnsignedLongLong:10ULL]; - params.iCid = [NSNumber numberWithUnsignedLongLong:30ULL]; - [cluster unregisterClientMonitoringWithParams:params - completion:^(NSError * _Nullable err) { - NSLog(@"Unregister Client - Invalid ICid Error: %@", err); - - VerifyOrReturn(CheckValue("status", - err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] - ? err.code - : EMBER_ZCL_STATUS_FAILURE) - : 0, - EMBER_ZCL_STATUS_FAILURE)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestUnregisterClientValid_7() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterClientMonitoring alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRClientMonitoringClusterUnregisterClientMonitoringParams alloc] init]; - params.clientNodeId = [NSNumber numberWithUnsignedLongLong:10ULL]; - params.iCid = [NSNumber numberWithUnsignedLongLong:20ULL]; - [cluster unregisterClientMonitoringWithParams:params - completion:^(NSError * _Nullable err) { - NSLog(@"Unregister Client - Valid Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestVerifyRegisterClientEmpty_8() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterClientMonitoring alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRReadParams alloc] init]; - params.filterByFabric = true; - [cluster readAttributeExpectedClientsWithParams:params - completion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Verify Register Client - Empty Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue( - "ExpectedClients", [actualValue count], static_cast(0))); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } -}; - class TestMultiAdmin : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced @@ -130209,7 +129858,6 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), - make_unique(), make_unique(), make_unique(), make_unique(),